# OpenAI Codex CLI

> Codex CLI is an Apache-2.0 coding agent from OpenAI that runs on your computer. From the terminal it inspects, edits and runs code, connects tools through MCP servers, and runs scripted or CI jobs with codex exec or the Codex GitHub Action. There is also an IDE extension for VS Code, Cursor and Windsurf. Sign in with ChatGPT (Codex is included in Free, Go, Plus, Pro, Business, Edu and Enterprise plans, with usage limits) or use an OpenAI API key; the --oss flag runs local open models through LM Studio or Ollama. Runs on macOS, Linux and Windows, with a native Windows sandbox.

- Repository: https://github.com/openai/codex
- Official docs: https://learn.chatgpt.com/docs/codex/cli
- Checked: 2026-10-21

## What it replaces
- Claude Code: Edit code across a repo from the terminal with an AI agent, Run commands and tests, Use the agent inside VS Code or JetBrains, Connect tools and data through MCP, Run the agent headless in scripts or CI (GitHub Actions) (partial). Very close match for terminal, IDE, MCP and CI use; the docs do not describe writing commits or opening pull requests from the CLI.
  - Use it instead of paying for Claude Code? Personal use: Yes. Business: Yes.
- Cursor: Let an agent plan and edit across many files, Run terminal commands and tests from the agent, Connect tools and data through MCP (partial). Agent edits and commands from the terminal or an IDE extension; not an editor, so no tab completion. Cloud agents are the separate Codex Web product.
  - Use it instead of paying for Cursor? Personal use: Yes. Business: Yes.

## Facts, with sources

| Question | Status | Answer | Source | Checked |
|---|---|---|---|---|
| Runs on my machine? | Confirmed | Yes, a command-line agent that runs on your computer; cloud models run on OpenAI's servers unless you use --oss | https://github.com/openai/codex#readme | 2026-10-21 |
| Code licence | Confirmed | Apache-2.0 | https://github.com/openai/codex/blob/main/LICENSE | 2026-10-21 |
| Model weights licence | Confirmed | No separate model weights | https://github.com/openai/codex#readme | 2026-10-21 |
| Commercial use | Confirmed | Allowed under Apache-2.0 | https://github.com/openai/codex/blob/main/LICENSE | 2026-10-21 |
| Paid services needed? | Partial | Not required with local models (--oss with Ollama or LM Studio) or the limited ChatGPT Free plan; paid ChatGPT plans and OpenAI API keys are optional | https://learn.chatgpt.com/docs/developer-commands?surface=cli | 2026-10-21 |
| Hardware | Unknown | Not documented in the README or CLI docs | none found | - |
| Operating systems | Confirmed | macOS, Linux and Windows (native PowerShell with a Windows sandbox, or WSL2) | https://github.com/openai/codex#readme | 2026-10-21 |
| Setup effort | Confirmed | Easy; one-line install script, npm or Homebrew, then sign in with ChatGPT | https://github.com/openai/codex#readme | 2026-10-21 |

GitHub: 130321 stars, 20551 forks, last push 2026-10-22, archived: no.
---
Source: RepoQuarry (https://repoquarry.dev/projects/codex-cli). Data licence: CC BY 4.0. Quotes are from project documentation and belong to their authors.
