The CLI uses distinct exit codes for each error category. Scripts and AI agents can branch on the exit code without parsing the error message.Documentation Index
Fetch the complete documentation index at: https://docs.shovels.ai/llms.txt
Use this file to discover all available pages before exploring further.
Exit Codes
| Code | Type | Meaning |
|---|---|---|
0 | Success | Command completed successfully |
1 | Client error | Invalid flags, validation failure, or bad request |
2 | Auth error | Missing or invalid API key |
3 | Rate limited | Too many requests (HTTP 429) |
4 | Credits exhausted | API credit limit reached (HTTP 402) |
5 | Server/network error | Server failure or connectivity issue |
Error Response Format
Errors are written to stderr as structured JSON:error_type field provides a machine-readable classification:
| error_type | Exit Code | Common Causes |
|---|---|---|
client_error | 1 | Missing required flags, invalid flag values |
validation_error | 1 | Invalid date range, bad geo_id format (HTTP 422) |
auth_error | 2 | No API key configured, or key is invalid (HTTP 401) |
rate_limited | 3 | Too many concurrent requests (HTTP 429) |
credit_exhausted | 4 | Monthly credit limit reached (HTTP 402) |
server_error | 5 | Shovels API returned a 5xx error |
network_error | 5 | DNS failure, timeout, or connection refused |
Common Errors and Solutions
Exit 1: Client Error
Missing required flags:--permit-from and --permit-to flags.
Invalid date range:
--permit-from date is earlier than --permit-to. Use YYYY-MM-DD format.
Exit 2: Auth Error
Exit 3: Rate Limited
Use
--no-retry to disable automatic retry if you want to handle rate limits yourself in a script.Exit 4: Credits Exhausted
shovels usage and contact sales@shovels.ai to increase your limit.
Exit 5: Server or Network Error
--timeout 60s.
Using Exit Codes in Scripts
Related Articles
- CLI authentication — Configure your API key
- API error handling — REST API error codes
- API credit limits — Understanding credit consumption
