Codex CLI Fire-and-Forget
Environment Check
- Codex version: !
codex --version 2>/dev/null || echo "CODEX_NOT_INSTALLED"
Task
Execute the following Codex CLI task autonomously with complete output capture.
Argument Parsing
Parse $ARGUMENTS to extract optional flags and the task description:
Optional flags (override defaults if present):
--model <MODEL>— Override default model (seereferences/models.mdfor available models)--effort <LEVEL>— Override reasoning effort (low, medium, high, xhigh)--sandbox <MODE>— Override sandbox mode (read-only, workspace-write, danger-full-access)
Defaults (used when flags are not specified):
- Model:
gpt-5.3-codex - Effort:
xhigh - Sandbox:
workspace-write - Auto:
--full-auto(always enabled)
Everything after the flags is the task description.
Command Assembly
Assemble the codex command following this pattern:
codex exec \
-m <model> \
--config model_reasoning_effort="<effort>" \
--sandbox <sandbox> \
--full-auto \
"<task description>"
Execution
- If the environment check above shows
CODEX_NOT_INSTALLED, stop immediately and report the error - Assemble the command from parsed arguments and defaults
- Execute the command via Bash
- Capture and return the complete stdout and stderr — do not summarize or truncate
Input
$ARGUMENTS
Additional Resources
For model catalog, sandbox modes, and CLI flag reference, consult:
references/models.md— Complete model table, effort levels, sandbox modes, and command examples