Custom CLI commands definitions
The following table shows all the available fields for custom CLI commands.
Considerations
-
Either name or opt_arg is required for optional arguments (at least one must be present)
-
The executable field is required for leaf commands (commands that don't have any child commands), but optional for command groups (commands that have children)
| Field | Type | Required | Description |
|---|---|---|---|
| cmd_definition | object | Yes | Root object containing the command definition |
| cmd_definition.name | string | Yes | The name of the command (minimum 1 character) |
| cmd_definition.short_description | string | Yes | Brief description shown in command listings |
| cmd_definition.long_description | string | Yes | Detailed description shown in help output |
| cmd_definition.shortname | array of strings | No | List of aliases for the command (e.g., ["ct", "tool"]) |
| cmd_definition.cmd_parent | array of strings | No | Parent command hierarchy (max 3 levels excluding 'pi', max 4 items total) |
| cmd_definition.executable | string | No* | Path to the executable script or program. *Required for leaf commands (commands without children) |
| cmd_definition.optional_args | array of objects | No | Optional command-line arguments/flags |
| cmd_definition.optional_args[].name | string | Yes** | Long-form name of the optional argument (used as --name) |
| cmd_definition.optional_args[].opt_arg | string | Yes** | Alternative name field for the optional argument |
| cmd_definition.optional_args[].shortname | string | No | Short-form alias (single character preferred, used as -s) |
| cmd_definition.optional_args[].short_opt_arg | string | No | Alternative short form field |
| cmd_definition.optional_args[].help_text | string | Yes | Help text describing the argument |
| cmd_definition.optional_args[].value | string | No | Placeholder name for the argument value (e.g., "FORMAT") |
| cmd_definition.positional_arguments | array of objects | No | Positional arguments for the command |
| cmd_definition.positional_arguments[].name | string | Yes | Name of the positional argument |
| cmd_definition.positional_arguments[].description | string | Yes | Description of the positional argument |
| cmd_definition.positional_arguments[].support_multiple | boolean | No | Whether multiple values are supported (default: false). Only the last positional argument can have this set to true |
| cmd_definition.examples | array of objects | No | Usage examples to demonstrate the command |
| cmd_definition.examples[].desc | string | Yes | Usage example description |
| cmd_definition.examples[].cmd | string | Yes | Sample command line demonstrating usage |