Add Provider/Model Options to Run Command
Hello - It would be really useful if Goose had the ability to:
- Specify the model / provider on the command line in the
runschema - Ignore ENV vars when set explicitly like this
Here's an example from the docs of how to use run:
goose run -t "Initialize project"
I would like to run like this (for instance)
goose run -t "Initialize project" \
--provider openai \
--model gpt-4.1
This would be really useful in certain cases where I have saved recipes/instruction files that have different provider/model requirements. For instance, the task that generates a commit message can run with gemini-2.5-flash just fine but there are other recipes/saved instructions which need more firepower.
- [x] I have verified this does not duplicate an existing feature request
ran into similar case would really like to have a way to select models!
I've created a similar ticket focused on recipe's. https://github.com/block/goose/issues/2506
I'm gonna take a stab at this because this would be super useful for me
OK submitted a PR for this. One note that it should implement the following priority logic for selecting LLM
- CLI arguments (--provider, --model) - HIGHEST PRIORITY
- Session settings
- Environment variables (GOOSE_PROVIDER, GOOSE_MODEL) - LOWEST PRIORITY
@angiejones if there is someone I should assign the PR to, let me know! thank you so much
Thank you so much for reviewing the PR so quickly!!