Codex
OpenAI Codex is an agentic coding tool that runs in your terminal.
Installation
See the official OpenAI Codex documentation.
Base Invocation
text
codex exec "<prompt>"Default Config
Codex is the only built-in provider that ships with a default config. When you use provider: codex, Dagu automatically applies:
yaml
skip_git_repo_check: trueThis becomes --skip-git-repo-check on the CLI. You can override it by explicitly setting skip_git_repo_check: false in your step with.
Common Flags
| Flag | Type | Description |
|---|---|---|
--model | string | Model to use (e.g. gpt-5.5) |
--full-auto | boolean | Full auto-approval mode |
--skip-git-repo-check | boolean | Skip git repository validation |
Example
yaml
steps:
- name: generate-tests
action: harness.run
with:
provider: codex
prompt: "Write unit tests for the auth module"
model: gpt-5.5
full-auto: trueGenerated invocation:
text
codex exec "Write unit tests for the auth module" --full-auto --model gpt-5.5 --skip-git-repo-checkYOLO Mode
Codex supports a --yolo flag that bypasses all approval prompts and sandboxing. This is useful for fully automated workflows:
yaml
steps:
- name: auto-fix
action: harness.run
with:
provider: codex
prompt: "Fix all lint errors"
yolo: true
sandbox: workspace-writeGenerated invocation:
text
codex exec "Fix all lint errors" --yolo --sandbox workspace-write --skip-git-repo-checkWarning: This disables all safety checks. Only use in isolated or trusted environments.
Fallback Example
yaml
harness:
provider: codex
full-auto: true
fallback:
- provider: claude
model: sonnet
steps:
- name: refactor
action: harness.run
with:
prompt: "Refactor the database layer to use interfaces"See Also
- Codex CLI Reference — Complete command and flag reference
- Non-interactive Mode — Running Codex in CI/scripts
- Config Basics —
config.tomland precedence - Sandboxing — How the sandbox works
- Models — Available model aliases and overrides
