CLI Commands
Overview
ONES Open Platform Diagtools CLI Commands.
note
The developer invokes the CLI command template: diagtools [command] [arguments] [options]
Index
Command | Description |
---|---|
help | Display help for Diagtools CLI |
autocomplete | Display autocomplete installation instructions |
config set | Set the current profile variable |
config get | Get the current profile variable |
config delete | Delete the current profile variable |
config list | List the current profile variables |
profile create | Create a new profile |
profile use | Switch a specified profile |
profile delete | Delete a specified profile |
profile list | List all profiles |
log | Print a component logs |
list | List the component status |
dump | Dump current time data |
Command
help
Display help for Diagtools CLI.
diagtools help [COMMAND]
Arguments
Argument | Description |
---|---|
COMMAND | Command to show help for. |
Options
Option | Alias | Description |
---|---|---|
--nested-commands | -n | Include all nested commands in the output. |
Examples
$ diagtools help autocomplete
display autocomplete installation instructions
USAGE
$ diagtools autocomplete [SHELL] [-r]
ARGUMENTS
SHELL shell type
FLAGS
-r, --refresh-cache Refresh cache (ignores displaying instructions)
DESCRIPTION
display autocomplete installation instructions
EXAMPLES
$ diagtools autocomplete
$ diagtools autocomplete bash
$ diagtools autocomplete zsh
$ diagtools autocomplete --refresh-cache
autocomplete
Display autocomplete installation instructions.
diagtools autocomplete [SHELL]
Arguments
Argument | Description |
---|---|
SHELL | shell type |
Options
Option | Alias | Description |
---|---|---|
--refresh-cache | -r | Refresh cache (ignores displaying instructions) |
Examples
$ diagtools autocomplete
Building the autocomplete cache... done
Setup Instructions for DIAGTOOLS CLI Autocomplete ---
1) Add the autocomplete env var to your zsh profile and source it
$ printf "eval $(diagtools autocomplete:script zsh)" >> ~/.zshrc; source ~/.zshrc
NOTE: After sourcing, you can run `$ compaudit -D` to ensure no permissions conflicts are present
2) Test it out, e.g.:
$ diagtools <TAB> # Command completion
$ diagtools command --<TAB> # Flag completion
Enjoy!
Run the prompt command as prompted.
$ printf "eval $(diagtools autocomplete:script zsh)" >> ~/.zshrc
$ source ~/.zshrc
Try using the completion feature.
$ diagtools l <TAB>
list -- list the component status
log -- print a component logs
config set
Set the current profile variable.
diagtools config set KEY VALUE
Arguments
Argument | Description |
---|---|
KEY | Configuration variable name |
VALUE | Configuration variable value |
Options
Option | Description |
---|---|
--verbose | Verbose output |
Examples
$ diagtools config set address tcp://127.0.0.1:30002
config set successfully
config get
Get the current profile variable.
diagtools config get KEY
Arguments
Argument | Description |
---|---|
KEY | Configuration variable name |
Options
Option | Description |
---|---|
--verbose | Verbose output |
Examples
$ diagtools config get address
tcp://127.0.0.1:30002
config delete
Delete the current profile variable.
diagtools config delete KEY
Arguments
Argument | Description |
---|---|
KEY | Configuration variable name |
Options
Option | Description |
---|---|
--verbose | Verbose output |
Examples
$ diagtools config delete address
config delete successfully
config list
List the current profile variables.
diagtools config list
Options
Option | Description |
---|---|
--verbose | Verbose output |
Examples
$ diagtools config list
address = tcp://127.0.0.1:30002
profile create
Create a new profile.
caution
This command does not help you switch to the new profile, you need to use the profile use
manual switch.
diagtools profile create NAME
Arguments
Argument | Description |
---|---|
NAME | New profile name |
Options
Option | Description |
---|---|
--verbose | Verbose output |
Examples
diagtools profile create example
The example profile successfully created
profile use
Switch a specified profile.
diagtools profile use NAME
Arguments
Argument | Description |
---|---|
NAME | Profile name |
Options
Option | Description |
---|---|
--verbose | Verbose output |
Examples
$ diagtools profile use example
The example profile successfully switched
profile delete
Delete a specified profile.
diagtools profile delete NAME
Arguments
Argument | Description |
---|---|
NAME | Profile name |
Options
Option | Description |
---|---|
--verbose | Verbose output |
Examples
$ diagtools profile delete example
The example profile successfully deleted
profile list
List all profiles.
diagtools profile list
Options
Option | Description |
---|---|
--verbose | Verbose output |
Examples
$ diagtools profile list
example
log
Print a component logs.
diagtools log TYPE
Arguments
Argument | Description |
---|---|
TYPE | The component type, options: (platform , host , plugin ) |
Options
Option | Alias | Description |
---|---|---|
--verbose | Verbose output | |
--address <value> | Override the execution of the address attribute in the profile | |
--organizationUUID <value> | Override the execution of the organizationUUID attribute in the profile | |
--teamUUID <value> | Override the execution of the teamUUID attribute in the profile | |
--extended | -x | show extra columns |
--columns <value> | only show provided columns (comma-separated) | |
--filter <value> | filter property by partial string matching, ex: name=foo | |
--from <value> | load the local data file (the value can be a relative path or an absolute path) |
Examples
$ diagtools log plugin --id ce1f55d2
{"Level":"Info","Message":"[Plugin] Install","Time":"2022/11/29 14:55:27"}
{"Level":"Info","Message":"[Plugin] Enable","Time":"2022/11/29 14:56:05"}
list
List the component status.
diagtools list TYPE
Arguments
Argument | Description |
---|---|
TYPE | 组件类型,选项:(plugins , abilities , components ) |
Options
Option | Alias | Description |
---|---|---|
--verbose | Verbose output | |
--address <value> | Override the execution of the address attribute in the profile | |
--organizationUUID <value> | Override the execution of the organizationUUID attribute in the profile | |
--teamUUID <value> | Override the execution of the teamUUID attribute in the profile | |
--extended | -x | Show extra columns |
--csv | --output=csv | Output is csv format [alias: --output=csv] |
--output <option> | Output in a more machine friendly format,options: (csv ,json ,yaml ) | |
--columns <value> | Only show provided columns (comma-separated) | |
--filter <value> | Filter property by partial string matching, ex: name=foo | |
--from <value> | Load the local data file (the value can be a relative path or an absolute path) | |
--no-header | Hide table header from output | |
--no-truncate | Do not truncate output to fit screen | |
--sort <value> | Property to sort by (prepend '-' for descending) |
Examples
$ diagtools list plugins
InstanceID AppName AppID AppVersion Scope ScopeUUID HostID IsLocal Status RealStatus Apis
────────── ────────── ───────── ────────── ──────────── ───────── ────── ─────── ────────────── ────────────── ────────────────────────────────────────
ce1f55d2 Example FSksKfHR3 1.0.0 Team Pgg7h253 false DisableSuccess DisableSuccess [{""Methods":["POST"],"Url":"/hello",...
dump
Dump current time data.
diagtools dump PATH
Arguments
Argument | Description |
---|---|
PATH | dump path, the value can be a relative path or an absolute path |
Options
Option | Description |
---|---|
--verbose | Verbose output |
--address <value> | Override the execution of the address attribute in the profile |
--organizationUUID <value> | Override the execution of the organizationUUID attribute in the profile |
--teamUUID <value> | Override the execution of the teamUUID attribute in the profile |
Examples
$ diagtools dump .
dump successfully