diff --git a/crates/goose-cli/src/commands/configure.rs b/crates/goose-cli/src/commands/configure.rs index c682724276cd..cef52d9ca764 100644 --- a/crates/goose-cli/src/commands/configure.rs +++ b/crates/goose-cli/src/commands/configure.rs @@ -2005,6 +2005,7 @@ fn collect_custom_headers() -> anyhow::Result anyhow::Result<()> { + let config = Config::global(); let provider_type = cliclack::select("What type of API is this?") .item( "openai_compatible", @@ -2089,7 +2090,7 @@ fn add_provider() -> anyhow::Result<()> { let headers = collect_custom_headers()?; - create_custom_provider(CreateCustomProviderParams { + let provider_config = create_custom_provider(CreateCustomProviderParams { engine: provider_type.to_string(), display_name: display_name.clone(), api_url, @@ -2102,6 +2103,21 @@ fn add_provider() -> anyhow::Result<()> { base_path, })?; + if !provider_config.models.is_empty() { + let model_items: Vec<_> = provider_config + .models + .iter() + .map(|m| (m.name.as_str(), m.name.as_str(), "")) + .collect(); + if let Ok(model) = cliclack::select("Which model should be the default?") + .items(&model_items) + .interact() + { + config.set_goose_provider(&provider_config.name)?; + config.set_goose_model(model)?; + } + } + cliclack::outro(format!("Custom provider added: {}", display_name))?; Ok(()) }