Skip to main content
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.

Exit Codes

Error Response Format

Errors are written to stderr as structured JSON:
The error_type field provides a machine-readable classification:

Common Errors and Solutions

Exit 1: Client Error

Missing required flags:
Fix: Add the required --permit-from and --permit-to flags. Invalid date range:
Fix: Ensure your --permit-from date is earlier than --permit-to. Use YYYY-MM-DD format. Properties search validation: properties search validates locally before making any API call, so these cost no credits:
Auth is checked before local flag validation, so a missing API key surfaces as exit 2 even when your flags are also invalid. Fix the key first, then the flags.
Properties get ID errors: An ID that is well-formed but has no property behind it is not an error — the row is omitted and the ID appears in meta.missing with exit 0. Two cases do fail the whole request with exit 1:
Fix: pass only address IDs, from a properties search row’s id or from addresses search. One bad ID takes down the entire batch, so validate before sending 50.

Exit 2: Auth Error

Fix: Set your API key via environment variable or config file. See CLI authentication.

Exit 3: Rate Limited

The CLI automatically retries rate-limited requests with exponential backoff and jitter (up to 3 retries). If this error appears, wait a moment and try again, or contact support if it persists.
Use --no-retry to disable automatic retry if you want to handle rate limits yourself in a script.

Exit 4: Credits Exhausted

Your monthly credit allowance is used up. Check your usage with shovels usage and contact sales@shovels.ai to increase your limit.

Exit 5: Server or Network Error

Check your internet connection. If the Shovels API is down, try again later. You can adjust the timeout with --timeout 60s.

Using Exit Codes in Scripts