From 268267b59e9c3c6ce91849f76cec9c41ded26fc9 Mon Sep 17 00:00:00 2001 From: Michael Bolin Date: Wed, 9 Jul 2025 14:08:35 -0700 Subject: [PATCH] fix: the `completion` subcommand should assume the CLI is named `codex`, not `codex-cli` (#1496) Current 0.4.0 release: ``` ~/code/codex2/codex-rs$ codex completion | head _codex-cli() { local i cur prev opts cmd COMPREPLY=() if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then cur="$2" else cur="${COMP_WORDS[COMP_CWORD]}" fi prev="$3" cmd="" ``` with this change: ``` ~/code/codex2/codex-rs$ just codex completion | head cargo run --bin codex -- "$@" Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.82s Running `target/debug/codex completion` _codex() { local i cur prev opts cmd COMPREPLY=() if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then cur="$2" else cur="${COMP_WORDS[COMP_CWORD]}" fi prev="$3" cmd="" ``` --- codex-rs/cli/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codex-rs/cli/src/main.rs b/codex-rs/cli/src/main.rs index 51a089d4..153af99f 100644 --- a/codex-rs/cli/src/main.rs +++ b/codex-rs/cli/src/main.rs @@ -155,6 +155,6 @@ fn prepend_config_flags( fn print_completion(cmd: CompletionCommand) { let mut app = MultitoolCli::command(); - let name = app.get_name().to_string(); + let name = "codex"; generate(cmd.shell, &mut app, name, &mut std::io::stdout()); }