Installing the Codex CLI through Homebrew keeps the command-line tool easy to maintain on macOS while avoiding manual downloads. A package-managed install reduces drift between machines and makes upgrades predictable when scripting or troubleshooting.

Homebrew distributes software through formulae and casks. The codex cask fetches the release artifact, installs it under the Homebrew prefix, and links the executable into the shell PATH so codex runs like any other terminal command.

A working Homebrew setup is required, including a Homebrew prefix that matches the Mac architecture (/opt/homebrew on Apple Silicon, /usr/local on Intel). The installation downloads content from the network and may prompt for a password if directory creation or permission changes require elevated privileges.

Steps to install Codex CLI with Homebrew:

  1. Open a terminal on macOS.
    $ sw_vers -productVersion
    14.6
  2. Refresh Homebrew metadata to use the latest cask definition.
    $ brew update
    Updated 2 taps (homebrew/core, homebrew/cask).
    ##### snipped #####
  3. Install the Codex cask with Homebrew.
    $ brew install --cask codex
    ==> Installing Cask codex
    ##### snipped #####
  4. Confirm the cask is registered as installed.
    $ brew list --cask codex
    codex
  5. Confirm the codex binary is available on the shell PATH.
    $ command -v codex
    /opt/homebrew/bin/codex

    Apple Silicon Homebrew paths typically start with /opt/homebrew, while Intel Macs commonly use /usr/local.

  6. Confirm the installed Codex version.
    $ codex --version
    codex-cli 0.87.0

    Version output varies by release and Homebrew update timing.