>_ CLI Index
← Back

OpenAI Codex CLI

Official v0.75.0 MCP

OpenAI's terminal coding agent with sandboxed execution and MCP client support

Agent Support
5/5
Platforms
macoslinuxwindows
Authentication

Login required — Sign in with ChatGPT on first launch (recommended), or set `OPENAI_API_KEY` for API-key mode

Agent Usage Example

shell
codex exec "fix the failing test in src/parser.test.ts and explain the root cause"

Installation

npm install -g @openai/codex

OpenAI Codex CLI is OpenAI’s official agentic coding assistant running directly in your terminal. Rewritten in Rust and shipped as a single codex binary, it ships both an interactive TUI mode and a non-interactive exec entry point designed for scripts, CI jobs, and agent escalation — the same pattern used by Claude Code and other top-tier coding agents.

With the highest agent support rating, Codex CLI can read and edit files across a workspace, run shell commands, orchestrate multi-step tasks, and consume Model Context Protocol (MCP) servers as first-class tools. Authentication supports both ChatGPT managed OAuth (with automatic token refresh) and direct API key mode via OPENAI_API_KEY, so the same binary works for individual developers, headless CI, and server-side agent harnesses.

Every action runs through a configurable sandbox: --sandbox read-only for analysis-only runs, workspace-write for scoped edits inside the current repository, or danger-full-access for trusted container environments. Paired with --approval-policy, these controls let you tune exactly how much autonomy the agent has on a given task — making Codex CLI a natural “second opinion” tool to delegate to from another agent when a problem needs a different perspective.

Related Tools