opencode-config
Use when configuring OpenCode CLI - changing default model, adding providers, setting baseURL, or troubleshooting model selection issues
Best use case
opencode-config is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Use when configuring OpenCode CLI - changing default model, adding providers, setting baseURL, or troubleshooting model selection issues
Teams using opencode-config should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/opencode-config/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How opencode-config Compares
| Feature / Agent | opencode-config | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Use when configuring OpenCode CLI - changing default model, adding providers, setting baseURL, or troubleshooting model selection issues
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# OpenCode Configuration
## Overview
OpenCode config is managed via `opencode.json`. Configs merge by priority: project > global > remote.
## Config Locations
| Location | Path | Priority |
|----------|------|----------|
| Project | `./opencode.json` | Highest |
| Global | `~/.config/opencode/opencode.json` | Medium |
| Auth | `~/.local/share/opencode/auth.json` | Credentials only |
## Quick Reference
```json
{
"$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:
```json
{
"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 |
|----------|---------|----------|
| `zai` | `https://api.z.ai/api/paas/v4` | Regular Z.AI API |
| `zai-coding-plan` | `https://api.z.ai/api/coding/paas/v4` | GLM Coding Plan subscription |
**Config for Coding Plan:**
```json
{
"$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
```json
{
"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 |
|---------|-------------|
| `/connect` | Add provider credentials |
| `/models` | Select model |
| `opencode auth login` | Add credentials via CLI |
| `opencode auth list` | List configured providers |
## Common Mistakes
| Mistake | Fix |
|---------|-----|
| Wrong provider for subscription | Check if your subscription uses different baseURL |
| Missing baseURL for custom provider | Add `options.baseURL` in provider config |
| Model not appearing in `/models` | Check auth.json has credentials for provider |
| Wrong model after config change | Restart OpenCode to reload config |
## Troubleshooting
1. **Check auth:** `cat ~/.local/share/opencode/auth.json`
2. **Check config:** `cat ~/.config/opencode/opencode.json`
3. **Verify model format:** `provider-id/model-name`
4. **Test provider:** Run `/models` and check if provider appearsRelated Skills
writing-opencode-plugins
Guides development of OpenCode plugins including project structure, testing patterns, and publishing. Use when creating or modifying OpenCode plugins.
pylint-configuration
Use when pylint configuration including pylintrc, message control, plugins, and scoring system.
opencode
OpenCode - Open source AI coding agent for terminal, desktop, and IDE with multi-provider LLM support, custom agents, MCP integration, and granular permissions
opencode-docs
OpenCode + OhMyOpenCode configuration reference - agents, tools, MCP, skills, commands, hooks, permissions, providers, and Sisyphus orchestration patterns
moai-tool-opencode
OpenCode.ai open-source AI coding agent comprehensive reference. Use when working with OpenCode TUI, CLI, IDE integration, configuring agents, tools, MCP servers, creating plugins, or developing with the SDK.
configuring-devenv
Initializes and configures devenv development environments. Searches packages, sets up languages, services, scripts, git hooks, and processes. Use when setting up devenv, adding packages to devenv.nix, configuring languages, services, git hooks, or searching for devenv options.
configure
Sets up or edits the plugin configuration file interactively. Use on first-time setup, when config is missing, or when the user wants to change settings.
config-audit
This skill should be used when auditing or comparing Claude Code and Cursor IDE configurations to identify feature gaps, equivalencies, and migration opportunities. Useful when managing AI development tooling across both platforms or deciding how to structure AI workflows.
claude-improve-config
Self-reflect on the current session to identify mistakes and propose improvements to .claude configuration (CLAUDE.md, hooks, skills).
android-signing-config
Configure Android release build signing with dual-source credentials (env vars + gradle.properties)
acm-config
Use when the user wants to customize Claudikins Automatic Context Manager behavior, configure trigger threshold, snooze duration, summary length, or runs '/acm:config'. Interactively asks questions and saves preferences to config file.
sast-configuration
Configure Static Application Security Testing (SAST) tools for automated vulnerability detection in application code. Use when setting up security scanning, implementing DevSecOps practices, or aut...