Added cmd to validate bundled extensions json (#7217)
This commit is contained in:
@@ -863,6 +863,16 @@ enum Command {
|
||||
#[arg(long, default_value = "goose", help = "Provide a custom binary name")]
|
||||
bin_name: String,
|
||||
},
|
||||
|
||||
#[command(
|
||||
name = "validate-extensions",
|
||||
about = "Validate a bundled-extensions.json file",
|
||||
hide = true
|
||||
)]
|
||||
ValidateExtensions {
|
||||
#[arg(help = "Path to the bundled-extensions.json file")]
|
||||
file: PathBuf,
|
||||
},
|
||||
}
|
||||
|
||||
#[derive(Subcommand)]
|
||||
@@ -955,6 +965,7 @@ fn get_command_name(command: &Option<Command>) -> &'static str {
|
||||
Some(Command::Web { .. }) => "web",
|
||||
Some(Command::Term { .. }) => "term",
|
||||
Some(Command::Completion { .. }) => "completion",
|
||||
Some(Command::ValidateExtensions { .. }) => "validate-extensions",
|
||||
None => "default_session",
|
||||
}
|
||||
}
|
||||
@@ -1519,6 +1530,19 @@ pub async fn cli() -> anyhow::Result<()> {
|
||||
no_auth,
|
||||
}) => crate::commands::web::handle_web(port, host, open, auth_token, no_auth).await,
|
||||
Some(Command::Term { command }) => handle_term_subcommand(command).await,
|
||||
Some(Command::ValidateExtensions { file }) => {
|
||||
use goose::agents::validate_extensions::validate_bundled_extensions;
|
||||
match validate_bundled_extensions(&file) {
|
||||
Ok(msg) => {
|
||||
println!("{msg}");
|
||||
Ok(())
|
||||
}
|
||||
Err(e) => {
|
||||
eprintln!("{e}");
|
||||
std::process::exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
None => handle_default_session().await,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user