Webapp CLI
The IQRF Gateway Webapp manager is a command-line interface that can be used to manage the Webapp database and features from a command shell.
Synopsis
The basic syntax for using the CLI tool is as follows:
bash
iqrf-gateway-webapp-manager <command> [options] [arguments]Use iqrf-gateway-webapp-manager help <command> to display help message for specified command. Commands, their parameters and usage can be found below. Commands can either be used in interactive mode by not specifying options, or non-interactive mode if all options are specified or the --no-interaction option is used. Commands are split into several sections, options for each command group are at the end of the respective section.
General options
General options applicable to any command.
| Short | Long | Description |
|---|---|---|
-h | --help | Displays the help message for the given command |
--silent | Do not output any message | |
-q | --quiet | Only errors are displayed, all other output is suppressed |
-V | --version | Display version of this application |
--ansi | Force ANSI output | |
--no-ansi | Disable ANSI output | |
-n | --no-interaction | Do not ask any interactive questions |
-v|vv|vvv | --verbose | Increases verbosity of messages: v for normal output, vv for more verbose output and vvv for debug |
General commands
General commands for usage of the CLI tool.
help
Displays help message for a specific command with description, arguments and usage.
Usage:
iqrf-gateway-webapp-manager help [--format FORMAT] [--raw] <command>list
Lists all available commands, optionally only commands in the specified namespace (e.g. user).
Usage:
iqrf-gateway-webapp-manager list [--format FORMAT] [--raw] [--short] [<namespace>]completion
Dumps the shell completion script. Supported shells are bash, fish and zsh. If the shell is not specified, the value of the $SHELL environment variable is used.
Usage:
iqrf-gateway-webapp-manager completion [--debug] [<shell>]To enable bash completion, dump the script to a global completion file and restart your shell:
iqrf-gateway-webapp-manager completion bash | sudo tee /etc/bash_completion.d/iqrf-gateway-webapp-managernette:cache:purge
Clears webapp cache.
Usage:
iqrf-gateway-webapp-manager nette:cache:purge [--recreate]nette:latte:purge
Clears cache of compiled Latte templates.
Usage:
iqrf-gateway-webapp-manager nette:latte:purgenette:latte:warmup
Compiles Latte templates into cache.
Usage:
iqrf-gateway-webapp-manager nette:latte:warmupopen-api:specification
Prints OpenAPI specification of the webapp REST API.
Usage:
iqrf-gateway-webapp-manager open-api:specificationGeneral command options
Options for general commands.
| Short | Long | Command | Description |
|---|---|---|---|
N/A | --format | help, list | Output format, available options: txt, xml, json, md |
N/A | --raw | help, list | Outputs raw command help or command list |
N/A | --short | list | Skips describing commands' arguments |
N/A | --debug | completion | Tails the completion debug log |
N/A | --recreate | nette:cache:purge | Recreates cache folders |
API key commands
Commands used to manage API keys stored in the webapp database.
api-key:list
Lists all existing API keys and their meta data.
Usage:
iqrf-gateway-webapp-manager api-key:listapi-key:add
Creates a new API key and stores it in the database.
Usage:
iqrf-gateway-webapp-manager api-key:add [-d|--description DESCRIPTION] [-e|--expiration EXPIRATION] [--no-formatting]Note: To create API key with no expiration date, use the --no-interaction option and omit the -e|--expiration option. Alternatively, submit empty value in interactive mode.
api-key:edit
Edits an existing API key and stores changes in the database.
Usage:
iqrf-gateway-webapp-manager api-key:edit [-i|--id ID] [-d|--description DESCRIPTION] [-e|--expiration EXPIRATION]api-key:delete
Removes an existing API key from the database.
Usage:
iqrf-gateway-webapp-manager api-key:delete [-i|--id ID]API key command options
Options for API key commands.
| Short | Long | Description |
|---|---|---|
-i | --id | API key ID |
-d | --description | API key description |
-e | --expiration | API key expiration |
N/A | --no-formatting | Outputs API key without formatting |
Database commands
Commands used to manage the webapp database.
migrations:migrate
Executes database migration to the latest version.
Usage:
iqrf-gateway-webapp-manager migrations:migrateFeature commands
Commands used to manage webapp features.
feature:list
Lists all available webapp features.
Usage:
iqrf-gateway-webapp-manager feature:listfeature:enable
Enables a feature. Multiple features can be specified to be enabled at once.
Usage:
iqrf-gateway-webapp-manager feature:enable <feature_name>iqrf-gateway-webapp-manager feature:enable <feature1_name> <feature2_name> ...feature:disable
Disables a feature. Multiple features can be specified to be disabled at once.
Usage:
iqrf-gateway-webapp-manager feature:disable <feature_name>iqrf-gateway-webapp-manager feature:disable <feature1_name> <feature2_name> ...IQRF OS patch commands
Commands used to manage IQRF OS patches stored in the webapp database.
iqrf-os:list-patches
Lists all IQRF OS patches stored in the database.
Usage:
iqrf-gateway-webapp-manager iqrf-os:list-patchesiqrf-os:import-patches
Imports IQRF OS patches distributed with the webapp into the database.
Usage:
iqrf-gateway-webapp-manager iqrf-os:import-patchesMapping commands
Commands used to manage board pin mappings stored in webapp database.
mapping:list
Lists all existing mappings in database and their properties.
Usage:
iqrf-gateway-webapp-manager mapping:listmapping:add
Creates a new board mapping and stores it in the database.
Usage:
iqrf-gateway-webapp-manager mapping:add [-t|--type TYPE] [-N|--name NAME] [-d|--device-type DEVICE_TYPE] [-I|--interface INTERFACE] [-b|--bus-pin BUS_PIN] [-p|--pgm-pin PGM_PIN] [-P|--power-pin POWER_PIN] [-r|--baud-rate BAUD_RATE]Note: Baud rate is an optional argument unless the mapping type is set to UART.
mapping:edit
Edits an existing board mapping and stores changes in the database.
Usage:
iqrf-gateway-webapp-manager mapping:edit [-i|--mapping-id ID] [-t|--type TYPE] [-N|--name NAME] [-d|--device-type DEVICE_TYPE] [-I|--interface INTERFACE] [-b|--bus-pin BUS_PIN] [-p|--pgm-pin PGM_PIN] [-P|--power-pin POWER_PIN] [-r|--baud-rate BAUD_RATE]mapping:remove
Removes an existing board mapping from the database.
Usage:
iqrf-gateway-webapp-manager mapping:remove [-i|--mapping-id ID]Mapping command options
Options for board mapping commands.
| Short | Long | Description |
|---|---|---|
-i | --mapping-id | Mapping ID |
-t | --type | Mapping type, available options: spi, uart |
-N | --name | Mapping name |
-d | --device-type | Mapping device type, available options: adapter, board |
-I | --interface | Mapping device name, example: /dev/ttyS0 |
-b | --bus-pin | Mapping bus enable GPIO pin number |
-p | --pgm-pin | Mapping programming mode switch GPIO pin number |
-P | --power-pin | Mapping power enable GPIO pin number |
-r | --baud-rate | (optional) Baud rate for mapping type UART, available options: 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200, 230400 |
User commands
Commands used to manage user profiles stored in the webapp database.
user:list
Lists all existing user profiles.
Usage:
iqrf-gateway-webapp-manager user:list [-J|--output-json]user:add
Creates a new user profile and stores it in the database.
Usage:
iqrf-gateway-webapp-manager user:add [-u|--username USERNAME] [-p|--password PASSWORD] [-r|--role ROLE] [-l|--language LANGUAGE]user:edit
Edits an existing user profile and stores changes in the database.
Usage:
iqrf-gateway-webapp-manager user:edit [-u|--username USERNAME] [-r|--role ROLE] [-l|--language LANGUAGE]user:password
Changes password of an existing user profile and stores changes in the database.
Usage:
iqrf-gateway-webapp-manager user:password [-u|--username USERNAME] [-p|--password PASSWORD]user:remove
Removes an existing user profile from the database.
Usage:
iqrf-gateway-webapp-manager user:remove [-u|--username USERNAME]user:remove-all
Removes all user profiles from the database, optionally only users with the specified role.
Usage:
iqrf-gateway-webapp-manager user:remove-all [-r|--role ROLE]User command options
Options for user commands.
| Short | Long | Description |
|---|---|---|
-u | --username | Username |
-p | --password | User's password |
-r | --role | User's role, available options: admin, normal, basic |
-l | --language | User's interface language, available options: en, cs |
-J | --output-json | Outputs the user list as JSON |
WebSocket proxy commands
websocket:proxy:run
Starts the WebSocket proxy.
Usage:
iqrf-gateway-webapp-manager websocket:proxy:runWireGuard VPN commands
WARNING
WireGuard VPN commands are available only in IQRF Gateway Webapp versions before 2.7.0.
Commands used to manage WireGuard VPN tunnels stored in the webapp database.
wireguard:list
Lists all existing WireGuard VPN tunnels.
Usage:
iqrf-gateway-webapp-manager wireguard:listwireguard:activate
Activates specified WireGuard VPN tunnel.
Usage:
iqrf-gateway-webapp-manager wireguard:activate <tunnel_name>wireguard:deactivate
Deactivates specified WireGuard VPN tunnel.
Usage:
iqrf-gateway-webapp-manager wireguard:deactivate <tunnel_name>