Add `codex upgrade` command for self-updates
Resolved 💬 11 comments Opened Jan 15, 2026 by rafaell-lycan Closed Apr 28, 2026
💡 Likely answer: A maintainer (etraut-openai, contributor)
responded on this thread — see the highlighted reply below.
What feature would you like to see?
Introducing a built-in codex upgrade command to automatically detect the installation method (npm/homebrew) and update Codex CLI to the latest version.
This eliminates the need for users to remember or manually check their install method, similar to OpenCode's streamlined approach.
Additional information
Feature already exists in:
- OpenCode CLI:
opencode upgrade - Claude Code:
claude update
11 Comments
I’d like to take this one. Could you please assign it to me?
Codex CLI already automatically detects when a new version is available and offers to install it for you. I don't know that a separate command is needed here.
I'll leave this feature request open and see if it gathers enough upvotes for us to consider it.
If a separate
codex updatecommand (updateappears more consistent to me with the rest of the codebase thanupgrade) is implemented one day, here are a couple of leads. I only reviewed the codebase very briefly, so please use this at your own risk and consider whether there're better options.Potential Implementation
There's a
pub(crate) fn get_update_action() -> Option<UpdateAction>function intui/src/update_action.rsthat determines how Codex CLI was installed by checking the environment variables. It can be exposed to add something similar tocodex-rs/cli/src/main.rs:Good luck!
It's a small thing, but it is not a great experience to run
codex updateonly to realize this kicks off a convo with a silly one-word prompt "update".<img width="740" height="538" alt="Image" src="https://github.com/user-attachments/assets/65881832-a751-409e-af94-d3aa5fd92e28" />
Then I have to kill it and exit and type the command that's right there then restart.
Other coding agents support a
update|upgradesubcommand. codex does stick out here.Would be nice to have something like rustup or tiup. So user can do
oai install codex / codex-uiwithoutnpmor relying on a system package manager to keep up with the release cadence.Or simple install.sh like in zed with auto-updates driven by codex
commenting to show support/desire for this. I hate node ecosystem and package management. I try to avoid it wherever possible. used the recently introduced install.sh introduced today, but wish for native update command like copilot cli, claude code, and opencode
codex cli is the only standout here that does not support this
Let's call it
updateplease 😊I think it's needed because self-detect and auto-install usually runs into permission issues typically when sandboxing the tool.
+1 For this, what is the reason we have to run
codexto see: "A new version is available run this to install it now:npm install -g @openai/codex" which requires:codexagain afterA command like
codex update/codex upgradewould make this take 2-3 steps max while being more streamlined. Ideally I would just appreciate on launch displaying options likeUpdateorContinuebefore initializing fully... This would make it much less of a chore/process and improve UX especially with the rate of how often updates are released.Just seeing the update notice has sidetrack me into updating leading to killing momentum and forgetting why I needed/opened codex in the first place.
I addressed this by replacing the
codexalias for my system to work like this for now:(Some safeguards setup for potential issues like automatic fallback on failure.)
codexlike normal - just never outdated.Adding support for this.. also less muscle memory for other users coming from other platforms that are used to running "xyz update/upgrade" - so it's a smoother experience.
I don't see any reason not to implement it. In fact not doing so and making people do multiple steps to run:
npm install -g @openai/codexfeels more like a geeks only gatekeeper mode than anything else.I've added
codex update. This will be included in the next release.is it possible when die "update available" menu is display to update with -su instead since most time its run with normal user privileges and update wont be possible without quitting codex and starting it with sudo? (and also get the first-time login screen, quit again, start again and then it updates).