
codex
OpenAI's terminal coding agent, Apache-2.0 licensed
Replaces Claude Code, Github Copilot, Cursor, Tabnine, Jetbrains Ai Assistant, Windsurf, Amazon Q Developer

Who it's for
Codex CLI brings a conversational agent into the shell you already work in. Describe a task such as refactoring a function, writing tests, or adding error handling, and the agent reads your local files and acts on them directly.
If you primarily code in a graphical IDE and are comfortable with inline autocomplete, GitHub Copilot's editor integration will likely feel more natural. Codex CLI's value is in the terminal-first workflow.
Because Codex CLI is a binary you can call from any shell script, it fits naturally into Makefile targets, CI pipelines, or custom tooling. Teams can write scripts that call the agent as one step in a larger automated workflow.
If your automation pipeline runs in an environment without internet access or where OpenAI API calls are blocked, the agent cannot function. Local-model support is not documented in the current release.
Users with an existing ChatGPT Plus, Pro, or Enterprise plan can authenticate with that account and use Codex CLI without additional API key setup. This makes it a low-friction add-on for teams that already pay for ChatGPT.
If you need fine-grained cost controls per developer, an API key approach gives more visibility into per-user spend than a shared ChatGPT plan.
The problem
Most AI coding tools are tied to a specific editor or require you to break context by opening a browser window. GitHub Copilot works inside your IDE but not in your terminal session. Proprietary managed services charge per-seat fees regardless of how much you use them, and they give you no path to run the agent in a custom script, CI pipeline, or non-standard environment. Terminal-native developers and teams automating code tasks with shell scripts have no obvious place in that ecosystem. They need an agent that can read and write files locally, accept natural-language task descriptions, and run anywhere a terminal is available.
How it works
Runs directly in your local shell rather than inside a browser or editor. You describe a task in natural language and the agent reads, creates, or edits files on your filesystem in the same session. No context-switching required.
Sign in with your existing ChatGPT Plus, Pro, Business, Edu, or Enterprise plan to use Codex as part of your subscription. You can also authenticate with an OpenAI API key for programmatic or CI use cases.
Install on Mac or Linux with a single curl command, via Homebrew as a cask, or via npm for Node.js environments. Windows is supported through a PowerShell installer. Binary releases for Apple Silicon, x86_64 Mac, and Linux arm64/x86_64 are also available as GitHub Release downloads.
Available as an extension for VS Code, Cursor, and Windsurf in addition to the CLI. A desktop app mode (codex app) is also available for users who prefer a graphical interface over the terminal.
The full source is published under Apache-2.0, which permits commercial use, modification, and distribution. The codebase is written in Rust.
Features
- Terminal-native AI coding agent
- ChatGPT plan and API key authentication
- Multi-platform installation via npm, Homebrew, or shell script
- IDE extension support for VS Code, Cursor, and Windsurf
- Apache-2.0 license with public source code
How to install
Install Codex CLI with npm, Homebrew, or the curl installer for Mac and Linux.
curl -fsSL https://chatgpt.com/codex/install.sh | sh
npm install -g @openai/codex
brew install --cask codexRecommended for this setup
Strengths
- No server or infrastructure to maintain: Installing Codex CLI requires only a single command. There is no database, no container orchestration, and no deployment pipeline. The agent runs on your local machine and connects to OpenAI's API, so setup takes minutes rather than hours.
- Actively maintained by OpenAI with strong community traction: The repository receives regular pushes and has over 113,000 GitHub stars, signaling a large user community tracking the project. Being OpenAI's own tool means the CLI stays current with model improvements as they ship.
- Covers terminal, IDE, and desktop in one project: The same project provides the CLI for terminal users, extensions for VS Code, Cursor, and Windsurf for IDE users, and a desktop app mode. Teams can standardize on one tool across different developer preferences.
Trade-offs
- Requires paid OpenAI access to run queries: Every task requires an active ChatGPT subscription (Plus, Pro, Business, Edu, or Enterprise) or a funded OpenAI API key. The CLI itself is free and open source, but the model inference is not. Teams with high query volume will need to budget for API spend or a ChatGPT plan tier.
- High open issue volume for a young project: The repository carries over 13,000 open issues, which is large relative to most tools of this age. New users may find rough edges or undocumented limitations. The issue tracker warrants checking before adopting for production automation.
- Model provider locked to OpenAI: The CLI connects to OpenAI's API. The README documents no support for local models (Ollama, LM Studio) or other API providers. Teams that want to run inference entirely on-premises or switch model providers are not served by the current design.
Tech stack
FAQ
The CLI itself is Apache-2.0 licensed and free to install and run. However, each coding session requires either a ChatGPT Plus, Pro, Business, Edu, or Enterprise plan, or a funded OpenAI API key. You pay for model inference, not the software itself.
Run `curl -fsSL https://chatgpt.com/codex/install.sh | sh` in your terminal. You can also install via Homebrew with `brew install --cask codex` or via npm with `npm install -g @openai/codex`. On Windows, use the PowerShell installer documented in the GitHub README.
Codex CLI runs locally on your machine and operates directly on your local filesystem from the terminal. Codex Web is a separate cloud-based agent at chatgpt.com/codex that runs in the browser. They share a name but serve different workflows.
Yes. Codex offers IDE extensions for VS Code, Cursor, and Windsurf. The CLI is for terminal-first workflows; the IDE extensions bring the same underlying agent into the editor environment.
Codex CLI is released under the Apache-2.0 license. This permits commercial use, modification, and distribution with attribution. The source code is published at github.com/openai/codex.