Skip to main content

Global flags

The apimetrics CLI is a fork of Restish, so its global flags are the Restish --rsh-* family. They apply to every command — built-in and generated alike.

FlagDescription
-o, --rsh-output-format stringOutput format: auto, json, table, … (default auto)
-f, --rsh-filter stringFilter / project results using a shorthand query
-H, --rsh-header stringArrayAdd a custom header
-q, --rsh-query stringArrayAdd a custom query parameter
-p, --rsh-profile stringAPI auth profile (default default)
-s, --rsh-server stringOverride scheme://server:port for an API
-r, --rsh-rawOutput the query result raw rather than escaped
--rsh-no-paginateDisable auto-pagination
--rsh-no-cacheDisable the HTTP cache
--rsh-ignore-status-codeDo not set the exit code from the HTTP status code
--rsh-insecureDisable SSL verification
--rsh-ca-cert stringPath to a PEM-encoded CA cert
--rsh-client-cert stringPath to a PEM-encoded client certificate
--rsh-client-key stringPath to a PEM-encoded private key
--rsh-retry intNumber of times to retry on certain failures (default 2)
-t, --rsh-timeout durationTimeout for HTTP requests
-v, --rsh-verboseEnable verbose log output
--versionPrint the binary version
-h, --helpHelp for the command

JSON output is -o json, not --json

There is no --json flag. To get machine-readable JSON, use the output-format flag:

# Correct
apimetrics list-monitors -o json

# Also valid (long form)
apimetrics list-monitors --rsh-output-format json

There is no api configure

Upstream Restish ships an api configure command and generic HTTP verb commands (get, post, …). This fork registers neither. To authenticate, use login instead of api configure. To call the API, use the generated per-operation commands.

Examples

# Pretty table (default) vs. JSON
apimetrics list-monitors
apimetrics list-monitors -o json

# Add a custom header and override the server for one call
apimetrics list-monitors -H 'X-Trace: 1' -s https://staging.example.com

# Filter results client-side
apimetrics list-monitors -f 'body.data[].name'

See also