feat: support provider name aliases in -p flag#94
Open
ekg wants to merge 1 commit intomicrosoft:mainfrom
Open
Conversation
Allow providers to have a user-facing `name` field in settings.yaml
that the -p flag matches against before falling back to module name.
This enables more intuitive provider selection when the same module
(e.g., provider-openai) is configured for different services:
providers:
- name: openrouter
module: provider-openai
config:
base_url: https://openrouter.ai/api/v1
amplifier run -p openrouter "hello"
The name match is checked first; if no name matches, the existing
module-based lookup runs as before. Error messages now show both
name and module when available.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
namefield in settings.yaml that-pmatches against before falling back to module nameprovider-openai) serves different backends (OpenAI, OpenRouter, Azure)Example
Change
14 lines in
commands/run.py— name match checked first, then existing module lookup as fallback. Zero impact whennamefield is absent.Test plan
-p openroutermatches provider withname: openrouter-p openaistill works via module fallback (provider-openai)openrouter (openai)format when name is setnamefield is present in settings