JSON Output
How the Monito CLI handles structured output for scripting and automation.
The --json Flag
Every command that produces output supports --json:
Output Separation
The CLI separates data from human text:
- stdout: JSON data (when
--jsonis used) or raw token output - stderr: Human-readable text, tables, progress spinners, error messages
This means you can safely pipe stdout to jq or other tools:
Error Handling
In JSON mode, errors are printed to stderr and the process exits with a non-zero code. The error format:
Exit Codes
| Code | Meaning |
|---|---|
0 | Command succeeded |
1 | Test run failed (used by scenario run, project run) |
2 | CLI error — bad arguments, auth failure, API error |
Token Output
The auth token command writes the raw token to stdout without a newline, making it ideal for shell substitution: