From 02f56a0a820ef0ead1e33607b39832eb4470b98a Mon Sep 17 00:00:00 2001 From: Sai Karthik <11899221+kskarthik@users.noreply.github.com> Date: Tue, 16 Dec 2025 08:38:59 +0530 Subject: [PATCH] feat(goose-cli): add feature to disable update (#5886) Signed-off-by: Sai Karthik --- crates/goose-cli/Cargo.toml | 3 +++ crates/goose-cli/src/commands/update.rs | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/crates/goose-cli/Cargo.toml b/crates/goose-cli/Cargo.toml index 6f573d97eb..2320527942 100644 --- a/crates/goose-cli/Cargo.toml +++ b/crates/goose-cli/Cargo.toml @@ -64,6 +64,9 @@ urlencoding = "2.1" [target.'cfg(target_os = "windows")'.dependencies] winapi = { version = "0.3", features = ["wincred"] } +[features] +# disables the update command +disable-update = [] [dev-dependencies] tempfile = "3" diff --git a/crates/goose-cli/src/commands/update.rs b/crates/goose-cli/src/commands/update.rs index 4ee520323b..0b2db399bd 100644 --- a/crates/goose-cli/src/commands/update.rs +++ b/crates/goose-cli/src/commands/update.rs @@ -1,11 +1,14 @@ -use std::process::Command; - use anyhow::Result; +use std::process::Command; const DOWNLOAD_SCRIPT_URL: &str = "https://github.com/block/goose/releases/download/stable/download_cli.sh"; pub fn update(canary: bool, reconfigure: bool) -> Result<()> { + if cfg!(feature = "disable-update") { + anyhow::bail!("This command is disabled"); + }; + // Get the download script from github let curl_output = Command::new("curl") .arg("-fsSL")