home / agent-harnesses / codex-cli

Codex CLI

Official · OpenAI
64k

OpenAI's lightweight terminal coding agent for editing, running tasks, and agentic development loops.

$npm install -g @openai/codex
Language
Rust
Stars
63,681
Category
Agent Harnesses
Agent
Ready
Agent Compatibility
JSON Output
Agent Skill
MCP Support
AI Analysis

Codex CLI is OpenAI's terminal coding agent for working inside a local repository, either through a fullscreen interactive session or headless runs. It covers code editing, command execution, review, session management, and integration surfaces for other clients.

What It Enables
  • Work through coding tasks in a local repo, with the agent reading files, proposing patches, running shell commands, and resuming or forking prior sessions.
  • Run one-shot or unattended agent tasks with codex exec and codex review, including structured final-output schemas and JSONL event streams for follow-up tooling.
  • Manage MCP connections for Codex or expose Codex itself over JSON-RPC so editors or other clients can drive the agent outside the TUI.
Agent Fit
  • Useful when you want a higher-level coding primitive rather than a narrow service CLI, especially for repo changes, validation loops, and review passes.
  • Non-interactive subcommands, JSONL events, and explicit sandbox or approval flags make it scriptable enough for agent workflows, even though the default experience is conversational.
  • Best fit when paired with project skills and local policy defaults; it can also connect to MCP-based setups when that integration model is needed.
Caveats
  • A lot of the product value still depends on model-driven behavior rather than deterministic command semantics, so outputs are less predictable than service CLIs with fixed schemas.
  • Authentication, approvals, sandbox policy, and some setup flows can require interactive choices before unattended use is reliable.