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

Start with a specific configuration file

You can start Gruxi with a specific configuration file by using the -c or --config argument followed by the path to the file.

Examples:

bash
gruxi -c config/my_config.json
bash
gruxi --config my_config.json

Automatically load config file

Gruxi also looks for a configuration file named gruxi_config.json in the current working directory when it starts. If the file is present, Gruxi loads it automatically, so you do not need to pass the --config option.

The same approach works in Docker: mount a file named gruxi_config.json into the container's working directory, and Gruxi will load it automatically when the container starts.

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

Install Gruxi as a Windows service

Gruxi can be installed as a Windows service for optimal performance and reliability on Windows servers. This method ensures that Gruxi starts automatically with the system and runs in the background without requiring a user to be logged in. It is ideal for production environments where you want Gruxi to be always available and managed by the Windows Service Control Manager.

Examples:

cmd
gruxi.exe --install-service

Remove Gruxi Windows service

If you need to remove the Gruxi Windows service, you can use the following command:

cmd
gruxi.exe --remove-service