Skip to main content
Every nullspace CLI invocation exits with one of the stable codes below. Agents and scripts can branch on the exit code without parsing output; in --json mode the failure body additionally carries a machine-readable code (see the error envelope).

Exit Codes

Exit codeNameMeaning
0SUCCESSsuccess
1GENERIC_FAILUREgeneric failure
2USAGE_ERRORusage error
3NOT_FOUNDnot found
4UNAUTHENTICATEDunauthenticated
5PERMISSION_DENIEDpermission denied
6QUOTA_OR_RATE_LIMITEDquota or rate limited
7CONFLICTconflict
8SANDBOX_RUNTIME_ERRORsandbox runtime error

How JSON Error Codes Map To Exit Codes

When a command fails, the machine-readable error code selects the exit code. Exact mappings:
Error codeExit code
not_found3
sandbox_not_found3
snapshot_not_found3
template_not_found3
template_resource_not_found3
missing_api_key4
unauthenticated4
unauthorized4
forbidden5
permission_denied5
volume_read_only5
capacity_exceeded6
file_upload_limit_exceeded6
quota_exceeded6
rate_limit_exceeded6
volume_limit_exceeded6
volume_quota_exceeded6
conflict7
incompatible_snapshot7
rebuild_required7
sandbox_not_ready7
snapshot_in_use7
upload_conflict7
volume_busy7
exec_failed8
exec_timeout8
timeout8
invalid_fields2
invalid_request2
invalid_response2
Codes not listed above fall back to pattern rules, in order:
  • *_not_found → 3 (not found)
  • *_permission_denied → 5 (permission denied)
  • codes containing quota or rate_limit → 6 (quota or rate limited)
  • *_conflict → 7 (conflict)
  • anything else → 1 (generic failure)
Usage errors raised by the CLI itself (bad flags, missing arguments) exit with 2.
  • Error Codes - the CLI JSON error envelope and edge/preview error anchors.
  • API Error Catalog - machine-readable error codes from the ErrorResponse schema.