Skip to content

Command line

Learn which command-line options Gruxi supports.

To get the command-line options currently supported by Gruxi, you can use:

bash
gruxi --help

Get the current version:

bash
gruxi --version

Command line arguments

Gruxi supports various command-line arguments to control its behavior and configuration.

Controlling operation mode

Gruxi operation mode controls the level of logging and debugging information generated at runtime. Different modes can be set to optimize for development or production environments. Production mode is the default, and the selected mode is stored in the database. Operation mode can be changed in two ways: from the admin portal menu or by using a command-line option.

Available operation modes:

  • ULTIMATE: Ultimate mode with no request/response logging for optimal performance.
  • PRODUCTION: Production mode with minimal logging for high performance.
  • DEBUG: Development mode with debug logging for debugging purposes.
  • DEV: Development mode with trace level logging for development purposes.

You can set the operation mode directly from the command line when starting Gruxi, by using the -o or --opmode argument followed by the desired mode.

Examples:

bash
gruxi -o PRODUCTION
bash
gruxi --opmode DEV

This will start Gruxi in the specified operation mode, overriding the mode set in the database for that session. It can still be changed from the admin portal when running, even after being set on the command line.

Exporting the current configuration

You can use the command line to export the current configuration to a file for backup or transfer purposes. The configuration is exported to the specified file path in JSON format.

Examples:

bash
gruxi -e my_config.json
bash
gruxi --export-conf ./config/my_config.json

Importing a configuration

You can use the command line to import a configuration from a file. This is useful for restoring a backup or transferring settings from another Gruxi instance.

Examples:

bash
gruxi -i my_config.json
bash
gruxi --import-conf ./config/my_config.json

Validating a configuration

Before importing a configuration, you can validate it to ensure it is correctly formatted and contains no errors. This helps prevent issues when applying the configuration to Gruxi.

Examples:

bash
gruxi --validate-conf my_config.json

Reset admin password

The password for user admin can be reset using the command line if it was forgotten or needs to be changed. The new password will be displayed in the console output after running the command.

Examples:

bash
gruxi --reset-admin-password

Disable admin portal

You can disable the admin portal using the command line for security or other reasons. This prevents access to the admin interface. To enable it again, restart the Gruxi service without the --disable-admin-portal option.

Examples:

bash
gruxi --disable-admin-portal