Exit Codes
CLI exit codes and their meanings
Automation scripts and CI/CD pipelines should rely on these exit codes when interpreting results from the choochoo CLI.
| Code | Name | Description |
|---|---|---|
| 0 | SUCCESS | Command completed successfully. |
| 1 | VALIDATION_ERROR | Schema validation failed or quality rules were not met. See Error Messages for details. |
| 2 | CONFIG_ERROR | The .choochoorc file is missing or invalid. |
| 3 | NETWORK_ERROR | Failed to communicate with the remote API or registry. |
| 4 | AUTH_ERROR | Authentication failed or insufficient permissions. Check your RBAC or SSO configuration. |
| 5 | NOT_FOUND | The requested artifact or resource does not exist. |
| 10 | APPROVAL_REQUIRED | The action requires human approval and cannot proceed automatically. The risk score exceeded the auto-approve threshold. |
| 11 | APPROVAL_REJECTED | The action was rejected by an approver via the approval workflow. |
| 99 | INTERNAL_ERROR | An unexpected bug in the CLI. Please report this via Contributing. |
Usage in CI/CD
In GitHub Actions or GitLab CI, you can use these exit codes to branch your pipeline logic:
choochoo validate --strict
EXIT_CODE=$?
case $EXIT_CODE in
0) echo "All validations passed" ;;
1) echo "Validation failed — check error messages" ;;
10) echo "Human approval required — notifying approvers" ;;
*) echo "Unexpected exit code: $EXIT_CODE" ;;
esacThe --strict flag treats warnings as errors (exit code 1). You can configure this as the default in your .choochoorc configuration.
Common Scenarios
- Exit 1 in CI: Usually means a schema validation failure or file naming convention violation. Consult the Error Messages catalog to diagnose.
- Exit 10 in CI: A change involves sensitive fields (e.g., PII compliance tags) and the configured approval policy requires human sign-off. The risk scoring algorithm determines the approval level.
- Exit 2 locally: Your
.choochoorcmay be missing or contain invalid JSON. Runchoochoo initto regenerate it — see the Quickstart.
Related
Error Messages
Detailed catalog of error codes with troubleshooting steps for each.
CLI Reference
Full documentation for all available commands, flags, and output formats.
CI/CD Integration
Set up automated governance checks in GitHub Actions or GitLab CI.
Configuration
Control validation strictness and default behavior via .choochoorc.