Skip to content

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.

ModelSource
sonnetpack: opencode

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 uses JSON/JSONC config files merged from multiple sources. Schema validation at https://opencode.ai/config.json. Current version: v1.2.10 (Feb 2026).

ItemValue
Config formatopencode.json or opencode.jsonc
Schema URLhttps://opencode.ai/config.json
Global config~/.config/opencode/opencode.json
Project configopencode.json (project root)
Env override (path)OPENCODE_CONFIG
Env override (inline)OPENCODE_CONFIG_CONTENT — highest priority, wins over everything
Provider authUse env field on provider config, NOT {env:} substitution
Timeout unitInteger milliseconds (not strings)
TopicFile
Config format, merge order, variable substitution, directory structure, env varsreference/config-sources.md
Provider setup, Bedrock, Azure, allow/block lists, /connectreference/providers.md
Model selection, per-model options, reasoning, variants, cyclingreference/models.md
TUI scroll/diff, themes, keybindsreference/tui.md
Server port, hostname, mDNS, CORSreference/server.md
Built-in formatters, disabling, custom formattersreference/formatters.md
Built-in LSP servers, config fields, diagnostics, auto-downloadreference/lsp.md
Compaction auto/prune/reserved, custom hookreference/compaction.md
Instructions files, default agent, agents directoryreference/agents.md
Sharing modes, autoupdate, plugins, watcher, experimentalreference/sharing-updates.md
Auth failures, timeouts, config not found, compaction loop, LSP/formatter issues, schema errorsreference/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.


┏━ ⚙️ opencode-config ━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃ Configure OpenCode — schema, providers, models, themes, LSP, and more ┃ ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛