214 words
1 minutes
Codex CLI Installation Guide for Mac - 3 Methods

Introduction#

After installing GitHub Copilot CLI and Gemini CLI, I decided to install this one too. Most articles were too lengthy, so here’s a concise summary. Environment:

  • macOS (Tahoe 26)
  • Node.js 22

Unlike Gemini CLI, this requires a paid subscription.



Installation Methods#

Three installation methods available, including direct binary download.

Homebrew (Simple, Recommended)

brew install codex

npm Global Install (Node.js 18+)

npm install -g @openai/codex

Direct Binary Download (Offline, etc.)

  1. Get macOS archive from GitHub Releases (Apple Silicon: aarch64, Intel Mac: x86_64).
  2. Extract, rename executable to codex, and place in PATH (e.g., /usr/local/bin).

Authentication#

Sign in with ChatGPT (Most Common)

codex
# Follow prompts to select "Sign in with ChatGPT"

Uses your ChatGPT plan (Plus/Pro/Team/Edu/Enterprise) quota directly. Limits described below.

Using OpenAI API Key

export OPENAI_API_KEY="YOUR_API_KEY"

Launch#

# Launch command
codex

# Non-interactive mode
codex exec -p "Summarize README in Japanese"

Model and execution settings can be configured in ~/.codex/config.toml.


Update & Uninstall#

# brew
brew upgrade codex      # Update
brew uninstall codex    # Uninstall

# npm
npm update -g @openai/codex    # Update
npm uninstall -g @openai/codex # Uninstall

Troubleshooting#

“command not found: codex”

  • Brew: brew doctorbrew reinstall codex

  • npm: Check if npm prefix -g is in PATH. Example:

    echo 'export PATH="$(npm prefix -g)/bin:$PATH"' >> ~/.zshrc
    source ~/.zshrc

Usage Limits#

According to Codex usage limits, Plus users can send 30-150 messages per 5 hours, Pro users 300-1,500. Weekly limits also exist but amounts aren’t specified.

codex /status

Use this command to check your current limits.

Codex CLI Installation Guide for Mac - 3 Methods
https://naonao-na.com/en/posts/codex-cli-install-mac/
Author
[object Object]
Published at
2025-10-13