Reference
Exit codes
Stable, category-scoped exit codes you can rely on in scripts and automation.
The contract
Exit codes are part of the CLI's script-facing contract: the same category always maps to the same exit code. Automation can branch on the failure mode without parsing stderr.
Exit code table
| Exit | Category | Typical codes |
|---|---|---|
| 0 | Success | - |
| 1 | Generic failure | UNKNOWN, SERVER_ERROR, ENCRYPTION_ERROR, plain errors |
| 2 | Invalid usage / arguments | INVALID_ARGUMENT, VALIDATION |
| 10 | Authentication | UNAUTHENTICATED, INVALID_CREDENTIALS, SESSION_EXPIRED |
| 11 | Permission | PERMISSION_DENIED |
| 12 | Not found | NOT_FOUND, VERSION_NOT_FOUND, ROLLBACK_TARGET_NOT_FOUND |
| 20 | Build | BUILD_FAILED, BUILD_TIMEOUT, TOOLCHAIN_NOT_FOUND, UNSUPPORTED_PROJECT |
| 21 | Deploy | DEPLOY_FAILED, INSTANCE_START_FAILED, HEALTH_CHECK_FAILED, DEPLOY_LOCKED |
| 22 | Rollback | ROLLBACK_FAILED |
| 23 | Rollback verification failed/cancelled | ROLLBACK_VERIFY_FAILED |
| 24 | Deploy failed and automatic rollback failed | AUTO_ROLLBACK_FAILED (state degraded - manual intervention required) |
| 30 | Network | CONNECTION_ERROR, PORT_UNAVAILABLE |
| 40 | Configuration | CONFIGURATION_ERROR |
| 50 | Docker | DOCKER_ERROR |
| 60 | Timeout | TIMEOUT |
| 70 | Encryption | ENCRYPTION_ERROR |
Examples
# App not found -> exit 12phelix status no-such-appecho $? # 12 # Missing required argument -> exit 2phelix statusecho $? # 2 # Rollback executed but verification window failed -> exit 23phelix rollback myapp --to v7 --verify 30secho $? # 23 (execution succeeded; verification failed)Debugging failures
Run any command with --debug to render the complete error chain on stderr - normal mode bounds it to the first few wrapped layers; --debug lifts that cap. Rendered strings are always run through secret redaction, so debug output never discloses keys, tokens, or encrypted values.