Skip to content

What is Codex CLI?

Latest launch Apache-2.0

Summary

Codex CLI is OpenAI's Apache-2.0 coding agent that runs locally in your terminal, signed in with a ChatGPT plan or an OpenAI API key.

Open source
Yes
License
Apache-2.0
MCP
Yes
Pricing
The CLI is Apache-2.0. Usage comes from a ChatGPT plan or is billed at API rates when you sign in with an API key.

Codex CLI is OpenAI's terminal coding agent. It reads and edits a local repository, runs commands under a sandbox and approval rules, and takes project guidance from an AGENTS.md file. Code: openai/codex, Apache-2.0, written mostly in Rust. Docs: developers.openai.com/codex.

The project ships fast. GitHub shows stable builds 0.165.0 on October 27, 2026 and 0.166.0 on October 29, with several alpha builds in between on the npm alpha tag. Stable builds carry the latest tag on npm as @openai/codex.

Access works two ways. Signing in with ChatGPT draws on the plan's shared Codex allowance, which also covers the desktop app, the IDE extension and cloud tasks. An API key runs the CLI, SDK and IDE extension at API rates, which the pricing page suggests for CI and other shared environments.

This hub was created with the dated launch Codex CLI 0.166.0. For a head-to-head with Anthropic's terminal agent, read Claude Code vs Codex. Other terminal agents in the coding agents category include Claude Code, OpenCode, Gemini CLI and Qwen Code.

Codex CLI alternatives

Codex CLI compared with its alternatives
ToolLicensePricing note
Codex CLIThis pageCodex CLI is OpenAI's Apache-2.0 coding agent that runs locally in your terminal, signed in with a ChatGPT plan or an OpenAI API key.
Apache-2.0The CLI is Apache-2.0. Usage comes from a ChatGPT plan or is billed at API rates when you sign in with an API key.
Claude CodeClaude Code is an agentic coding tool that runs in your terminal and works on your codebase.
—Not stated
OpenCodeOpen-source coding agent from the anomalyco/opencode repository, MIT-licensed, with a terminal client and a site at opencode.ai.
MITThe client is MIT-licensed. Model access is separate; this page does not quote a hosted plan.
Gemini CLIGoogle's Apache-2.0 terminal coding agent for Gemini models. Version 0.67.0 (November 4, 2026) adds a models command and sandbox IDE diffs.
Apache-2.0The CLI is free under Apache-2.0. Model use is set by how you sign in: a free Google account tier, a Gemini API key (free or paid), Vertex AI, or a Google AI Pro, Ultra or Code Assist plan.
Qwen CodeAn open-source AI coding agent that lives in your terminal to turn ideas into code.
Apache-2.0Not stated

Launches and updates

  • Codex CLI 0.166.0 adds keyboard transcript selection

    Codex CLICodex CLI 0.166.0 (October 29, 2026) adds keyboard transcript selection and search, codex doctor --network-only, codex queue --resume and resume fixes.

Guides covering Codex CLI

Questions

What is Codex CLI?

The openai/codex README describes Codex CLI as a coding agent from OpenAI that runs locally on your computer. The same repository points to an IDE extension, the desktop app (codex app) and the cloud agent Codex Web at chatgpt.com/codex.

Is Codex CLI open source?

Yes. The GitHub API reports Apache-2.0 for openai/codex, and the README states the repository is licensed under Apache-2.0. Most of the code is Rust.

How do I install Codex CLI?

The README lists an install script for macOS and Linux, a PowerShell script for Windows, npm install -g @openai/codex and brew install --cask codex. Then run codex and choose Sign in with ChatGPT, or set it up with an API key.

Do I need a ChatGPT subscription to use Codex CLI?

No. The README recommends signing in with a ChatGPT plan, but the pricing page lists an API key option that runs Codex in the CLI, SDK or IDE extension, billed at API rates and without cloud features such as GitHub code review or Slack.