Homebrew-managed Codex CLI installs can lag behind the current cask when local package metadata has not been refreshed. Upgrading the Codex cask replaces the binary that the terminal resolves as codex while keeping local Codex login and configuration state separate from the package itself.

OpenAI lists Homebrew as a Codex CLI install option, and Homebrew publishes Codex as the codex cask. Use the cask-specific upgrade command after updating Homebrew so the package manager checks the cask record rather than relying on formula resolution.

If the installed cask is already current, Homebrew reports that no upgrade is needed and leaves the existing binary in place. The upgrade check is complete when the active shell resolves codex from the Homebrew prefix and codex --version prints the release expected for that machine.

Steps to upgrade Codex CLI with Homebrew:

  1. Open a terminal that loads the Homebrew prefix used for Codex.
  2. Update local Homebrew metadata.
    $ brew update
    ==> Updating Homebrew...
    Already up-to-date.
  3. Upgrade the Codex cask.
    $ brew upgrade --cask codex
    Warning: Not upgrading codex, the latest version is already installed

    When a newer cask is available, Homebrew downloads the replacement package and relinks the codex binary instead of printing the already-installed warning.

  4. Confirm that the active shell resolves the Homebrew binary.
    $ command -v codex
    /home/linuxbrew/.linuxbrew/bin/codex

    The path depends on the Homebrew prefix. Common macOS paths are /opt/homebrew/bin/codex and /usr/local/bin/codex.

  5. Check the upgraded Codex CLI version.
    $ codex --version
    codex-cli 0.139.0

    The version number changes as new releases ship.
    Related: How to check Codex CLI version

  6. Start Codex only after the version check points at the intended binary.
    $ codex

    If the session opens with the wrong account or sign-in method, log out and start the intended login flow.
    Related: How to log out of Codex
    Related: How to log in to Codex with device authentication