You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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 update command (update appears more consistent to me with the rest of the codebase than upgrade) 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 in tui/src/update_action.rs that determines how Codex CLI was installed by checking the environment variables. It can be exposed to add something similar to codex-rs/cli/src/main.rs:
Some(Subcommand::Update) => {#[cfg(not(debug_assertions))]{matchget_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);}}
Would be nice to have something like rustup or tiup. So user can do oai install codex / codex-ui without npm or 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
+1 For this, what is the reason we have to run codex to 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 codex again after
A command like codex update / codex upgrade would make this take 2-3 steps max while being more streamlined. Ideally I would just appreciate on launch displaying options like Update or Continue before 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 codex alias 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.)
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/codex feels more like a geeks only gatekeeper mode than anything else.
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).
Activity
itstrivial commentedon Jan 15, 2026
I’d like to take this one. Could you please assign it to me?
etraut-openai commentedon Jan 15, 2026
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.
itstrivial commentedon Jan 15, 2026
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!
not-an-llm commentedon Feb 6, 2026
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".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.codex updatecommand for one-step self-update #11169 as a duplicate of this issue0xdeafbeef commentedon Feb 15, 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 codex
m3ac-AllbrittenJ commentedon Mar 5, 2026
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
nvictor commentedon Mar 6, 2026
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.
DysektAI commentedon Apr 22, 2026
+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.tonydehnke commentedon Apr 28, 2026
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.Add `codex update` command (#19933)
etraut-openai commentedon Apr 28, 2026
I've added
codex update. This will be included in the next release.killtux commentedon May 6, 2026
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).
Add `codex update` command (openai#19933)
Add `codex update` command (openai#19933)