Codex CLI Cheat Sheet
Every OpenAI Codex CLI command, flag and slash command in one sheet: type to filter in real time, click any entry to copy it.
FAQ
What does this Codex CLI cheat sheet cover?
It covers 8 sections with 111+ entries: TUI shortcuts & input tricks, slash commands, CLI subcommands, global flags, exec non-interactive flags, approval modes & sandbox, the AGENTS.md memory system, and config.toml settings.
What's the difference between codex exec and codex?
codex starts an interactive TUI session; codex exec runs non-interactively and streams results to stdout, ideal for scripts and CI. exec supports --json for JSONL events, -o to write the final reply to a file, --output-schema to validate the output structure, and codex exec resume to resume a non-interactive session.
Where should AGENTS.md be placed?
~/.codex/AGENTS.md is the global layer (inherited by all repos); AGENTS.md can be placed layer by layer from the repo root to the current directory — closer to the current directory wins; AGENTS.override.md provides a temporary override. The merge cap defaults to 32 KiB (tunable via project_doc_max_bytes).
What's the difference between the Auto / Read Only / Full Access approval modes?
Auto (default) allows free read/write/exec inside the working directory and asks before going outside or using the network; Read Only is read-only consulting and requires plan approval before changes; Full Access grants full machine access with no further prompts. Use --sandbox and --ask-for-approval for fine-grained control.
Where does the cheat sheet data come from?
Compiled from the official OpenAI docs at developers.openai.com/codex (as of 2026-09); experimental commands (cloud, sandbox, mcp, etc.) follow the official labels. Everything runs as a purely static local lookup.