Skip to main content
The CLI uses specific exit codes so you can handle outcomes in scripts and CI pipelines.

Exit code reference

CodeNameDescription
0SuccessCommand completed successfully
1ErrorValidation failure, API error, or command error
2Auth failureNo API token found or token rejected
10Changes pendingDry-run detected changes (with --detailed-exitcode)

Usage in CI

Gate merges on config drift

Use --detailed-exitcode with deploy --dry-run to detect config changes in a PR check:
devhelm deploy -f devhelm.yml --dry-run --detailed-exitcode
Exit codeCI behavior
0Config is in sync — pass the check
10Config has changes — fail or flag for review
1Error — fail the check

Shell scripting

devhelm monitors list -o json > monitors.json
if [ $? -ne 0 ]; then
  echo "Failed to fetch monitors"
  exit 1
fi

GitHub Actions

- name: Check for drift
  run: devhelm deploy -f devhelm.yml --dry-run --detailed-exitcode
  continue-on-error: true
  id: drift

- name: Comment on PR
  if: steps.drift.outcome == 'failure'
  run: echo "Monitoring config has pending changes"

Next steps

Deploy commands

Full deploy, plan, and validate reference.

GitHub Actions

CI/CD integration with the setup-devhelm action.