
Codex CLI
github.com/openai/codex- Category
- AI Agents
- Rank
- No. 05Tools index
- Listed in
- #2 Code with an agent · #4 Interface with your agents
- Head-to-head
- Claude Code vs Codex CLI
- Pricing
- Open Source
- Type
- AGENT
- Builder
- openai
- GitHub
- 122.3k stars
- Latest release
- rust-v0.154.0-alpha.6
- Date
About
A coding agent from OpenAI that runs locally in your terminal, providing AI-powered assistance for development tasks. Works with ChatGPT plans or API keys and offers multiple deployment options including IDE integration and desktop app.
What it does
Codex is a coding agent that runs on your own machine as a single terminal program with twenty-eight subcommands: an interactive chat interface when you pass nothing, a headless mode for scripts, a non-interactive code review mode, and a server mode that lets other tools drive the agent over standard input and output. Every front end, including the terminal interface itself, talks to the agent core through the same typed message protocol, and any command the agent executes is confined by an operating-system sandbox with backends for macOS, Linux, and Windows.
Why it's ranked here
What stands out is completeness rather than novelty. The whole local agent ships in the open under Apache-2.0: the model client, the patch engine, the permission policy engine, and sandbox backends for three operating systems, not just a thin client for a hosted service. It also speaks the Model Context Protocol in both directions, managing external servers while exposing the agent itself as one that other tools can call. Renamed internals keep deprecated aliases, a sign that consumers get carried through changes rather than broken by them.
What's good
Its internal boundaries are enforced by the compiler, not just documented. The core and headless components ban printing to standard output outright, so machine-readable output stays valid JSON, one event per line. The patch engine is honest about partial failure: when a write fails midway, it flags that the working tree may already have been touched instead of pretending nothing happened. And command permissions live in a dedicated policy component with prefix rules, network rules, and an explicit decision type rather than ad-hoc string matching.
Tradeoffs
This is a big thing to take on. Several subcommands are marked experimental and a few are hidden from the help output entirely, so a meaningful slice of the command surface is either unstable or invisible. Configuration is layered and wide, spanning cloud bundles, managed policy, and permission profiles. Analytics default to on when the setting is left unset, and the codebase carries a test asserting exactly that. The primary install path in the documentation pipes a remote script into a shell.
How to use it well
For automation, use the headless mode with JSON output rather than scripting the interactive interface: standard output is guaranteed to be one JSON event per line, everything else goes to the error stream, and you can capture a structured result against a schema you supply. Turn diagnostic logging on explicitly, since headless runs default to reporting errors only. Prefer named permission profiles over the flag that bypasses approvals and sandboxing entirely. Try an unfamiliar command under the built-in sandbox subcommand before trusting it in a full run, and use the doctor subcommand to check installation, config, auth, and runtime health.
Technical notes+
The clap definition in codex-rs/cli/src/main.rs declares twenty-eight subcommand variants, some platform-gated; Cloud, RemoteControl, AppServer and ExecServer are marked experimental, while ResponsesApiProxy, StdioToUds and Execpolicy are hidden from help. No front end talks to the agent directly: codex-rs/exec/src/lib.rs starts an in-process app-server client and codex-rs/tui/src/app.rs holds an app-server session, both exchanging typed ClientRequest calls and ServerNotification streams over codex_app_server_protocol. codex-rs/core/src/lib.rs assembles the thread manager, rollout recorder, MCP manager and tools module, and opens by denying clippy print_stdout and print_stderr; codex-rs/exec/src/lib.rs repeats the stdout ban so --json output stays valid JSONL. Sandbox selection lives in codex-rs/sandboxing/src/lib.rs: seatbelt on macOS, the landlock, seccomp and bubblewrap helper in codex-rs/linux-sandbox/src/lib.rs on Linux, a Windows restricted token otherwise. Edits arrive as Begin Patch hunks applied by codex-rs/apply-patch/src/lib.rs, whose AppliedPatchDelta carries an exact flag that is cleared when a write fails mid-patch. Command permissions sit in codex-rs/execpolicy/src/lib.rs with an explicit Decision type. DEFAULT_ANALYTICS_ENABLED is true in both codex-rs/exec/src/lib.rs and codex-rs/mcp-server/src/lib.rs, the latter with a test asserting it. Deprecated aliases in codex-rs/core/src/lib.rs map ConversationManager to ThreadManager, and the approval bypass flag resolves to SandboxMode::DangerFullAccess.
Observed
- License
- Apache-2.0, stated in the README
- Primary language
- Rust workspace; the root package manifest is private and only carries formatting and repo-maintenance tooling
- Install surfaces
- shell installer, PowerShell installer, npm global package, Homebrew cask, or a per-platform release binary
- Interfaces
- interactive terminal UI, headless exec mode with JSON output, MCP server over stdio JSON-RPC, plus sandbox and doctor subcommands
- Sandbox backends
- macOS seatbelt, Linux seccomp plus bubblewrap, Windows restricted token
Read from README.md, package.json, codex-rs/cli/src/main.rs, codex-rs/cli/src/lib.rs, codex-rs/core/src/lib.rs, codex-rs/config/src/lib.rs, codex-rs/protocol/src/lib.rs, codex-rs/exec/src/lib.rs, codex-rs/execpolicy/src/lib.rs, codex-rs/sandboxing/src/lib.rs, codex-rs/linux-sandbox/src/lib.rs, codex-rs/apply-patch/src/lib.rs, codex-rs/tools/src/lib.rs, codex-rs/mcp-server/src/lib.rs, codex-rs/tui/src/app.rs.
What it can do
Generate code from natural language prompts
Natural language description of desired code → Generated code in specified programming language
Debug and fix code errors
Code with bugs or error messages → Corrected code with fixes applied
Explain existing code functionality
Code snippets or files → Natural language explanations of code behavior
Refactor and optimize code
Existing code that needs improvement → Refactored, optimized code
Convert code between programming languages
Code in source programming language → Equivalent code in target programming language
Generate unit tests for code
Code functions or modules → Unit test code for testing the input code
Intel on Codex CLI
Tags
Tech Stack
Comments (0)
No comments yet
Editorially curated, with community endorsements as a secondary signal. Corrections welcome.