Docs/Reference/Exit codes
OSS

Exit Codes

Every command exits with one of five codes. Branch on the code, never on the text of a message.

The codes

CodeMeaningRaised when
0SuccessThe command completed. For validation commands it also means nothing was found above the configured failure threshold.
1Command failureThe operation ran and failed: a migration error, a validation failure, an unexpected exception. The log carries the detail.
2Usage errorArguments could not be parsed, or configuration could not be resolved. Nothing touched the database.
4Licence requiredThe command needs a paid edition or a higher licence tier. Returned before any argument parsing or database work.
130InterruptedCancelled by the user with Ctrl-C. Follows the shell convention of 128 plus the signal number.

Entitlement is not failure

Code 4 exists so pipelines can branch on entitlement without parsing stderr. It is distinct from 1 (command failure) and 2 (usage error).

Branching in CI

dblift validate-sql migrations/ --format sarif > results.sarif
case $? in
0) echo "clean" ;;
4) echo "needs a paid edition — skipping the gate"; exit 0 ;;
*) exit 1 ;;
esac

Machine-readable stdout

Five output formats are a parser-facing contract rather than a human-facing report. When a command runs with one of them, stdout carries the payload alone — no banners, no log lines, no completion messages. Everything else goes to stderr.

json · sarif · github-actions · gitlab · compact

Redirect stdout to a file and let stderr reach the log. Parsing anything outside these formats is unsupported.

See CI/CD Integration for full pipeline examples.

On this page