Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions crates/goose-cli/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,12 @@ pub struct ExtensionOptions {
value_delimiter = ','
)]
pub builtins: Vec<String>,

#[arg(
long = "no-profile",
help = "Don't load your default extensions, only use CLI-specified extensions"
)]
pub no_profile: bool,
}

/// Input source and recipe options for the run command
Expand Down Expand Up @@ -1156,6 +1162,7 @@ async fn handle_interactive_session(
extensions: extension_opts.extensions,
streamable_http_extensions: extension_opts.streamable_http_extensions,
builtins: extension_opts.builtins,
no_profile: extension_opts.no_profile,
recipe: None,
additional_system_prompt: None,
provider: None,
Expand Down Expand Up @@ -1360,6 +1367,7 @@ async fn handle_run_command(
extensions: extension_opts.extensions,
streamable_http_extensions: extension_opts.streamable_http_extensions,
builtins: extension_opts.builtins,
no_profile: extension_opts.no_profile,
recipe: recipe.clone(),
additional_system_prompt: input_config.additional_system_prompt,
provider: model_opts.provider,
Expand Down Expand Up @@ -1486,6 +1494,7 @@ async fn handle_default_session() -> Result<()> {
extensions: Vec::new(),
streamable_http_extensions: Vec::new(),
builtins: Vec::new(),
no_profile: false,
recipe: None,
additional_system_prompt: None,
provider: None,
Expand Down
1 change: 1 addition & 0 deletions crates/goose-cli/src/commands/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ pub async fn agent_generator(
extensions: requirements.external,
streamable_http_extensions,
builtins: requirements.builtin,
no_profile: true,
recipe: None,
additional_system_prompt: None,
provider: None,
Expand Down
6 changes: 6 additions & 0 deletions crates/goose-cli/src/session/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ pub struct SessionBuilderConfig {
pub streamable_http_extensions: Vec<StreamableHttpOptions>,
/// List of builtin extension commands to add
pub builtins: Vec<String>,
pub no_profile: bool,
/// Recipe for the session
pub recipe: Option<Recipe>,
/// Any additional system prompt to append to the default
Expand Down Expand Up @@ -130,6 +131,7 @@ impl Default for SessionBuilderConfig {
extensions: Vec::new(),
streamable_http_extensions: Vec::new(),
builtins: Vec::new(),
no_profile: false,
recipe: None,
additional_system_prompt: None,
provider: None,
Expand Down Expand Up @@ -529,6 +531,8 @@ pub async fn build_session(session_config: SessionBuilderConfig) -> CliSession {
.and_then(|s| EnabledExtensionsState::from_extension_data(&s.extension_data))
.map(|state| state.extensions)
.unwrap_or_else(get_enabled_extensions)
} else if session_config.no_profile {
Vec::new()
} else {
resolve_extensions_for_new_session(recipe.and_then(|r| r.extensions.as_deref()), None)
};
Expand Down Expand Up @@ -636,6 +640,7 @@ mod tests {
timeout: goose::config::DEFAULT_EXTENSION_TIMEOUT,
}],
builtins: vec!["developer".to_string()],
no_profile: false,
recipe: None,
additional_system_prompt: Some("Test prompt".to_string()),
provider: None,
Expand Down Expand Up @@ -671,6 +676,7 @@ mod tests {
assert!(config.extensions.is_empty());
assert!(config.streamable_http_extensions.is_empty());
assert!(config.builtins.is_empty());
assert!(!config.no_profile);
assert!(config.recipe.is_none());
assert!(config.additional_system_prompt.is_none());
assert!(!config.debug);
Expand Down
Loading