FitTrackee/docsrc/source/cli.rst

171 lines
3.4 KiB
ReStructuredText
Raw Normal View History

2022-04-24 13:16:10 +02:00
Command line interface
######################
2022-09-19 18:49:25 +02:00
A command line interface (CLI) is available to manage database, OAuth2 tokens and users.
2022-04-24 13:16:10 +02:00
.. code-block:: bash
$ ftcli
Usage: ftcli [OPTIONS] COMMAND [ARGS]...
FitTrackee Command Line Interface
Options:
--help Show this message and exit.
Commands:
db Manage database.
oauth2 Manage OAuth2 tokens.
users Manage users.
2022-04-24 13:16:10 +02:00
.. warning::
| The following commands are now deprecated and will be removed in a next version:
| - ``fittrackee_set_admin``
| - ``fittrackee_upgrade_db``
2022-11-27 12:06:42 +01:00
| - ``fittrackee_worker`` (disabled)
2022-04-24 13:16:10 +02:00
Database
~~~~~~~~
2023-03-05 14:26:31 +01:00
``ftcli db drop``
"""""""""""""""""
2022-04-24 13:16:10 +02:00
.. versionadded:: 0.6.5
2023-03-05 14:26:31 +01:00
Empty database and delete uploaded files, only on development environments.
2022-04-24 13:16:10 +02:00
2023-03-05 14:26:31 +01:00
``ftcli db upgrade``
""""""""""""""""""""
2022-04-24 13:16:10 +02:00
.. versionadded:: 0.6.5
2023-03-05 14:26:31 +01:00
Apply migrations.
2022-04-24 13:16:10 +02:00
OAuth2
~~~~~~
``ftcli oauth2 clean``
""""""""""""""""""""""
.. versionadded:: 0.7.0
Remove tokens expired for more than provided number of days
.. cssclass:: table-bordered
.. list-table::
:widths: 25 50
:header-rows: 1
* - Options
- Description
* - ``--days``
- Number of days.
2022-04-24 13:16:10 +02:00
Users
~~~~~
2023-03-05 14:26:31 +01:00
``ftcli users clean_archives``
""""""""""""""""""""""""""""""
.. versionadded:: 0.7.13
2023-03-05 14:26:31 +01:00
Delete export requests and related archives created more than provided number of days.
.. cssclass:: table-bordered
.. list-table::
:widths: 25 50
:header-rows: 1
* - Options
- Description
* - ``--days``
- Number of days.
2023-03-05 14:26:31 +01:00
``ftcli users clean_tokens``
""""""""""""""""""""""""""""
.. versionadded:: 0.7.0
2022-04-24 13:16:10 +02:00
2023-03-05 14:26:31 +01:00
Remove blacklisted tokens expired for more than provided number of days.
2022-04-24 13:16:10 +02:00
.. cssclass:: table-bordered
.. list-table::
:widths: 25 50
:header-rows: 1
* - Options
- Description
2023-03-05 14:26:31 +01:00
* - ``--days``
- Number of days.
2023-03-04 17:49:02 +01:00
2023-04-12 10:06:51 +02:00
``ftcli users create``
""""""""""""""""""""""
.. versionadded:: 0.7.15
Create a user account.
2023-04-12 17:32:08 +02:00
.. note::
- the newly created account is already active.
- the CLI allows to create users when registration is disabled.
2023-04-12 10:06:51 +02:00
.. cssclass:: table-bordered
.. list-table::
:widths: 25 50
:header-rows: 1
* - Arguments/options
- Description
* - ``USERNAME``
- Username.
* - ``--email EMAIL``
- User email (mandatory).
* - ``--password PASSWORD``
- User password (if not provided, a random password is generated).
2023-03-05 14:26:31 +01:00
``ftcli users export_archives``
"""""""""""""""""""""""""""""""
2023-03-04 17:49:02 +01:00
.. versionadded:: 0.7.13
2023-03-05 14:26:31 +01:00
Process incomplete user export requests.
Can be used if redis is not set (no dramatiq workers running).
2023-03-04 17:49:02 +01:00
.. cssclass:: table-bordered
.. list-table::
:widths: 25 50
:header-rows: 1
* - Options
- Description
2023-03-05 14:26:31 +01:00
* - ``--max``
- Maximum number of export requests to process.
2023-03-04 17:49:02 +01:00
2023-03-05 14:26:31 +01:00
``ftcli users update``
""""""""""""""""""""""
.. versionadded:: 0.6.5
2023-03-04 17:49:02 +01:00
2023-03-05 14:26:31 +01:00
Modify a user account (admin rights, active status, email and password).
2023-03-04 17:49:02 +01:00
.. cssclass:: table-bordered
.. list-table::
:widths: 25 50
:header-rows: 1
2023-04-12 10:06:51 +02:00
* - Arguments/options
2023-03-04 17:49:02 +01:00
- Description
2023-04-12 10:06:51 +02:00
* - ``USERNAME``
- Username.
2023-03-05 14:26:31 +01:00
* - ``--set-admin BOOLEAN``
- Add/remove admin rights (when adding admin rights, it also activates user account if not active).
* - ``--activate``
- Activate user account.
* - ``--reset-password``
- Reset user password (a new password will be displayed).
* - ``--update-email EMAIL``
- Update user email.