Upgrading Codex CLI with Homebrew replaces the local codex command with the current packaged release so terminal sessions keep using the latest CLI behavior and fixes from OpenAI.

The current OpenAI Codex CLI documentation lists Homebrew as a supported package manager and uses brew upgrade codex as the upgrade command. Homebrew tracks the installed codex package and updates the binary in place when a newer release is available.

If the installed release is already current, Homebrew reports that no upgrade is needed and leaves the existing binary in place. Systems that previously used direct API-key login can still upgrade with Homebrew first, then refresh the local login state separately if the goal is to switch to ChatGPT-plan access.

Steps to upgrade Codex CLI with Homebrew:

  1. Open a terminal session that uses the same Homebrew installation as the current codex command.
  2. Run the Homebrew upgrade command for Codex CLI.
    $ brew upgrade codex
    Warning: Not upgrading codex, the latest version is already installed

    When a newer release is available, Homebrew downloads the updated package and replaces the installed codex binary instead of printing the already-installed message.

  3. Check the installed Codex CLI version after the package action finishes.
    $ codex --version
    codex-cli 0.121.0

    This confirms which codex build the current shell will run after the upgrade.

  4. Launch Codex after the upgrade if the refreshed binary needs a new sign-in or a login migration.
    $ codex

    If the earlier setup used direct API-key access and the next run needs to switch to ChatGPT-plan access, run codex logout before starting codex again. Related: How to log in to Codex with an API key
    Related: How to log in to Codex with device authentication