Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add CLI to docs #3321

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- Exposes connection pool metrics, schema cache metrics
- #3248, Add more config examples to CLI - @taimoorzaeem
+ Now accepts ``--example-file``, ``--example-db``, and ``--example-env``
+ Add docs page for CLI

### Fixed

Expand Down
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ Technical references for PostgREST's functionality.

references/auth.rst
references/api.rst
references/cli.rst
references/transactions.rst
references/connection_pool.rst
references/schema_cache.rst
Expand Down
1 change: 1 addition & 0 deletions docs/postgrest.dict
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Cardano
casted
cd
centric
CLI
coercible
conf
Cloudflare
Expand Down
41 changes: 41 additions & 0 deletions docs/references/cli.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
.. _cli:

CLI
===

PostgREST provides a CLI to start and run your postgrest service. The CLI provides the commands listed below:

.. _cli_commands:

CLI Commands
------------

Help and Version
~~~~~~~~~~~~~~~~

.. code:: bash

$ postgrest [-h|--help]
$ postgrest [-v|--version]


Example Config
~~~~~~~~~~~~~~

.. code:: bash

$ postgrest [--example-file]
$ postgrest [--example-db]
$ postgrest [--example-env]
Comment on lines +28 to +29
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@taimoorzaeem Btw, if you'd like you could split this and do another PR with just the docs commit. That one is already mergeable.

Of course you'd need to remove the --example-db/--example/env in that commit since they belong to this PR.

Copy link
Collaborator Author

@taimoorzaeem taimoorzaeem Apr 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, you're right. That would be much more manageable. Closing this PR. I would create 2 new PRs one after another for this change.


These commands show the example configuration file of the selected type.


Config or Schema Cache
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about separating these? One section for config and another for the scache.

~~~~~~~~~~~~~~~~~~~~~~

.. code:: bash

$ postgrest [--dump-config|--dump-schema-cache] [FILENAME]

Here ``FILENAME`` is the path to configuration file.
Loading