Dive

CLI

Error handling

How Dive reports failures: exit codes, output streams, and machine-readable errors.

Every command reports success or failure through its exit code. Scripts and CI jobs should branch on the exit code, not on the text a command prints.

Exit codes

CodeMeaning
0The command succeeded.
1The command failed, or an edit was refused. Details are on stderr.
2The arguments were invalid. Dive prints usage help to stderr.
3dive plan run was missing an input, or an input didn't match the plan's input_schema. The schema is printed to stderr.
4A plan's exit step ended the run with status: error.

A tool that reports an error during dive tool test --json still exits 0: the call completed, and the result's isError field says the tool failed.

Output streams

stdout carries only the command's result: an answer, a plan's output, a listing, or a --json envelope. Progress, warnings and error messages go to stderr.

When Dive refuses a request, such as an invalid plan or a rejected edit, --json still prints the envelope describing why to stdout before exiting 1. Other failures are reported on stderr only.

Machine-readable output and logs

DIVE_EVENTSenum<string>

How Dive reports progress and failures on stderr. Unset, stderr is for people.

ValueEffect
jsonlstderr becomes a stream of JSON events, one per line. ask steps can't prompt anyone, so they use their whenUnanswered setting.
githubA failing dive plan run also prints a ::error:: annotation to stdout, which GitHub Actions shows on the run.
DIVE_LOGstring

A log filter for stderr, such as info or dive_core=debug. -v, -vv and -vvv set info, debug and trace.

Go to full reference

On this page