ci integration
Exit codes
Every DevOpsGen command exits with a stable, documented status code so shells, scripts and CI jobs can branch deterministically — no output parsing required.
| Code | Classification | Meaning | Typical example |
|---|---|---|---|
| 0 | success | Everything requested completed; dry-run plans that resolved cleanly also end here. | init created 5 files; --dry-run --force plan is green. |
| 1 | general error | Unexpected failure — I/O errors, template issues, or a run that failed mid-write and rolled back. | Disk full while writing deployment.yaml. |
| 2 | invalid input | Configuration failed validation before anything was planned or written. | --image BANGKAH/my-app; port -1; Ingress without host. |
| 3 | conflict | Target files already exist and would be overwritten; nothing was written. Retried with --force. | Second init without --force. |
| 4 | validation failed | Rejected output: a template rendering failure, required artifacts missing, or generated documents failing the static lint rules. | A workflow that never publishes the commit SHA tag. |
| 5 | detection | Stack detection was ambiguous or found nothing at all. | Empty directory without go.mod / package.json. |
In practice

shell script branching
devopsgen init --stack go --registry ghcr --image you/myapp --port 8080
case $? in
0) echo "ready" ;;
3) devopsgen init --force --stack go --registry ghcr --image you/myapp --port 8080 ;;
2) echo "fix your flags" >&2 ;;
*) echo "see devopsgen validate output" >&2 ;;
esacCodes are part of DevOpsGen's compatibility promise: bumping a major version may add new codes, but existing ones keep their meaning.