Free checklist
OC

OpenAI Codex CLI

Use case: Coding agents

Lightweight coding agent that runs locally in your terminal with sandboxed execution.

Codex CLI is a coding agent from OpenAI that runs locally on your computer. You start it by running codex in a project directory, and it can inspect files, make edits and run the tools already installed on your machine. You choose the model, reasoning effort and permissions for each run, and the /permissions command shows what Codex is allowed to do. The documentation also describes codex exec for non-interactive runs in scripts and CI, a review feature that runs against uncommitted changes, a commit or a base branch, and codex mcp for connecting MCP servers.

Pick Codex CLI when you want a local, terminal-based agent with explicit control over permissions and an open-source codebase you can read. It also supports skills, subagents for splitting up an investigation, saved sessions you can reopen with codex resume, images passed with codex --image and live web search with codex --search. If you prefer another surface, OpenAI also offers Codex in IDEs, a desktop app and a cloud agent, Codex Web, at chatgpt.com/codex.

The repository is licensed under Apache-2.0. You can install the CLI with a standalone installer, with npm install -g @openai/codex or with Homebrew. For access, OpenAI recommends signing in with your ChatGPT account so Codex is used as part of a Plus, Pro, Business, Edu or Enterprise plan. You can instead use an API key, which needs additional setup. OpenAI lists plans and usage limits on its Codex pricing page, and API-key sessions are billed at API rates instead of your ChatGPT allowance.

How we use Codex CLI

We run Codex CLI every week on the machine that builds this site. Our agents hand it a written prompt on stdin with codex exec, so it runs headless with no chat window, and it works in a throwaway copy of the site rather than the live code.

Every prompt starts with the same rules: preview only, no deploy, no commit, no push, print no secrets. Then it lists small numbered diffs, like fixing a clipped nav button at 390px or removing a dropped vendor from the CSP. Codex makes the edits and a separate QA step checks them before anything ships.

We also use it as a second opinion next to Claude Code: one agent writes a change, the other reviews it. It's signed in with a ChatGPT account, not an API key.

Like OpenAI Codex CLI? Find tools like it on X.

Follow @AgentstackDaily, plus the free Top 25 Agent Tools checklist.

At a glance

Category
Coding agents
Best for
Best AI coding agents in 2026 · Coding agents use cases
Pricing
CLI included with ChatGPT Plus, Pro, Business, Edu and Enterprise plans (Pro at $100, $200 or $500/mo), or pay API rates with an API key (as of Nov 2026, official pricing)
Official site
github.com
Link checked
November 4, 2026
Data
JSON
Visit OpenAI Codex CLI →

How OpenAI Codex CLI fits an agent workflow

In an agent stack, OpenAI Codex CLI belongs to the Coding agents category, which covers the development layer, where an agent reads, writes and runs code in a repository or terminal. You will also find it in our curated list: Best AI coding agents in 2026. Other Coding agents entries worth a look alongside it include Cline, OpenHands and Gemini CLI.

OpenAI Codex CLI alternatives

All Coding agents tools → · Best AI coding agents in 2026

FAQ

How do I install Codex CLI?

On macOS or Linux run curl -fsSL https://chatgpt.com/codex/install.sh | sh. It can also be installed with npm install -g @openai/codex or brew install --cask codex. Then run codex in your project.

How do I sign in to Codex CLI?

Run codex and choose Sign in with ChatGPT. You can also use an OpenAI API key, which requires additional setup.

Is Codex CLI open source?

Yes. The openai/codex repository is licensed under Apache-2.0.

Can Codex CLI run in scripts or CI?

Yes. The documentation says you can call codex exec from repeatable workflows and pipelines, as well as use Codex interactively in the terminal.

Does Codex CLI work on Windows?

Yes. OpenAI's CLI page has a Windows install option alongside macOS/Linux, npm (npm install -g @openai/codex) and Homebrew.

Can Codex CLI search the web?

Yes. You can switch a run to live web search when a task depends on current releases or docs, and the searches stay visible in the transcript.

Get new agent tools and tips as they're added

Follow @AgentstackDaily on X for new tools and copy-paste tips. Free.