# codex > Notes and workflow for using OpenAI Codex CLI (`codex exec`) for scripted, non-interactive analysis tasks (reviews, bug hunting, doc/spec review, planning). - Author: Youwei Xiao - Repository: uv-xiao/pto-wsp - Version: 20260130165844 - Stars: 0 - Forks: 0 - Last Updated: 2026-02-06 - Source: https://github.com/uv-xiao/pto-wsp - Web: https://mule.run/skillshub/@@uv-xiao/pto-wsp~codex:20260130165844 --- --- name: codex description: Notes and workflow for using OpenAI Codex CLI (`codex exec`) for scripted, non-interactive analysis tasks (reviews, bug hunting, doc/spec review, planning). --- # codex Notes for using OpenAI Codex CLI (`codex exec`) for non-interactive analysis tasks. ## When to use `codex exec` - Code review / bug hunting - Architecture/design feedback - Document/spec review - Implementation planning ## Quick examples ```bash codex exec "Review docs/spec.md for API consistency" echo "List all TODOs" | codex exec - codex exec --json "List all public API functions" ``` ## Useful flags (common) - `-C, --cd `: set working directory - `--search`: enable web search (when external context helps) - `-o `: write final response to a file - `--json`: newline-delimited JSON events