Skip to main content

CLI Commands

Overview

ONES Open Platform Diagtools CLI Commands.

note

The developer invokes the CLI command template: diagtools [command] [arguments] [options]

Index

CommandDescription
helpDisplay help for Diagtools CLI
autocompleteDisplay autocomplete installation instructions
config setSet the current profile variable
config getGet the current profile variable
config deleteDelete the current profile variable
config listList the current profile variables
profile createCreate a new profile
profile useSwitch a specified profile
profile deleteDelete a specified profile
profile listList all profiles
logPrint a component logs
listList the component status
dumpDump current time data

Command

help

Display help for Diagtools CLI.

diagtools help [COMMAND]

Arguments

ArgumentDescription
COMMANDCommand to show help for.

Options

OptionAliasDescription
--nested-commands-nInclude 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

ArgumentDescription
SHELLshell type

Options

OptionAliasDescription
--refresh-cache-rRefresh 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

ArgumentDescription
KEYConfiguration variable name
VALUEConfiguration variable value

Options

OptionDescription
--verboseVerbose 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

ArgumentDescription
KEYConfiguration variable name

Options

OptionDescription
--verboseVerbose output

Examples

$ diagtools config get address
tcp://127.0.0.1:30002

config delete

Delete the current profile variable.

diagtools config delete KEY

Arguments

ArgumentDescription
KEYConfiguration variable name

Options

OptionDescription
--verboseVerbose output

Examples

$ diagtools config delete address
config delete successfully

config list

List the current profile variables.

diagtools config list

Options

OptionDescription
--verboseVerbose 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

ArgumentDescription
NAMENew profile name

Options

OptionDescription
--verboseVerbose output

Examples

diagtools profile create example
The example profile successfully created

profile use

Switch a specified profile.

diagtools profile use NAME

Arguments

ArgumentDescription
NAMEProfile name

Options

OptionDescription
--verboseVerbose output

Examples

$ diagtools profile use example
The example profile successfully switched

profile delete

Delete a specified profile.

diagtools profile delete NAME

Arguments

ArgumentDescription
NAMEProfile name

Options

OptionDescription
--verboseVerbose output

Examples

$ diagtools profile delete example
The example profile successfully deleted

profile list

List all profiles.

diagtools profile list

Options

OptionDescription
--verboseVerbose output

Examples

$ diagtools profile list
example

log

Print a component logs.

diagtools log TYPE

Arguments

ArgumentDescription
TYPEThe component type, options: (platform, host, plugin)

Options

OptionAliasDescription
--verboseVerbose 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-xshow 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

ArgumentDescription
TYPE组件类型,选项:(plugins, abilities, components)

Options

OptionAliasDescription
--verboseVerbose 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-xShow extra columns
--csv--output=csvOutput 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-headerHide table header from output
--no-truncateDo 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

ArgumentDescription
PATHdump path, the value can be a relative path or an absolute path

Options

OptionDescription
--verboseVerbose 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