AI IDE List
CLI agents

Codex CLI

OpenAI Codex CLI is a terminal coding agent that combines repository editing and command execution with task-to-task coordination, parallel workflows, hooks, and the broader Codex platform.

Installation docs

Information checked: Aug 29, 2026 ·View sources

Tool details

Type
CLI agents
Platforms
macOS, Linux, Windows, Terminal, Local project directories, VS Code-compatible IDE workflows via Codex IDE extension, Codex app, Codex SDK, GitHub Actions
Free plan
Yes
Open source
Yes
Bring your own key
Yes
Local models
Yes
Codex CLI

Overview

Best for

  • Terminal-first developers
  • Local repository editing
  • Multi-file bug fixes
  • Refactoring
  • Test generation
  • Codebase exploration
  • OpenAI model users
  • Developers who want configurable approvals and sandboxing
  • Teams already using ChatGPT or OpenAI API
  • Automation through Codex SDK or GitHub Actions

Strengths

  • Open-source terminal agent backed by OpenAI’s Codex ecosystem.
  • Works locally in existing repositories without requiring a new IDE.
  • Strong model options for complex coding and faster routine tasks.
  • Supports API-key, ChatGPT-plan, custom provider, and local OSS workflows.
  • Good safety surface with approvals, sandboxing, config, and history controls.
  • Shares concepts with Codex IDE, app, SDK, cloud, and GitHub workflows.

Limitations & trade-offs

  • Non-technical users who want a visual app builder
  • Developers whose main need is inline autocomplete
  • Teams that require a fully provider-neutral hosted product
  • Users who do not want to manage terminal setup or configuration
  • Projects where AI agents are not allowed to run shell commands
  • Workflows that require cloud Codex features while using only API-key authentication
  • Requires terminal comfort and configuration discipline.
  • Usage limits and credits vary by model, task size, and plan.
  • Cloud features are not available when using only API-key authentication.
  • Local model quality depends heavily on the selected OSS model and hardware.
  • Not primarily an inline autocomplete tool.
  • Agentic file and shell actions still need human review before production use.

Get started

Pricing & usage limits

Official pricing

Free tier · From $8

Free$0 / month

Included Codex access for quick coding tasks with limited usage.

Go$8 / month

Lightweight Codex usage for smaller coding tasks.

Plus$20 / month

Includes Codex on web, CLI, IDE extension, and iOS, plus latest Codex models and credit extension.

ProFrom $100 / month

Higher Codex usage limits than Plus, including Pro-only access to GPT-5.3-Codex-Spark research preview.

API KeyUsage-based

Use Codex in CLI, SDK, or IDE extension with API token billing; cloud features are not included.

BusinessPay as you go

Team workspace with Codex seats, credits, admin controls, SAML SSO, MFA, and no training on business data by default.

Enterprise & EduCustom

Enterprise-grade Codex access with SCIM, EKM, RBAC, audit logs, usage monitoring, data residency, and retention controls.

Pricing checked: Jun 14, 2026 · Subscription, usage limits, and model costs may be billed separately.

OpenAI Codex for Open Source: How Maintainers Can Get 6 Months of ChatGPT Pro, API Credits, and Codex SecurityWould You Pay $300 for Unlimited Codex? The 2026 Power-User Pricing DebateCodex Users Were Asked What Feature Should Be Removed — Their Real Answer Was Usage LimitsCodex Brings Back the 5-Hour Limit for Plus Users, While Pro Plans Stay ExemptOpenAI Resets ChatGPT Work and Codex Usage Limits Again — What Paid Users Need to KnowHow to Choose GPT-5.6 Sol in Codex: Reasoning Levels, Credit Use, and Real Coding WorkflowsCodex Says You Have 3 Usage Limit Resets Available: What It Means and When to Use One

Features & details

Terminal coding agent

  • Runs locally from the command line inside a selected project directory.
  • Reads files, writes changes, runs commands, and helps complete coding tasks.
  • Built in Rust and published as an open-source project.

Model and provider options

  • Supports GPT-5.5, GPT-5.4, GPT-5.4 mini, and GPT-5.3-Codex-Spark where available.
  • Can authenticate with ChatGPT plan access or an API key.
  • Supports custom providers, Azure OpenAI, Amazon Bedrock, and local OSS mode with Ollama or LM Studio.

Local control and safety

  • Approval policies control when Codex pauses before running generated commands.
  • Sandbox modes limit file and network access.
  • Local history persistence can be configured or disabled.

Customization

  • AGENTS.md provides repository-specific instructions.
  • Skills and plugins package reusable workflows.
  • Subagents support parallel specialized agents for exploration or implementation.

Ecosystem integration

  • MCP support connects Codex to tools, documentation, browser workflows, and services such as Figma.
  • Codex IDE extension shares the same agent and configuration as the CLI.
  • Codex SDK, non-interactive mode, and GitHub Actions support scriptable automation.

Task Orchestration

  • Reference Codex tasks with @ mentions
  • Read, create, and message other tasks
  • Coordinate parallel terminal work
  • Interrupt hooks for workflow control

Why Choose Codex CLI?

Codex CLI is strongest when the developer wants an OpenAI-native coding agent inside the same terminal workflow already used for Git, tests, package managers, scripts, and deployment commands. It is not a visual app builder and it is not mainly an autocomplete layer. Its value comes from letting Codex inspect a local project, reason about the requested task, modify files, run commands, and iterate with the developer in the loop.

The main reason to choose it over a browser app or desktop IDE is control. The CLI exposes configuration for models, providers, approvals, sandboxing, project instructions, MCP servers, hooks, skills, subagents, and local history. That makes it powerful for developers who want to tune how the agent behaves, but it also means the best results come from disciplined setup rather than one-off prompting.

Core Workflow

A practical Codex CLI workflow starts in a clean Git state. Launch Codex in the project directory, ask it to inspect the relevant code, request a plan for anything non-trivial, and then let it implement a scoped change. Afterward, review the diff, run tests, and use follow-up prompts for targeted fixes instead of asking for a broad rewrite.

For larger tasks, the safer pattern is staged delegation: exploration first, plan second, implementation third, verification last. AGENTS.md should document project-specific rules such as package manager, test commands, style conventions, architectural boundaries, files to avoid, and review expectations. For multi-part work, subagents and skills can turn repeated workflows into reusable building blocks instead of long prompts.

Use Cases

Codex CLI fits repository-native engineering work: debugging failing tests, updating APIs, generating test coverage, refactoring modules, modernizing dependencies, explaining unfamiliar systems, and automating repeatable tasks. It is especially useful when the task needs both code changes and command execution.

It can also work well for teams that want the same Codex agent across multiple surfaces. A developer can use the CLI locally, the IDE extension inside a VS Code-compatible editor, the Codex app for parallel task management, and GitHub workflows for review or automation. The CLI remains the most direct surface for developers who prefer explicit terminal control.

Comparison to Alternatives

Compared with Claude Code, Codex CLI is OpenAI-native and benefits from OpenAI’s Codex model ecosystem, while Claude Code is built around Anthropic’s Claude models and their agentic coding workflow. The better choice often depends on model preference, organization policy, and where the team already pays for AI access.

Compared with Aider, Codex CLI is more connected to a broader first-party product surface, while Aider remains attractive for developers who want a lightweight, Git-centered, model-flexible open-source workflow. Compared with OpenCode, Codex CLI has deeper OpenAI integration, while OpenCode is more provider-agnostic by default.

Compared with Cursor or Windsurf, Codex CLI is less visually integrated but more terminal-native. Cursor and Windsurf are usually better for developers who want AI editing, chat, autocomplete, and navigation inside a single editor. Codex CLI is more appealing when the developer wants a powerful agent that fits beside any editor and can be governed through config, sandboxing, and shell permissions.

Best Configuration

For personal use, start with GPT-5.5 for complex tasks and switch to smaller models for routine edits when usage matters. Keep approval prompts on until the workflow is trusted. Use workspace-write sandboxing carefully, and avoid enabling network access unless the task truly requires it.

For team use, standardize AGENTS.md, approved MCP servers, model defaults, sandbox profiles, local history rules, provider routing, and hooks. Sensitive repositories should define stricter approval behavior and avoid unnecessary MCP context because every connected tool can increase both privacy exposure and token usage. Teams using Business, Enterprise, or Edu plans should also align Codex access with RBAC, compliance logging, workspace credits, and data-retention policies.

Migration Notes

Developers moving from Claude Code, Aider, or OpenCode should compare the same real tasks rather than judging only from a first prompt. Use one bug fix, one refactor, one test-generation task, and one repo-exploration task. Evaluate diff quality, command behavior, token usage, permission prompts, model switching, and how well the tool follows project instructions.

Teams adopting Codex CLI should pilot it on non-critical repositories before allowing broad shell access in production-adjacent codebases. The safest rollout is gradual: read-only exploration, small edits, test generation, then larger refactors after the team has reviewed how Codex behaves with its code, tooling, and security boundaries.

Codex CLI 0.150.0: Cross-Task Orchestration

Codex CLI 0.150.0, released August 26, 2026, added two workflow features that move the product beyond an isolated terminal session:

  • Task references with @: one Codex task can reference another. The agent can read, create, or message tasks from the terminal, which supports parallel work and explicit task graphs.
  • Interrupt hooks: workflows can respond when a task is interrupted, giving teams a structured place to record state, notify another system, or apply cleanup logic.

These features are useful when one task investigates an issue while another implements a fix, or when a coordinating task delegates work and gathers results. They do not remove the need for branch isolation, bounded permissions, tests, and human review. Cross-task access should be treated as another privileged capability.

Official source: OpenAI Codex changelog.

Model support & data privacy

Supported models

  • gpt-5.5
  • gpt-5.4
  • gpt-5.4 mini
  • gpt-5.3-codex-spark
  • OpenAI API
  • Azure OpenAI
  • Amazon Bedrock
  • Ollama
  • LM Studio

Privacy & data handling

Codex CLI runs locally and can read project files, edit code, run commands, and persist local session history under CODEX_HOME unless configured otherwise. Data sent to models depends on authentication method, selected provider, ChatGPT workspace settings, API organization settings, MCP servers, and whether local OSS mode is used. Users should avoid exposing secrets in prompts, source files, command output, or connected tools, and should configure approvals, sandboxing, ignored paths, and history persistence for sensitive repositories.

Guides, reviews & fixes

View all

Product updates

Official changelog

No verified product updates listed yet. Follow this tool to see new relevant content in Saved.

See the content timeline

Alternatives

Sources & verification

Verification dates record when this directory checked the information. Product release dates appear separately above.

Directory revision history

  1. Added Codex CLI 0.150.0 task references, cross-task read/create/message actions, and Interrupt hooks.

  2. Created entry with current Codex CLI positioning, pricing plans, supported models, open-source status, local provider support, MCP, skills, subagents, sandboxing, approvals, and enterprise controls.