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.
Related: How to install Codex CLI with Homebrew
Related: How to check Codex CLI version
Steps to upgrade Codex CLI with Homebrew:
- Open a terminal session that uses the same Homebrew installation as the current codex command.
- 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.
- 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.
Related: How to check Codex CLI version
- 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
Mohd Shakir Zakaria is a cloud architect with deep roots in software development and open-source advocacy. Certified in AWS, Red Hat, VMware, ITIL, and Linux, he specializes in designing and managing robust cloud and on-premises infrastructures.
