Codex CLI
8 cheat sheets
Codex CLI#
OpenAI’s open-source agentic coding CLI (github.com/openai/codex). Runs GPT models directly in your terminal, edits code, executes commands, and supports OS-native sandboxing (Seatbelt on macOS, bwrap+seccomp on Linux). Configurable via ~/.codex/config.toml with profiles, MCP servers, and an experimental hooks system.
What’s in this section#
| Page | Topics |
|---|---|
| Overview | Install, auth (ChatGPT plan vs API key), default model, session modes |
| Configuration | config.toml schema — model, approval policy, sandbox mode, profiles, env |
| Slash Commands | Full reference: /init, /model, /plan, /fork, /resume, /mcp, /diff, /quit, … |
| Approvals & Sandbox | Approval policies, sandbox modes, platform mechanics, —full-auto |
| MCP Servers | [mcp_servers.*] config, codex mcp subcommand, runtime /mcp |
| Tips & AGENTS.md | AGENTS.md authoring, profiles, hooks, codex exec, codex cloud |
Sections#
- Overview — Install, authenticate, and understand interactive vs exec modes.
- Configuration — Every key in
~/.codex/config.tomlexplained. - Slash Commands — The full interactive slash-command surface.
- Approvals & Sandbox — Control what the agent can do and how it’s sandboxed.
- MCP Servers — Connect external tools via the Model Context Protocol.
- Tips & AGENTS.md — Advanced workflows: AGENTS.md, profiles, hooks, non-interactive use.
[!TIP] Start with Overview and Configuration, then read Approvals & Sandbox before running in
--full-automode.
no sheets match the selected filters