Output & Exit Codes
Output
Data is raw JSON on stdout by default, so it pipes straight into jq:
spectrum prices price ETH | jq .priceUsdAdd --human for aligned key-value pairs and tables when reading in a terminal:
spectrum prices price ETH --humanErrors go to stderr as readable text by default (stderr is for humans, not pipes). Pass --json to emit errors as JSON too, for scripts that parse them.
Exit codes
| Exit code | Meaning |
|---|---|
| 0 | Success |
| 1 | Unexpected error |
| 2 | Usage error: bad arguments, invalid JSON payload, unknown chain, missing API URL |
| 3 | API error (non-2xx from Spectrum) |
| 4 | Rate limited (already retried automatically; the message includes retry-after when known) |
| 5 | Network error or timeout |
Debugging
Set DEBUG=1 to include stack traces in error output:
DEBUG=1 spectrum tokens balance 0xd8dA... --chain ethereum