Run a one-off task without the TUI

exec & automation

// what it does

codex exec (alias codex e) runs a task with no TUI: it streams progress to stderr and prints the final message to stdout, so it drops cleanly into scripts, cron jobs, and CI. It defaults to the read-only sandbox, so widen it when the task needs to write.

// shell

$ codex exec "fix the failing unit tests"
$ codex e "add a --verbose flag to the CLI"

// gotcha

Because exec is read-only by default, an instruction like "fix the tests" won't actually change files until you add --sandbox workspace-write (or --full-auto).

// resources