doc: CLI configuration instructions details

This commit is contained in:
Éloi Rivard 2024-11-20 14:10:35 +01:00
parent a1f298cf70
commit 9746a9af3c
No known key found for this signature in database
GPG key ID: 7EDA204EA57DD184
2 changed files with 9 additions and 5 deletions

View file

@ -3,13 +3,14 @@ Command Line Interface
Canaille provide several commands to help administrator manage their data.
The configuration file has to be prefixed before running `canaille`. For readability's sake, it's omitted in the examples.
Generally, some configuration has to be loaded by `Canaille`.
This can be achieved by :ref:`configuration loading method<references/configuration:Load the configuration>` available, but most of the time a ``CONFIG`` environent variable is used.
For the sake of readability, it is omitted in the following examples.
.. code-block:: shell
env CONFIG=path/to/config.toml canaille ...
.. _cli_check:
.. click:: canaille.app.commands:check

View file

@ -1,10 +1,13 @@
Configuration
#############
Load the configuration
======================
Canaille can be configured either by a environment variables, environment file, or by a configuration file.
Configuration file
==================
~~~~~~~~~~~~~~~~~~
The configuration can be written in `toml` configuration file which path is passed in the :envvar:`CONFIG` environment variable.
@ -23,7 +26,7 @@ The configuration can be written in `toml` configuration file which path is pass
You can have a look at the :ref:`example file <references/configuration:Example file>` for inspiration.
Environment variables
=====================
~~~~~~~~~~~~~~~~~~~~~
In addition, parameters that have not been set in the configuration file can be read from environment variables.
The way environment variables are parsed can be read from the `pydantic-settings documentation <https://docs.pydantic.dev/latest/concepts/pydantic_settings/#parsing-environment-variable-values>`_.
@ -34,7 +37,7 @@ The way environment variables are parsed can be read from the `pydantic-settings
For instance, the ``NAME`` var in the ``CANAILLE`` section shown above is ``CANAILLE__NAME``.
Environment file
================
~~~~~~~~~~~~~~~~
Any environment variable can also be written in a ``.env``, and will be read if present.