OpenAI Codex CLI

by OpenAI

Open-source terminal coding agent from OpenAI that reads, edits and runs code locally, authenticating via a ChatGPT plan or an OpenAI API key.

developer-toolopen-sourcefree-tierenterprisecoding-agent

At a Glance

Type

Developer tools

Pricing

FreemiumCLI is free (Apache-2.0); using it needs a ChatGPT plan (Free, $8 Go, $20 Plus, from $100 Pro, ~$20-25/user Business) or metered API billing, in USD.

Best For

Running an OpenAI coding agent against a local repo from the terminal or CI, to write, edit and test code without leaving the shell.

Platforms

CLI, macOS, Linux, Windows, API

Models

GPT-6 Sol, GPT-6 Luna

Founded

2015

Headquarters

San Francisco, California, United States

Free Tier

Available

API

Available

Licence

Open Source

Key Features

Pros & Cons

Strengths

  • Free to install and open source under Apache-2.0, so the code can be audited or modified.
  • Works from either a ChatGPT subscription or a pay-as-you-go OpenAI API key, with no separate CLI licence.
  • Native installers for macOS, Linux and Windows, plus npm and Homebrew packages.

Limitations

  • Real use needs a paid ChatGPT plan ($20/month Plus or higher) or metered API billing — the free ChatGPT tier is rate-limited, per learn.chatgpt.com/docs/pricing.
  • It executes shell commands and edits files directly, so sandbox and approval settings need reviewing before granting broader permissions.
  • Underlying model names and pricing have changed repeatedly through 2026 (e.g. GPT-5.5 is being retired on 14 October 2026), so specifics date quickly.

Integrations

GitHubGitLabSlackLinearMCP serversAmazon BedrockVS CodeCursorWindsurf

What it is

Codex CLI is OpenAI's open-source terminal coding agent, published as the openai/codex GitHub repository under an Apache-2.0 licence. It runs on the developer's own machine, reading a local repository, proposing edits, and executing shell commands on request, rather than working through a chat window in a browser.

Interface and dependencies

Install it with the official curl (Mac/Linux) or PowerShell (Windows) script, via npm install -g @openai/codex, through a Homebrew cask, or by downloading a binary from GitHub Releases. It runs natively on macOS (Apple Silicon and Intel), Linux (x86_64/arm64) and Windows. To do any work it needs either a ChatGPT account on a Plus, Pro, Business, Edu or Enterprise plan, or an OpenAI API key billed per token; there's no way to run it against OpenAI's models for free indefinitely, since the free ChatGPT tier is rate-limited. OpenAI's docs list GPT-6 Sol and GPT-6 Luna as the current models behind it, alongside sandbox and approval-policy settings that control what commands it can run without asking first.

Where it fits

It's aimed at developers who want an agent operating directly on their filesystem and shell — writing patches, running tests, or working through a defined task list — rather than copying code in and out of a chat UI. The same underlying service also ships as an IDE extension, a cloud environment and a desktop app, and connects to GitHub, GitLab (beta), Slack, Linear and MCP servers, but the CLI is the locally-run entry point aimed at terminal-based workflows.

Frequently Asked Questions

Do I need a ChatGPT subscription to use Codex CLI?
No. OpenAI's docs say you can authenticate with an OpenAI API key instead and pay per token, rather than using a ChatGPT plan.
Is Codex CLI itself free?
The CLI is free and open-source under Apache-2.0. Running it against OpenAI's models needs either a ChatGPT plan (a rate-limited $0 free tier, then $8 Go, $20 Plus, from $100 Pro) or metered API usage, per learn.chatgpt.com/docs/pricing.

Last updated on