Repository navigation
Add codex upgrade command for self-updates #9274
Description
Activity
- addedCLIIssues related to the Codex CLIIssues related to the Codex CLI
on Jan 15, 2026 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.
Reacted by HaraldReacted by Tony Dehnke and DraxiIf 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:Some(Subcommand::Update) => { #[cfg(not(debug_assertions))] { match get_update_action() { Some(action) => { run_update_action(action)?; } None => { eprintln!( "Could not detect installation method. Please update manually: https://developers.openai.com/codex/cli/" ); std::process::exit(1); } } } #[cfg(debug_assertions)] { eprintln!( "The update command is not available in debug builds. Build with --release or install to use this command." ); std::process::exit(1); } }
Good luck!
Reacted by Rafaell LycanIt'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".
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.Reacted by Rafaell Lycan, netwolf1, Dys, Tony Dehnke and David Torbeck- marked Feature request: add
codex updatecommand for one-step self-update #11169 as a duplicate of this issueon Feb 9, 2026 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 codexcommenting 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
Reacted by Tony DehnkeLet'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:- Copying the command
- Exiting codex cli
- Pasting + running
- Just to rerun
codexagain after
A 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:- Check for updates - New version? = Step 2 | Already Latest? = Skip to Step 3.
- Runs the relevant update command - Waits for it to complete successfully.
(Some safeguards setup for potential issues like automatic fallback on failure.) - Runs
codexlike normal - just never outdated.
Reacted by Tony Dehnke and killtuxAdding 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.- added a commit that references this issue
on Apr 28, 2026 I've added
codex update. This will be included in the next release.Reacted by Tony Dehnke, Umaru, David Torbeck, Dys, SuperHQ Developer, Tsetsi Lazarov and Matt Sephtonis 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).
Reacted by wuwenyao- added a commit that references this issue
on May 7, 2026 - added a commit that references this issue
on Jun 27, 2026
What feature would you like to see?
Introducing a built-in
codex upgradecommand 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 upgradeclaude update