Global flags
The apimetrics CLI global flags use the --rsh-* family. They apply to every command, whether built in or generated.
| Flag | Description |
|---|---|
-o, --rsh-output-format string | Output format: auto, json, table, … (default auto) |
-f, --rsh-filter string | Filter / project results using a shorthand query |
-H, --rsh-header stringArray | Add a custom header |
-q, --rsh-query stringArray | Add a custom query parameter |
-p, --rsh-profile string | API auth profile (default default) |
-s, --rsh-server string | Override scheme://server:port for an API |
-r, --rsh-raw | Output the query result raw rather than escaped |
--rsh-no-paginate | Disable auto-pagination |
--rsh-no-cache | Disable the HTTP cache |
--rsh-ignore-status-code | Do not set the exit code from the HTTP status code |
--rsh-insecure | Disable SSL verification |
--rsh-ca-cert string | Path to a PEM-encoded CA cert |
--rsh-client-cert string | Path to a PEM-encoded client certificate |
--rsh-client-key string | Path to a PEM-encoded private key |
--rsh-retry int | Number of times to retry on certain failures (default 2) |
-t, --rsh-timeout duration | Timeout for HTTP requests |
-v, --rsh-verbose | Enable verbose log output |
--service-account string | Authenticate with a service account file instead of a browser login. Env: APIMETRICS_SERVICE_ACCOUNT |
--project-id string | Use this project for the run, overriding the selected project. Env: APIMETRICS_PROJECT_ID |
--version | Print the CLI version, OpenAPI spec version, and last spec check date |
-h, --help | Help 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
The CLI does not register an api configure command or the generic HTTP verb commands (get, post, …). 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'
Shell completion
The completion command generates an autocompletion script for bash, zsh, fish, or powershell.
# Print the completion script for your shell
apimetrics completion zsh
Run apimetrics completion <shell> --help for instructions on loading the script in your shell.
See also
- Authentication: profiles use
-p/--rsh-profile - Generated commands