This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| openai_codex [2026/03/31 15:05] – SEO: add target search terms agent | openai_codex [2026/03/31 15:20] (current) – Remove official claims agent | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== OpenAI Codex CLI: Terminal CLI Agent & Codex Wiki ====== | ||
| - | |||
| - | **OpenAI Codex CLI** is an open-source terminal CLI agent built in Rust by OpenAI.((https:// | ||
| - | |||
| - | {{tag> | ||
| - | |||
| - | | **Repository** | [[https:// | ||
| - | | **Website** | [[https:// | ||
| - | | **Language** | Rust | | ||
| - | | **License** | Open Source | | ||
| - | | **Stars** | 67,000+ | | ||
| - | | **Creator** | OpenAI | | ||
| - | |||
| - | ===== Overview ===== | ||
| - | |||
| - | Codex CLI brings OpenAI' | ||
| - | |||
| - | ===== Key Features ===== | ||
| - | |||
| - | * **Terminal-Native** -- Runs directly in your shell; no browser or IDE required | ||
| - | * **Three Execution Modes** -- Local (current directory), Worktree (isolated Git branch), Cloud (remote sandboxed) | ||
| - | * **Built-in Git Tools** -- Diff pane with inline comments, staging/ | ||
| - | * **Integrated Terminal** -- Toggle via Cmd+J; Codex reads output for validation | ||
| - | * **Approval Policies** -- '' | ||
| - | * **TOML Configuration** -- Profiles, multiple precedence levels (CLI args > profiles > config.toml > defaults) | ||
| - | * **MCP Support** -- Manage external tool servers (add/ | ||
| - | * **GitHub Actions** -- '' | ||
| - | * **Enterprise Features** -- Enhanced capabilities for business use (v0.116.0+) | ||
| - | |||
| - | ===== Architecture ===== | ||
| - | |||
| - | Codex CLI follows an agent loop: analyze the repository, generate changes, execute with approval, and iterate on feedback. The Rust core ensures low latency and efficient resource usage.((https:// | ||
| - | |||
| - | < | ||
| - | graph TD | ||
| - | A[User Prompt] --> B[Codex Agent] | ||
| - | B --> C[Repository Analysis] | ||
| - | C --> D[Code Generation] | ||
| - | D --> E{Execution Mode} | ||
| - | E --> F[Local - Current Dir] | ||
| - | E --> G[Worktree - Isolated Branch] | ||
| - | E --> H[Cloud - Remote Sandbox] | ||
| - | F --> I{Approval Policy} | ||
| - | G --> I | ||
| - | H --> I | ||
| - | I --> | ||
| - | I --> | ||
| - | I --> | ||
| - | J --> M[Execute Changes] | ||
| - | K --> M | ||
| - | L --> M | ||
| - | M --> N[Terminal Output] | ||
| - | N --> O{Validation} | ||
| - | O --> | ||
| - | O --> | ||
| - | B --> Q[MCP Tool Servers] | ||
| - | </ | ||
| - | |||
| - | ===== Supported Models ===== | ||
| - | |||
| - | * **Default** -- '' | ||
| - | * **Switchable** -- GPT-5.4, GPT-5.3-Codex, | ||
| - | * **Custom Providers** -- Any OpenAI-compatible API (Azure, Bedrock, custom endpoints) | ||
| - | |||
| - | Model configuration via TOML: | ||
| - | |||
| - | <code toml> | ||
| - | model = " | ||
| - | model_provider = " | ||
| - | |||
| - | [model_providers.openai-chat-completions] | ||
| - | base_url = " | ||
| - | env_key = " | ||
| - | wire_api = " | ||
| - | </ | ||
| - | |||
| - | ===== Installation ===== | ||
| - | |||
| - | <code bash> | ||
| - | # Via npm | ||
| - | npm i -g @openai/ | ||
| - | |||
| - | # Via Homebrew | ||
| - | brew install codex | ||
| - | |||
| - | # From source (Rust) | ||
| - | cargo install codex | ||
| - | |||
| - | # First run prompts for authentication: | ||
| - | # - ChatGPT account (Plus/ | ||
| - | # - or API key | ||
| - | codex | ||
| - | </ | ||
| - | |||
| - | ===== CLI Usage ===== | ||
| - | |||
| - | <code bash> | ||
| - | # Start interactive session | ||
| - | codex | ||
| - | |||
| - | # Switch models during session | ||
| - | /model gpt-5.4 | ||
| - | |||
| - | # MCP server management | ||
| - | codex mcp add docs -- docs-server --port 4000 | ||
| - | codex mcp list --json | ||
| - | codex mcp get docs | ||
| - | codex mcp remove docs | ||
| - | |||
| - | # Use profiles | ||
| - | codex --profile enterprise --model o3 | ||
| - | |||
| - | # GitHub Actions integration | ||
| - | # Uses openai/ | ||
| - | </ | ||
| - | |||
| - | |||
| - | ===== See Also ===== | ||
| - | |||
| - | * [[github_copilot]] -- GitHub Copilot ecosystem with agent mode | ||
| - | * [[plandex]] -- Open-source AI coding agent for large projects | ||
| - | * [[claude_code]] -- Anthropic Claude Code CLI agent | ||
| - | * [[warp_terminal]] -- Warp agentic development environment | ||
| - | |||
| - | ===== References ===== | ||