Exit Codes Reference

A quick reference for all CLI exit codes — use these to control pipeline flow and interpret scan results programmatically.

Vibgrate Docs

Vibgrate Help

Exit Codes

The Vibgrate CLI uses standard exit codes to communicate results:

CodeMeaningWhen It Happens
0SuccessScan completed, all gates passed
1Runtime errorInvalid flags, missing files, unexpected crash
2Threshold exceeded--fail-on severity gate or drift budget/worsening gate triggered

Using Exit Codes in CI

vibgrate scan . --fail-on error
exit_code=$?

if [ $exit_code -eq 0 ]; then
  echo "Scan passed"
elif [ $exit_code -eq 2 ]; then
  echo "Drift threshold exceeded"
  # Take action: notify, create issue, etc.
else
  echo "Scan failed with error"
fi

When Does Exit Code 2 Trigger?

Exit code 2 is returned when any of these conditions are met:

  • --fail-on error and error-level findings exist
  • --fail-on warn and warning-level (or error-level) findings exist
  • --drift-budget <score> and the drift score exceeds the budget
  • --drift-worsening <percent> and drift has worsened beyond the threshold vs baseline

Related Commands