[cli] Add --provider and --model CLI options to run command (#3295)
Signed-off-by: Tom Hayden <thayden@gmail.com>
This commit is contained in:
@@ -546,6 +546,24 @@ enum Command {
|
||||
action = clap::ArgAction::Append
|
||||
)]
|
||||
additional_sub_recipes: Vec<String>,
|
||||
|
||||
/// Provider to use for this run (overrides environment variable)
|
||||
#[arg(
|
||||
long = "provider",
|
||||
value_name = "PROVIDER",
|
||||
help = "Specify the LLM provider to use (e.g., 'openai', 'anthropic')",
|
||||
long_help = "Override the GOOSE_PROVIDER environment variable for this run. Available providers include openai, anthropic, ollama, databricks, gemini-cli, claude-code, and others."
|
||||
)]
|
||||
provider: Option<String>,
|
||||
|
||||
/// Model to use for this run (overrides environment variable)
|
||||
#[arg(
|
||||
long = "model",
|
||||
value_name = "MODEL",
|
||||
help = "Specify the model to use (e.g., 'gpt-4o', 'claude-3.5-sonnet')",
|
||||
long_help = "Override the GOOSE_MODEL environment variable for this run. The model must be supported by the specified provider."
|
||||
)]
|
||||
model: Option<String>,
|
||||
},
|
||||
|
||||
/// Recipe utilities for validation and deeplinking
|
||||
@@ -700,6 +718,8 @@ pub async fn cli() -> Result<()> {
|
||||
extensions_override: None,
|
||||
additional_system_prompt: None,
|
||||
settings: None,
|
||||
provider: None,
|
||||
model: None,
|
||||
debug,
|
||||
max_tool_repetitions,
|
||||
max_turns,
|
||||
@@ -761,6 +781,8 @@ pub async fn cli() -> Result<()> {
|
||||
scheduled_job_id,
|
||||
quiet,
|
||||
additional_sub_recipes,
|
||||
provider,
|
||||
model,
|
||||
}) => {
|
||||
let (input_config, session_settings, sub_recipes, final_output_response) = match (
|
||||
instructions,
|
||||
@@ -845,6 +867,8 @@ pub async fn cli() -> Result<()> {
|
||||
extensions_override: input_config.extensions_override,
|
||||
additional_system_prompt: input_config.additional_system_prompt,
|
||||
settings: session_settings,
|
||||
provider,
|
||||
model,
|
||||
debug,
|
||||
max_tool_repetitions,
|
||||
max_turns,
|
||||
@@ -970,6 +994,8 @@ pub async fn cli() -> Result<()> {
|
||||
extensions_override: None,
|
||||
additional_system_prompt: None,
|
||||
settings: None::<SessionSettings>,
|
||||
provider: None,
|
||||
model: None,
|
||||
debug: false,
|
||||
max_tool_repetitions: None,
|
||||
max_turns: None,
|
||||
|
||||
Reference in New Issue
Block a user