Awesome-omni-skill opencode-config
Use when configuring OpenCode CLI - changing default model, adding providers, setting baseURL, or troubleshooting model selection issues
install
source · Clone the upstream repo
git clone https://github.com/diegosouzapw/awesome-omni-skill
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/diegosouzapw/awesome-omni-skill "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/tools/opencode-config" ~/.claude/skills/diegosouzapw-awesome-omni-skill-opencode-config && rm -rf "$T"
manifest:
skills/tools/opencode-config/SKILL.mdsource content
OpenCode Configuration
Overview
OpenCode config is managed via
opencode.json. Configs merge by priority: project > global > remote.
Config Locations
| Location | Path | Priority |
|---|---|---|
| Project | | Highest |
| Global | | Medium |
| Auth | | Credentials only |
Quick Reference
{ "$schema": "https://opencode.ai/config.json", "model": "provider/model-name", "small_model": "provider/small-model", "provider": { "provider-id": { "options": { "baseURL": "https://api.example.com/v1" } } } }
Adding Custom Provider
For OpenAI-compatible APIs:
{ "provider": { "my-provider": { "npm": "@ai-sdk/openai-compatible", "name": "Display Name", "options": { "baseURL": "https://api.example.com/v1" }, "models": { "model-id": { "name": "Model Display Name" } } } } }
Example: Z.AI Coding Plan
Different Z.AI products use different baseURLs:
| Provider | baseURL | Use Case |
|---|---|---|
| | Regular Z.AI API |
| | GLM Coding Plan subscription |
Config for Coding Plan:
{ "$schema": "https://opencode.ai/config.json", "model": "zai-coding-plan/glm-4.7", "small_model": "zai-coding-plan/glm-4-flash", "provider": { "zai-coding-plan": { "options": { "baseURL": "https://api.z.ai/api/coding/paas/v4" } } } }
Modes Configuration
{ "mode": { "build": { "model": "anthropic/claude-sonnet-4-5", "tools": { "write": true, "edit": true, "bash": true } }, "plan": { "model": "anthropic/claude-haiku-4-5", "tools": { "write": false, "edit": false, "bash": false } } } }
CLI Commands
| Command | Description |
|---|---|
| Add provider credentials |
| Select model |
| Add credentials via CLI |
| List configured providers |
Common Mistakes
| Mistake | Fix |
|---|---|
| Wrong provider for subscription | Check if your subscription uses different baseURL |
| Missing baseURL for custom provider | Add in provider config |
Model not appearing in | Check auth.json has credentials for provider |
| Wrong model after config change | Restart OpenCode to reload config |
Troubleshooting
- Check auth:
cat ~/.local/share/opencode/auth.json - Check config:
cat ~/.config/opencode/opencode.json - Verify model format:
provider-id/model-name - Test provider: Run
and check if provider appears/models