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 and typed error envelopes (when JSON mode is enabled), or raw token output
- stderr: Human-readable text, tables, progress spinners, and human-mode error messages
This means you can safely pipe stdout to jq or other tools:
Error Handling
In JSON mode, errors are printed to stdout as a typed envelope and the process exits with a stable non-zero code:
Exit Codes
| Code | Meaning |
|---|---|
0 | Command succeeded |
1 | Command ran, but the test result failed |
2 | Authentication failed or expired |
3 | Requested resource was not found |
4 | Input or command validation failed |
5 | Insufficient Monito credits |
6 | A blocking run timed out |
7 | Network, server, or unknown error |
8 | Existing state conflicts with the requested mutation |
Token Output
The auth token command writes the raw token to stdout without a newline, making it ideal for shell substitution: