Add codex update command (#19933)

## Why

Addresses #9274

Running `codex update` currently starts an interactive Codex session
with `update` as the prompt. That is a rough edge for users who expect a
direct self-update command after seeing the existing update notice, and
it forces them to copy the suggested package-manager command manually.

## What changed

- Added a top-level `codex update` subcommand.
- Reused the existing install-channel detection and update command
runner that the TUI already uses for update prompts.
- Exposed the update-action lookup from `codex-tui` so the CLI can
invoke the same behavior.
- Added CLI coverage to ensure `codex update` is parsed as a subcommand
instead of becoming an interactive prompt.

## Verification

- `cargo test -p codex-cli`
- `cargo test -p codex-tui update_action::tests`
This commit is contained in:
Eric Traut
2026-04-27 23:33:59 -07:00
committed by GitHub
parent 0a32c8b396
commit b985768dc1
5 changed files with 64 additions and 2 deletions

View File

@@ -30,7 +30,7 @@ async fn marketplace_upgrade_no_longer_runs_at_top_level() -> Result<()> {
.args(["marketplace", "upgrade"])
.assert()
.failure()
.stderr(contains("unexpected argument 'upgrade' found"));
.stderr(contains("unrecognized subcommand 'upgrade'"));
Ok(())
}