Skip to main content
OpenAIbeginner

Update Codex CLI: codex update, npm and Homebrew

Update Codex CLI with codex update, npm, Homebrew or the install script, check your version, and run codex doctor if the update does not stick.

5 min readUpdated October 2026

To update Codex CLI, run:

codex update

The CLI's own help describes it as "Update Codex to the latest version." If that does not move you to the newest release, update with the same tool you installed with. Check which one that is first.

Check Your Version

codex --version

This prints a line like codex-cli 0.x.y. Codex ships frequently, and some documented features only exist in recent versions, so it is worth checking before you debug a missing flag.

Update by Install Method

You installed withUpdate command
Any methodcodex update
npmnpm install -g @openai/codex@latest
Homebrew caskbrew upgrade --cask codex
Standalone script (macOS, Linux)curl -fsSL https://chatgpt.com/codex/install.sh | sh
Standalone script (Windows)powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex"

The install commands are from the official Codex README. The Homebrew upgrade line is standard Homebrew cask behaviour and not something OpenAI documents separately.

How codex update behaves for each install method has not been confirmed for this page. If it fails or reports nothing, use the package-manager command from the table.

npm

npm install -g @openai/codex@latest

Avoid sudo. If you get EACCES, see npm EACCES permission denied installing Codex.

Homebrew

brew upgrade --cask codex

Install script

Rerun the install command from the table. Per OpenAI's README, the installers download from releases.openai.com/codex by default and can be told to use GitHub Releases by setting CODEX_INSTALLER_USE_RELEASES_OPENAI_COM=false.

Advertisement

Confirm the Update Worked

codex --version
which -a codex
codex doctor --summary
  • codex --version should show the new number.
  • which -a codex lists every codex on your PATH. More than one means an older copy can shadow the new one; uninstall the stale install with the tool that created it.
  • codex doctor diagnoses installation, config, auth and runtime health. --summary prints grouped check rows, and --json emits a redacted report.

Does Updating Reset My Login or Config?

No. Your configuration and credentials live in ~/.codex (config.toml, auth.json), and updating replaces the program only. auth.json holds your credentials, so never share it or commit it to a repository. Confirm with:

codex login status

If a new version complains about your config, the most common cause is a retired setting such as approval_policy = "untrusted"; see Codex sandbox and approval modes.

When Codex Will Not Start After Updating

Next Steps

Frequently Asked Questions

Find answers to common questions

Run codex update. The CLI's own help describes it as updating Codex to the latest version. You can also update with the tool you installed with: npm install -g @openai/codex@latest for npm, brew upgrade --cask codex for Homebrew, or rerun the standalone install script.

Run codex --version. It prints a version such as codex-cli 0.x.y. Compare it with the latest release on the openai/codex GitHub releases page.

The CLI help only says it updates Codex to the latest version, and OpenAI's docs do not describe how it behaves per install method. If codex update does nothing useful, update with your package manager directly.

Run npm install -g @openai/codex@latest. Do not use sudo; if you hit EACCES errors, fix your npm prefix instead.

Codex is a Homebrew cask, so run brew upgrade --cask codex. Homebrew lists the cask as codex.

OpenAI's docs list the same command for updating as for installing: curl -fsSL https://chatgpt.com/codex/install.sh | sh on macOS and Linux.

Run codex doctor. The CLI describes it as diagnosing local Codex installation, config, auth and runtime health. Add --summary for grouped check rows or --json for a redacted machine-readable report.

You probably have two installs, for example one from npm and one from Homebrew, and the older one comes first on your PATH. Run which -a codex to list them and remove the one you do not want.

Updating replaces the program, not your files in ~/.codex, where config.toml and auth.json live. You stay signed in. Run codex login status to confirm.