An existing standalone Codex CLI installation can lag behind OpenAI's current release. Its built-in updater downloads the newer standalone package so the codex command can run the updated CLI.
OpenAI's standalone installer supports Linux and macOS. An installation managed by Homebrew or npm has its own package-manager update path, so the installation method determines which updater to use.
The executable chosen by PATH matters when several installations coexist. An update can finish successfully while another copy still answers in the terminal, making the executable path as important as the release number.
Steps to update Codex CLI:
- Locate the standalone Codex CLI executable in your current shell.
$ command -v codex /home/user/.local/bin/codex
The default standalone installer places codex in ~/.local/bin, so the home-directory portion varies. A shell alias, function, or path belonging to another installation needs resolving before the standalone update. Homebrew-managed installations use their package manager instead.
Related: How to upgrade Codex CLI with Homebrew - Record the installed Codex CLI release before updating.
$ codex --version codex-cli 0.164.0
- Run the built-in updater as the user who owns the standalone installation.
The update replaces the installed program with the latest release. It does not provide a rollback command; a return to an older release requires a separate installation of that release.
$ codex update ##### snipped ##### ==> Updating Codex CLI from 0.164.0 to 0.167.2 ##### snipped ##### Codex CLI 0.167.2 installed successfully. 🎉 Update ran successfully! Please restart Codex.
The updater invokes OpenAI's standalone installer and needs network access to download the release. If a Codex session is already open, restart it before continuing work with the new version. If the updater cannot run, OpenAI also documents rerunning the standalone installer to update the CLI.
- Confirm that your shell still resolves the same Codex CLI executable path.
$ command -v codex /home/user/.local/bin/codex
A different path can select another installation even after the standalone package was updated.
- Verify that the active Codex CLI reports the release installed by the updater. Example output:
$ codex --version codex-cli 0.167.2
The release must match the updater's installed version and be newer than the recorded starting version when an update was available. The available update determines the release number.