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 with | Update command |
|---|---|
| Any method | codex update |
| npm | npm install -g @openai/codex@latest |
| Homebrew cask | brew 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.
Confirm the Update Worked
codex --version
which -a codex
codex doctor --summary
codex --versionshould show the new number.which -a codexlists everycodexon 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 doctordiagnoses installation, config, auth and runtime health.--summaryprints grouped check rows, and--jsonemits 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
unable to locate the Codex CLI binary: see the fix.- Native package download errors: see could not find Codex package in npm release assets.
codex: command not foundafter an install: open a new terminal so your PATH refreshes.