The CLI uses specific exit codes so you can branch on outcome in scripts and CI pipelines without parsing stdout.Documentation Index
Fetch the complete documentation index at: https://docs.devhelm.io/llms.txt
Use this file to discover all available pages before exploring further.
Exit code reference
| Code | Name | When it’s used |
|---|---|---|
0 | Success | Command completed successfully |
1 | General error | Unexpected internal failure (uncaught exception, bug) |
4 | Validation | Local precondition failed: missing/invalid token, malformed YAML, request body that doesn’t match the schema, missing flag value |
10 | Changes pending | plan / deploy --dry-run --detailed-exitcode detected pending changes |
11 | API error | API returned a non-2xx response (4xx or 5xx). Carries status, code, and requestId in stderr |
12 | Transport | Network failure before getting a response: DNS, connection refused, TLS, timeout |
13 | Partial failure | deploy finished but at least one resource operation failed; the remainder succeeded |
src/lib/errors.ts (EXIT_CODES). Sub-classes (e.g. DevhelmAuthError, DevhelmNotFoundError) inherit their root’s exit code.
Quick decision table
| You want to… | Check |
|---|---|
| Detect any failure | $? -ne 0 |
| Distinguish “config drift” from real errors in CI | $? -eq 10 for drift, $? -eq 0 for clean, anything else for failure |
| Retry only on transient failures | Retry on 12; do not retry on 4 or 11 (likely deterministic) |
| Surface auth problems to users | Look for 4 (no token / bad config) or 11 with code=AUTH (rejected token) |
| Continue past partial deploy failure | Treat 13 as “completed with errors” and inspect the deploy report |
Usage in CI
Gate merges on config drift
Use--detailed-exitcode with deploy --dry-run to detect config changes in a PR check:
| Exit code | CI behavior |
|---|---|
0 | Config is in sync — pass the check |
10 | Config has changes — fail or flag for review |
4 / 11 / 12 | Error — fail the check |
Shell scripting
GitHub Actions
Next steps
Deploy commands
Full deploy, plan, and validate reference.
GitHub Actions
CI/CD integration with the setup-devhelm action.