feat: Add command goose update to update goose CLI version (#1308)

Co-authored-by: Alex Hancock <alexhancock@block.xyz>
This commit is contained in:
Yiming Zhang
2025-02-27 04:02:30 +08:00
committed by GitHub
parent fd3ebeebed
commit 26348a695d
4 changed files with 67 additions and 3 deletions

View File

@@ -157,6 +157,23 @@ enum Command {
/// List available agent versions
Agents(AgentCommand),
/// Update the Goose CLI version
#[command(about = "Update the goose CLI version")]
Update {
/// Update to canary version
#[arg(
short,
long,
help = "Update to canary version",
long_help = "Update to the latest canary version of the goose CLI, otherwise updates to the latest stable version."
)]
canary: bool,
/// Enforce to re-configure Goose during update
#[arg(short, long, help = "Enforce to re-configure goose during update")]
reconfigure: bool,
},
}
#[derive(clap::ValueEnum, Clone, Debug)]
@@ -234,6 +251,13 @@ async fn main() -> Result<()> {
cmd.run()?;
return Ok(());
}
Some(Command::Update {
canary,
reconfigure,
}) => {
goose_cli::commands::update::update(canary, reconfigure)?;
return Ok(());
}
None => {
Cli::command().print_help()?;
println!();