Files
postgrest/docs/references/cli.rst
T
Taimoor ZaeemandSteve Chavez ab2cd766c2 docs: document config file parameter on CLI page
The CLI page had the config file parameter missing. This commit
adds that. Also adds the CLI usage output which shows all
available options. Closes #4300.

Signed-off-by: Taimoor Zaeem <taimoorzaeem@gmail.com>
2025-09-26 19:26:47 -05:00

74 lines
1.3 KiB
ReStructuredText

.. _cli:
CLI
===
PostgREST provides a CLI with the options listed below:
.. code:: text
Usage: postgrest [-v|--version] [-e|--example] [--dump-config | --dump-schema]
[FILENAME]
PostgREST / create a REST API to an existing Postgres
database
Available options:
-h,--help Show this help text
-v,--version Show the version information
-e,--example Show an example configuration file
--dump-config Dump loaded configuration and exit
--dump-schema Dump loaded schema as JSON and exit (for debugging,
output structure is unstable)
FILENAME Path to configuration file
FILENAME
--------
Runs PostgREST with the given :ref:`file_config`.
Help
----
.. code:: bash
$ postgrest --help
Shows all the options available.
Version
-------
.. code:: bash
$ postgrest --version
Prints the PostgREST version.
Example
-------
.. code:: bash
$ postgrest --example
Shows example configuration settings.
Dump Config
-----------
.. code:: bash
$ postgrest --dump-config
Dumps the loaded :ref:`configuration` values, considering the configuration file, environment variables and :ref:`in_db_config`.
Dump Schema
-----------
.. code:: bash
$ postgrest --dump-schema
Dumps the schema cache in JSON format.