Documentation Index
Fetch the complete documentation index at: https://mintlify.com/openai/codex/llms.txt
Use this file to discover all available pages before exploring further.
Installation
Codex CLI can be installed using npm, Homebrew, or by downloading pre-built binaries for your platform.
System requirements
Before installing Codex CLI, ensure your system meets these requirements:
| Requirement | Details |
|---|
| Operating systems | macOS 12+, Ubuntu 20.04+/Debian 10+, or Windows 11 via WSL2 |
| Node.js | 16 or newer (Node 20 LTS recommended for npm installation) |
| Git (recommended) | 2.23+ for built-in PR helpers |
| RAM | 4 GB minimum (8 GB recommended) |
Codex CLI does not work directly on Windows. You must use Windows Subsystem for Linux (WSL2). See the WSL installation guide.
Installation methods
npm
Homebrew
Binary download
Build from source
Install globally with npm
Install Codex CLI globally using your preferred package manager:npm install -g @openai/codex
Never run sudo npm install -g. If you encounter permissions errors, fix your npm permissions instead.
Verify installation
Verify that Codex is installed correctly:You should see the version number printed to your terminal. Install with Homebrew
Install Codex CLI using Homebrew (macOS and Linux):brew install --cask codex
Verify installation
Verify that Codex is installed correctly:You should see the version number printed to your terminal. Download the binary
Go to the latest GitHub Release and download the appropriate binary for your platform:macOS
- Apple Silicon/arm64:
codex-aarch64-apple-darwin.tar.gz
- x86_64 (older Mac hardware):
codex-x86_64-apple-darwin.tar.gz
Linux
- x86_64:
codex-x86_64-unknown-linux-musl.tar.gz
- arm64:
codex-aarch64-unknown-linux-musl.tar.gz
Extract and rename
Extract the archive and rename the binary:# Example for Linux x86_64
tar -xzf codex-x86_64-unknown-linux-musl.tar.gz
mv codex-x86_64-unknown-linux-musl codex
Each archive contains a single entry with the platform name baked in, so you’ll want to rename it to codex. Make executable and move to PATH
Make the binary executable and move it to a directory in your PATH:chmod +x codex
sudo mv codex /usr/local/bin/
Verify installation
Verify that Codex is installed correctly:You should see the version number printed to your terminal. Clone the repository
Clone the Codex repository and navigate to the CLI package:git clone https://github.com/openai/codex.git
cd codex/codex-cli
Enable corepack and install dependencies
Enable corepack and install dependencies:corepack enable
pnpm install
Build the CLI
Build the CLI:Linux only: Download prebuilt sandboxing binaries:./scripts/install_native_deps.sh
This requires gh (GitHub CLI) and zstd. Link globally (optional)
Link the command globally for convenience:Or run directly:
Verify your installation
After installation, verify that Codex is working by running:
You should see the help output with available commands and options.
Next steps