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

ExitCategoryTypical codes
0Success
1Generic failureUNKNOWN, SERVER_ERROR, ENCRYPTION_ERROR, plain errors
2Invalid usage / argumentsINVALID_ARGUMENT, VALIDATION
10AuthenticationUNAUTHENTICATED, INVALID_CREDENTIALS, SESSION_EXPIRED
11PermissionPERMISSION_DENIED
12Not foundNOT_FOUND, VERSION_NOT_FOUND, ROLLBACK_TARGET_NOT_FOUND
20BuildBUILD_FAILED, BUILD_TIMEOUT, TOOLCHAIN_NOT_FOUND, UNSUPPORTED_PROJECT
21DeployDEPLOY_FAILED, INSTANCE_START_FAILED, HEALTH_CHECK_FAILED, DEPLOY_LOCKED
22RollbackROLLBACK_FAILED
30NetworkCONNECTION_ERROR, PORT_UNAVAILABLE
40ConfigurationCONFIGURATION_ERROR
50DockerDOCKER_ERROR
60TimeoutTIMEOUT
70EncryptionENCRYPTION_ERROR

Examples

Terminal
# App not found -> 12
phelix status no-such-app
echo $?   # 12

# Missing required argument -> 2
phelix status
echo $?   # 2

Debugging failures

Run any command with --debug to render the full error chain — root cause included — on stderr. Rendered strings are always run through secret redaction, so debug output never discloses keys, tokens, or encrypted values.