Skip to content
中文

Exit codes and errors

This page lists the CLI’s exit codes, the error object’s fields, and the common error codes, so a script or an agent can judge success and decide the next step. It applies to every command in the current release.

Exit codes

Exit codeMeaningExample
0SuccessThe command finished and printed its result
1Runtime failureNot signed in, rejected credential, operation error, network failure
2Usage errorUnknown command or option, missing option value, wrong number of arguments

praxis devops test run uses the exit code for the verdict: 0 when every case passes, non-zero when some fail. A script that must tell “the command failed” from “the tests failed” checks for the error object: usage and runtime failures carry a code, a verdict only shows in the exit code.

The error object

On failure the CLI prints one object, JSON under --json:

FieldNotes
codeError code such as a usage error, not signed in, 401, an operation error, a runtime error
messageWhat happened
hintWhat to do next; a generic hint when nothing specific applies
envThe environment that failed: develop or production
statusHTTP status from the operation; absent on usage errors
request_idServer request identifier; quote it when contacting support

Common errors

CodeCauseWhat to do
a usage errorA command word, option, or argument is wrongAdd --help; praxis api <domain> --help lists the domain’s commands
not signed inThe environment has no loginpraxis login, or set an API key for that environment
401The credential was rejected or expiredSign in again, or use a new API key; a machine token needs refreshing
an operation errorThe operation refused or the server failedRead message and status; use request_id to investigate
a runtime errorThe command hit an unexpected failureAdd --debug to see the request

When to retry

  • 429 and 5xx: retry with exponential backoff, at least one second apart.
  • 401, 403, a usage error: retrying does not help; fix the credential or the arguments first.
  • 404: check that the ID exists; a list command shows the legal values.

Diagnose

--debug prints the request’s method, URL, and headers, never the body or query values. It is the fastest way to spot a wrong environment or a wrong operation:

终端窗口
praxis api model list --debug

Credentials never appear in any output.

Next steps

  • Command reference: usage and options for every command.
  • For agents: machine-readable output and non-interactive runs, which scripts and agents need to judge success.
  • Call the platform API: how to find praxis api commands, pass parameters and page results.