Skip to Content
CLIOutput & Exit Codes

Output & Exit Codes

Output

Data is raw JSON on stdout by default, so it pipes straight into jq:

spectrum prices price ETH | jq .priceUsd

Add --human for aligned key-value pairs and tables when reading in a terminal:

spectrum prices price ETH --human

Errors 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 codeMeaning
0Success
1Unexpected error
2Usage error: bad arguments, invalid JSON payload, unknown chain, missing API URL
3API error (non-2xx from Spectrum)
4Rate limited (already retried automatically; the message includes retry-after when known)
5Network error or timeout

Debugging

Set DEBUG=1 to include stack traces in error output:

DEBUG=1 spectrum tokens balance 0xd8dA... --chain ethereum