opencode-config
Use when configuring OpenCode — opencode.json schema, config sources/precedence, providers, models, themes, keybinds, formatters, LSP servers, compaction, or any opencode.json settings.
| Model | Source |
|---|---|
| sonnet | pack: opencode |
Overview
Section titled “Overview”OpenCode uses JSON/JSONC config files merged from multiple sources. Schema validation at https://opencode.ai/config.json. Current version: v1.2.10 (Feb 2026).
Full Reference
OpenCode Configuration
Section titled “OpenCode Configuration”Overview
Section titled “Overview”OpenCode uses JSON/JSONC config files merged from multiple sources. Schema validation at https://opencode.ai/config.json. Current version: v1.2.10 (Feb 2026).
Quick Reference
Section titled “Quick Reference”| Item | Value |
|---|---|
| Config format | opencode.json or opencode.jsonc |
| Schema URL | https://opencode.ai/config.json |
| Global config | ~/.config/opencode/opencode.json |
| Project config | opencode.json (project root) |
| Env override (path) | OPENCODE_CONFIG |
| Env override (inline) | OPENCODE_CONFIG_CONTENT — highest priority, wins over everything |
| Provider auth | Use env field on provider config, NOT {env:} substitution |
| Timeout unit | Integer milliseconds (not strings) |
Reference Index
Section titled “Reference Index”| Topic | File |
|---|---|
| Config format, merge order, variable substitution, directory structure, env vars | reference/config-sources.md |
Provider setup, Bedrock, Azure, allow/block lists, /connect | reference/providers.md |
| Model selection, per-model options, reasoning, variants, cycling | reference/models.md |
| TUI scroll/diff, themes, keybinds | reference/tui.md |
| Server port, hostname, mDNS, CORS | reference/server.md |
| Built-in formatters, disabling, custom formatters | reference/formatters.md |
| Built-in LSP servers, config fields, diagnostics, auto-download | reference/lsp.md |
| Compaction auto/prune/reserved, custom hook | reference/compaction.md |
| Instructions files, default agent, agents directory | reference/agents.md |
| Sharing modes, autoupdate, plugins, watcher, experimental | reference/sharing-updates.md |
| Auth failures, timeouts, config not found, compaction loop, LSP/formatter issues, schema errors | reference/troubleshooting.md |
Usage: Read the reference file matching your current task from the index above. Each file is self-contained with code examples and inline gotchas.
Announcement
Section titled “Announcement”┏━ ⚙️ opencode-config ━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃ Configure OpenCode — schema, providers, models, themes, LSP, and more ┃ ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛