Install the Codex CLI

getting started

// what it does

Three official paths install the same codex binary: npm (npm install -g @openai/codex, needs Node.js), Homebrew on macOS (brew install --cask codex), or the shell installer for macOS/Linux. Supported systems are macOS 12+, Ubuntu 20.04+/Debian 10+, and Windows 11 through WSL2. Upgrade an npm install with @latest, or run codex update.

// shell

$ npm install -g @openai/codex
$ brew install --cask codex
$ curl -fsSL https://chatgpt.com/codex/install.sh | sh

// gotcha

The Homebrew formula is a cask, so it is brew install --cask codex, not brew install codex, which resolves to an unrelated formula. Native Windows is experimental, so run under WSL2 on Windows 11.

// resources