openai /
codex
A coding agent from OpenAI that runs in your terminal on your own machine
- 130.5k stars
- 2.9k stars since 3 Oct
- Rust
- Updated today
- Beginner friendly
- Coding agents & dev tools
Codex CLI is a coding agent you run from the command line. You start it with the codex command inside your project, and it works on your computer rather than in a hosted service.
The README is short on technical detail. It covers installing, signing in and where to find the docs. For how the agent works, the full docs on developers.openai.com are the place to look.
OpenAI offers Codex in other forms too: an IDE extension for VS Code, Cursor and Windsurf, a desktop app launched with codex app, and a cloud agent called Codex Web. The CLI is the terminal option in that set. It is written in Rust and licensed under Apache-2.0.
What it does
Local terminal agent
The agent runs on your own computer from the terminal. Start it by typing codex.
Two ways to sign in
Sign in with ChatGPT to use it under a Plus, Pro, Business, Edu or Enterprise plan. An API key also works but needs extra setup.
Several install routes
Use a shell install script on Mac, Linux or Windows, or npm or Homebrew. You can also download a binary from GitHub Releases.
Sits alongside other Codex products
The same Codex is available in editors, as a desktop app and as a cloud agent, so you can pick the surface you like.
What you could build
- Ask an agent to read and change code in a project from your terminal.
- Use your existing ChatGPT subscription to power a coding agent instead of setting up API billing.
- Try a terminal-based coding agent on Mac, Linux or Windows.
- Read the Rust source to see how a production coding agent is built.
- Contribute fixes or features through the repo's contributing guide.
Get started
Install with npm or Homebrew (or the shell installer in the README), then run codex in your project. Choose Sign in with ChatGPT when prompted, or set up an API key.
npm install -g @openai/codexbrew install --cask codexcodexCommands are copied from the project's README. Read it on GitHub for the full setup.
Anything better than codex?
Codex CLI is a strong, mainstream pick if you already pay for ChatGPT or use OpenAI's API and want a first-party terminal agent. Look elsewhere if you want to switch between model providers freely (OpenCode) or prefer Anthropic's models (Claude Code).
-
opencodeBetter pick You want the same terminal-agent workflow but with any model provider, plus a read-only plan mode and a beta desktop app. Trade-off: You lose first-party sign-in with a ChatGPT plan and OpenAI's tight integration with its own models.
-
claude-codeAlternative You prefer Claude models or want the agent in IDEs and in GitHub through @claude, not only in the terminal. Trade-off: It ties you to Anthropic's models and plans instead of OpenAI's.
-
openclaudeAlternative You want one terminal agent that connects to OpenAI-compatible APIs, Gemini, GitHub Models and local Ollama models, with MCP support. Trade-off: It is less mature and has a smaller community than Codex, and the setup is more involved.
-
codegraphUse alongside Adding it gives Codex a local graph of your code's symbols and calls through MCP, so it needs fewer grep and read steps. Trade-off: You must build and maintain an index, and you have to configure MCP.
More in Coding agents & dev tools
rea
MCP server that lets AI agents reverse engineer apps, binaries and websites locally