anomalyco / anomalyco/opencode
[FEATURE]: Interactive custom provider registration flow in /connect command palette
@kommander is already working on this.
Since Sep 15, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Feature hasn't been suggested before.
- I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
Add a complete, interactive provider registration flow in the TUI /connect command palette that lets users register any OpenAI-compatible provider end-to-end — entering an endpoint URL, optional API key, auto-discovering available models, and selecting which models to enable — all without manually editing opencode.jsonc.
Motivation
OpenCode has many built-in providers, but users frequently need to add self-hosted models (Ollama, vLLM, LocalAI), third-party platforms (DeepSeek, Qwen, Kimi), or corporate API gateways. Currently this requires manually editing opencode.jsonc with the correct npm package name, schema, and model capabilities — which is error-prone and not discoverable.
Proposed Flow
Step 1 — Endpoint
Provider endpoint URL: https://api.deepseek.com/v1
- Accept any URL (local or remote)
- Validate the URL is reachable
Step 2 — API Key (optional)
API key (leave empty for no auth): ****
- Optional because local providers (Ollama, LocalAI) typically don't need a key
- Some platforms return different model lists based on whether a key is provided
Step 3 — Auto-fetch Models
After entering endpoint + key, call the provider's /v1/models endpoint to discover available models:
Fetching models from https://api.deepseek.com/v1/models ...
Available models:
[x] deepseek-chat (context: 64000, output: 8000)
[x] deepseek-reasoner (context: 64000, output: 8000)
[ ] deepseek-v3 (context: 128000, output: 16000)
Select models to enable (space to toggle, enter to confirm):
- Pre-select all models, let user deselect unwanted ones
- Show model name and basic info when available
- Fall back to manual model name input if
/v1/modelsis not supported
Step 4 — Confirm & Save
Provider: deepseek
Endpoint: https://api.deepseek.com/v1
Models: deepseek-chat, deepseek-reasoner
Save to: [Global ~/.config/opencode/opencode.jsonc] / [Project .opencode/opencode.jsonc]
Confirm? (y/n)
Expected Config Output
{
"providers": {
"deepseek": {
"npm": "@ai-sdk/openai-compatible",
"options": {
"apiKey": "sk-xxx",
"baseURL": "https://api.deepseek.com/v1"
},
"models": {
"deepseek-chat": {
"name": "deepseek-chat",
"tool_call": true,
"limit": { "context": 64000, "output": 8000 }
}
}
}
}
}
Relationship to Existing Issues
This request builds on and unifies several related issues:
- #44450 — Requests a URL textbox in
/connectfor custom connectors (Step 1) - #6231 — Requests auto-discovery of models from OpenAI-compatible endpoints (Step 3)
- #33704 — Requests GUI options to edit custom providers and manage model lists
This proposal differs by providing a single, cohesive, step-by-step interactive flow in the TUI that covers the full lifecycle (endpoint → auth → model discovery → config generation → save), rather than isolated pieces. Ideally this could serve as the implementation plan that ties those three issues together.
Technical Notes
- The
/v1/modelsendpoint is part of the OpenAI API spec and supported by most compatible providers - The config should use
@ai-sdk/openai-compatibleas the default adapter, with future support for other adapters (@ai-sdk/anthropic,@ai-sdk/google) if the endpoint is detected - Consider supporting both global and project-level config save locations
Environment
- opencode version: 2.0.3
- OS: Windows_NT 10.0.26200 (win32 x64)
- Terminal: TUI mode
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.