Problem (one or two sentences)
The Roo Code CLI only supports five hard-coded providers — Anthropic, OpenAI, Gemini, OpenRouter, and Vercel AI Gateway — even though the full Roo Code app supports ~35. Users who already hold direct credentials for DeepSeek, Mistral, xAI, Qwen, and others cannot use them from the CLI, forcing them through OpenRouter or off the CLI entirely.
Context (who is affected and when)
Automation-focused developers and CLI-first users who have API keys for a provider that is not in the CLI's shortlist. This bites immediately when someone runs roo --provider deepseek ... (rejected as invalid) or wants to point an OpenAI-compatible client at their own endpoint.
Desired behavior (conceptual, not technical)
The CLI should accept every provider the main app supports, and let users supply that provider's API key, model, and (where relevant) endpoint — without the CLI maintaining its own separate provider list.
Constraints / preferences
- No duplicated provider definitions; reuse the single source of truth already in the shared types package.
- Keep the existing flags ergonomic:
--provider, --api-key, -m/--model; add a --base-url for providers whose endpoint differs.
- The existing five providers must keep working unchanged.
Request checklist
Acceptance criteria
Given a built CLI:
- When I run
roo --provider deepseek -m deepseek-chat --base-url https://api.deepseek.com -k sk-... "hello", then the CLI targets DeepSeek's API directly (no OpenRouter).
- When I run
roo --provider <any provider known to the main app>, then it is accepted without a hard-coded allowlist.
- When I use the existing five providers, then behavior is unchanged.
- But when I pass an unknown provider id, then the CLI still rejects it with a clear error listing valid values.
Proposed approach
Replace the CLI's hand-maintained supportedProviders, envVarMap, and the getProviderSettings switch with the shared registry (providerNames, isProviderName, providerDefinitionList) from @roo-code/types. For the active provider, populate its own settings fields (API key, base URL, model id) from its settingsShape, and add an optional --base-url flag that writes to that provider's base-URL field. Optionally attach envVar/defaultBaseUrl metadata to ProviderDefinition so env-var lookup is also data-driven.
Trade-offs / risks
- A few providers require extra inputs beyond key/model/base URL (e.g. Kimi Code auth method, OpenAI Codex service tier, Z.AI API line); these can be opt-in flags rather than fully generic.
- Dynamic providers normally fetch remote model lists; the CLI's
-m pass-through sidesteps that but may accept model ids the endpoint rejects.
- Extending the shared
ProviderDefinition type touches the VS Code extension too, so any new fields must be optional/additive.
Problem (one or two sentences)
The Roo Code CLI only supports five hard-coded providers — Anthropic, OpenAI, Gemini, OpenRouter, and Vercel AI Gateway — even though the full Roo Code app supports ~35. Users who already hold direct credentials for DeepSeek, Mistral, xAI, Qwen, and others cannot use them from the CLI, forcing them through OpenRouter or off the CLI entirely.
Context (who is affected and when)
Automation-focused developers and CLI-first users who have API keys for a provider that is not in the CLI's shortlist. This bites immediately when someone runs
roo --provider deepseek ...(rejected as invalid) or wants to point an OpenAI-compatible client at their own endpoint.Desired behavior (conceptual, not technical)
The CLI should accept every provider the main app supports, and let users supply that provider's API key, model, and (where relevant) endpoint — without the CLI maintaining its own separate provider list.
Constraints / preferences
--provider,--api-key,-m/--model; add a--base-urlfor providers whose endpoint differs.Request checklist
Acceptance criteria
Given a built CLI:
roo --provider deepseek -m deepseek-chat --base-url https://api.deepseek.com -k sk-... "hello", then the CLI targets DeepSeek's API directly (no OpenRouter).roo --provider <any provider known to the main app>, then it is accepted without a hard-coded allowlist.Proposed approach
Replace the CLI's hand-maintained
supportedProviders,envVarMap, and thegetProviderSettingsswitch with the shared registry (providerNames,isProviderName,providerDefinitionList) from@roo-code/types. For the active provider, populate its own settings fields (API key, base URL, model id) from itssettingsShape, and add an optional--base-urlflag that writes to that provider's base-URL field. Optionally attachenvVar/defaultBaseUrlmetadata toProviderDefinitionso env-var lookup is also data-driven.Trade-offs / risks
-mpass-through sidesteps that but may accept model ids the endpoint rejects.ProviderDefinitiontype touches the VS Code extension too, so any new fields must be optional/additive.