codemod workflow run, codemod workflow resume and codemod <package> exit with a code that says how the run ended. Use it in CI and scripts; for the details, read the run with codemod workflow status --id <id> --format json.
A run waiting at an approval exits
3, not 0, so a CI job doesn’t pass with half a migration done. To get past approvals in CI, pass --approve on workflow run.3 with fail(). Read the error and check workflow status to distinguish it from an approval or interrupted step that needs input.
A command line the CLI can’t parse (an unknown flag, a missing value) exits 2 before any run starts, and prints usage instead of a run. Check for it before treating 2 as “finished with failures” in a script that builds its command line.
A dry run is never saved, so it can’t wait at an approval: a dry run that reaches one exits 1 and says to pass --approve. With --control stdio, it waits for an answer like a real run.
Read the result in a script
workflow list --format json (newest first) and its status from workflow status:
exitCode is the code fail() gave, or null when the workflow didn’t call it. question is the approval a waiting run needs, such as "approval:1". A paused run keeps it too, so you can resume it with --approve <question> without remembering it.
With --format jsonl, a run that started ends with a run_finished event with the same status, output and question. An unattended resume that needs an interrupted-step decision prints the step and flags to stderr instead. See Running in CI and from agents.