From 6d3c506401bc96c87faa757ca74b8d28fb0c6074 Mon Sep 17 00:00:00 2001 From: Sai Karthik Date: Mon, 12 Jan 2026 17:56:46 +0530 Subject: [PATCH] fix(cli): incorrect bin name in shell completions Closes #6432 Signed-off-by: Sai Karthik --- crates/goose-cli/src/cli.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/goose-cli/src/cli.rs b/crates/goose-cli/src/cli.rs index 643f9277ff8f..62d1e55e985e 100644 --- a/crates/goose-cli/src/cli.rs +++ b/crates/goose-cli/src/cli.rs @@ -854,6 +854,9 @@ enum Command { Completion { #[arg(value_enum)] shell: ClapShell, + + #[arg(long, default_value = "goose", help = "Provide a custom binary name")] + bin_name: String, }, } @@ -1438,9 +1441,8 @@ pub async fn cli() -> anyhow::Result<()> { ); match cli.command { - Some(Command::Completion { shell }) => { + Some(Command::Completion { shell, bin_name }) => { let mut cmd = Cli::command(); - let bin_name = cmd.get_name().to_string(); generate(shell, &mut cmd, bin_name, &mut std::io::stdout()); Ok(()) }