How to install Codex
Published Jul 15, 2026 · Checked against the official docs
Two ways in. For the terminal agent, run `npm install -g @openai/codex`, then `codex`, and sign in with your ChatGPT account. For a GUI, the Codex app merged into the ChatGPT desktop app on July 9, 2026, so installing that app gets you Codex next to Chat and Work. Both accept a ChatGPT login or an API key.
The fastest path to the terminal agent is the npm package. Install it globally, launch it, sign in:
npm install -g @openai/codex
codex
On first run, pick Sign in with ChatGPT to use Codex on your Plus, Pro, Business, Edu, or Enterprise plan. You can use an API key instead, but that takes extra setup. That’s the whole thing for most people. The rest of this page is the other install routes and which one fits you.
Which one do you want
There are two products with the Codex name, and it matters which you install.
- Codex CLI is the coding agent that runs in your terminal. Install it if you live in the shell, want to script it, or run it over SSH. Everything below with
npmorbrewis the CLI. - The ChatGPT desktop app now has Codex built in. OpenAI merged the standalone Codex app into the ChatGPT desktop app on July 9, 2026, so Codex sits next to Chat and Work in one window. Install this if you want a GUI with inline diffs and pull-request review. It runs on Mac and Windows, on every plan including Free.
You can run both. They share one ChatGPT login.
Install the CLI
- npm (any OS with Node):
npm install -g @openai/codex. You need Node.js on the machine first. The install guides cite Node 18 or newer, though the current CLI docs page doesn’t pin an exact version. - Homebrew (Mac):
brew install --cask codex. Use the--caskform the docs point to; that’s the OpenAI CLI. - Install script: on Mac or Linux,
curl -fsSL https://chatgpt.com/codex/install.sh | sh; on Windows,powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex". Both are documented on the official CLI page. - Run
codexand sign in.
Don’t hardcode a version. The current stable line is 0.144.x as of July 2026 and it ships often, so npm install -g @openai/codex always pulls the latest. For step-by-step per platform, see the OS guides in Related.
If it fails
- Mac, Homebrew, “Apple could not verify rg”: the cask has shipped an unsigned ripgrep binary more than once. Fix on the rg gatekeeper page.
- Windows, sign-in dies with
os error 10013: Windows is reserving the OAuth callback port before Codex can bind it. Full fix on the login server port page. codex: command not foundafter npm install: your global npm bin directory isn’t on PATH. Fix PATH, or reinstall with Homebrew or the install script.
Related
- Install Codex on Windows
- Install Codex on macOS
- Install Codex on Linux / WSL
- Update Codex
- Plan limits and quotas
Facts on this page verified July 15, 2026.
Sources
- Official Codex CLI docs — developers.openai.com/codex/cli (redirects to learn.chatgpt.com)
- openai/codex GitHub README
- @openai/codex on npm
- openai/codex releases (version history)
- OpenAI Help Center — Moving to the new ChatGPT desktop app
- Neowin — OpenAI launches ChatGPT Work and unified desktop app with Codex built in