# Command-line interface ## The argos cli ```man Usage: argos [OPTIONS] COMMAND [ARGS]... Options: --help Show this message and exit. Commands: agent Get and run tasks for the provided server. server Commands for managing server, server’s configuration and users version Prints Argos’ version and exits ``` ## Agent command ```man Usage: argos agent [OPTIONS] SERVER_URL AUTH Get and run tasks for the provided server. Will wait for new tasks. Usage: argos agent https://argos.example.org "auth-token-here" Alternatively, you can use the following environment variables to avoid passing arguments to the agent on the command line: ARGOS_AGENT_SERVER_URL=https://argos.example.org ARGOS_AGENT_TOKEN=auth-token-here Options: --max-tasks INTEGER Number of concurrent tasks this agent can run --wait-time INTEGER Waiting time between two polls on the server (seconds) --log-level [DEBUG|INFO|WARNING|ERROR|CRITICAL] --help Show this message and exit. ``` ## Server commands ```man Usage: argos server [OPTIONS] COMMAND [ARGS]... Commands for managing server, server’s configuration and users Options: --help Show this message and exit. Commands: cleandb Clean the database (to run routinely) generate-config Output a self-documented example config file. generate-token Generate a token for agents migrate Run database migrations reload-config Load or reload tasks’ configuration start Starts the server (use only for testing or development!) user User management watch-agents Watch agents (to run routinely) ``` ### Server start ```man Usage: argos server start [OPTIONS] Starts the server (use only for testing or development!) See https://argos-monitoring.framasoft.org/deployment/systemd.html#server for advices on how to start the server for production. Options: --host TEXT Host to bind --port INTEGER Port to bind --config TEXT Path of the configuration file. If ARGOS_YAML_FILE environment variable is set, its value will be used instead. Default value: argos-config.yaml and /etc/argos/config.yaml as fallback. --reload Enable hot reloading --help Show this message and exit. ``` ### Server migrate ```man Usage: argos server migrate [OPTIONS] Run database migrations Options: --config TEXT Path of the configuration file. If ARGOS_YAML_FILE environment variable is set, its value will be used instead. Default value: argos-config.yaml and /etc/argos/config.yaml as fallback. --help Show this message and exit. ``` ### Server cleandb ```man Usage: argos server cleandb [OPTIONS] Clean the database (to run routinely) - Removes old results from the database. - Removes locks from tasks that have been locked for too long. Options: --max-results INTEGER Number of results per task to keep --max-lock-seconds INTEGER The number of seconds after which a lock is considered stale, must be higher than 60 (the checks have a timeout value of 60 seconds) --config TEXT Path of the configuration file. If ARGOS_YAML_FILE environment variable is set, its value will be used instead. Default value: argos-config.yaml and /etc/argos/config.yaml as fallback. --help Show this message and exit. ``` ### Server watch-agents ```man Usage: argos server cleandb [OPTIONS] Clean the database (to run routinely) - Removes old results from the database. - Removes locks from tasks that have been locked for too long. Options: --max-results INTEGER Number of results per task to keep --max-lock-seconds INTEGER The number of seconds after which a lock is considered stale, must be higher than 60 (the checks have a timeout value of 60 seconds) --config TEXT Path of the configuration file. If ARGOS_YAML_FILE environment variable is set, its value will be used instead. Default value: argos-config.yaml and /etc/argos/config.yaml as fallback. --help Show this message and exit. ``` ### Server reload-config ```man Usage: argos server reload-config [OPTIONS] Read tasks’ configuration and add/delete tasks in database if needed Options: --config TEXT Path of the configuration file. If ARGOS_YAML_FILE environment variable is set, its value will be used instead. Default value: argos-config.yaml and /etc/argos/config.yaml as fallback. --help Show this message and exit. ``` ### Server generate-config ```man Usage: argos server generate-config [OPTIONS] Output a self-documented example config file. Redirect the output to a file to save it: argos server generate-config > /etc/argos/config.yaml Options: --help Show this message and exit. ``` ### Server generate-token ```man Usage: argos server generate-token [OPTIONS] Generate a token, which can be used as an agent’s authentication token. It’s actually an UUID Options: --help Show this message and exit. ``` ### Server user management To access Argos’ web interface, you need to create at least one user. You can manage users only through CLI. ```man Usage: argos server user [OPTIONS] COMMAND [ARGS]... User management Options: --help Show this message and exit. Commands: add Add new user change-password Change user’s password delete Delete user disable Disable user enable Enable user show List all users verify-password Test user’s password ``` #### Add user ```man Usage: argos server user add [OPTIONS] Add new user Options: --config TEXT Path of the configuration file. If ARGOS_YAML_FILE environment variable is set, its value will be used instead. --name TEXT Name of the user to create. --password TEXT --help Show this message and exit. ``` #### Change the password of a user ```man Usage: argos server user change-password [OPTIONS] Change user’s password Options: --config TEXT Path of the configuration file. If ARGOS_YAML_FILE environment variable is set, its value will be used instead. --name TEXT Name of the user you want to change the password. --password TEXT --help Show this message and exit. ``` #### Delete a user ```man Usage: argos server user delete [OPTIONS] Delete user Options: --config TEXT Path of the configuration file. If ARGOS_YAML_FILE environment variable is set, its value will be used instead. --name TEXT Name of the user to delete. [required] --help Show this message and exit. ``` #### Disable a user Disabling a user prevents the user to login and access Argos’ web interface but its credentials are still stored in Argos’ database. ```man Usage: argos server user disable [OPTIONS] Disable user Options: --config TEXT Path of the configuration file. If ARGOS_YAML_FILE environment variable is set, its value will be used instead. --name TEXT Name of the user to disable. [required] --help Show this message and exit. ``` #### Enable a user Enabling a user prevents the user to login and access Argos’ web interface. Obviously, the user needs to exists and to be disabled before using the command. ```man Usage: argos server user enable [OPTIONS] Enable user Options: --config TEXT Path of the configuration file. If ARGOS_YAML_FILE environment variable is set, its value will be used instead. --name TEXT Name of the user to reenable [required] --help Show this message and exit. ``` #### List all users Show all accounts, with their status (enabled or disabled). ```man Usage: argos server user show [OPTIONS] List all users Options: --config TEXT Path of the configuration file. If ARGOS_YAML_FILE environment variable is set, its value will be used instead. --help Show this message and exit. ``` #### Test the password of a user You can verify that you have the right password for a user with the following command: ```man Usage: argos server user verify-password [OPTIONS] Test user’s password Options: --config TEXT Path of the configuration file. If ARGOS_YAML_FILE environment variable is set, its value will be used instead. --name TEXT Name of the user you want to test the password for. [required] --password TEXT --help Show this message and exit. ```