* Add OpenCode converter coverage and specs * Add Codex target support and spec docs * Generate Codex command skills and refresh spec docs * Add global Codex install path * fix: harden plugin path loading and codex descriptions * feat: ensure codex agents block on convert/install * docs: clarify target branch usage for review * chore: prep npm package metadata and release notes * docs: mention opencode and codex in changelog * docs: update CLI usage and remove stale todos * feat: install from GitHub with global outputs
3.5 KiB
3.5 KiB
OpenCode Spec (Config, Agents, Plugins)
Last verified: 2026-01-21
Primary sources
https://opencode.ai/docs/config
https://opencode.ai/docs/tools
https://opencode.ai/docs/permissions
https://opencode.ai/docs/plugins/
https://opencode.ai/docs/agents/
https://opencode.ai/config.json
Config files and precedence
- OpenCode supports JSON and JSONC configs. citeturn10view0
- Config sources are merged (not replaced), with a defined precedence order from remote → global → custom → project →
.opencodedirectories → inline overrides. citeturn10view0 - Global config is stored at
~/.config/opencode/opencode.json, and project config isopencode.jsonin the project root. citeturn10view0 - Custom config file and directory can be provided via
OPENCODE_CONFIGandOPENCODE_CONFIG_DIR. citeturn10view0 - The
.opencodeand~/.config/opencodedirectories use plural subdirectory names (agents/,commands/,modes/,plugins/,skills/,tools/,themes/), but singular names are also supported for backwards compatibility. citeturn10view0
Core config keys
modelandsmall_modelset the primary and lightweight models;providerconfigures provider options. citeturn10view0toolsis still supported but deprecated; permissions are now the canonical control surface. citeturn1search0permissioncontrols tool approvals and can be configured globally or per tool, including pattern-based rules. citeturn1search0mcp,instructions, anddisabled_providersare supported config sections. citeturn1search5plugincan list npm packages to load at startup. citeturn1search2
Tools
- OpenCode ships with built-in tools, and permissions determine whether each tool runs automatically, requires approval, or is denied. citeturn1search3turn1search0
- Tools are enabled by default; permissions provide the gating mechanism. citeturn1search3
Permissions
- Permissions resolve to
allow,ask, ordenyand can be configured globally or per tool, with pattern-based rules. citeturn1search0 - Defaults are permissive, with special cases such as
.envfile reads. citeturn1search0 - Agent-level permissions override the global permission block. citeturn1search1turn1search0
Agents
- Agents can be configured in
opencode.jsonor as markdown files in~/.config/opencode/agents/or.opencode/agents/. citeturn1search1turn10view0 - Agent config supports
mode,model,temperature,tools, andpermission, and agent configs override global settings. citeturn1search1 - Model IDs use the
provider/model-idformat. citeturn1search1
Plugins and events
- Local plugins are loaded from
.opencode/plugin/(project) and~/.config/opencode/plugin/(global). npm plugins can be listed inplugininopencode.json. citeturn1search2 - Plugins are loaded in a defined order across config and plugin directories. citeturn1search2
- Plugins export a function that returns a map of event handlers; the plugins doc lists supported event categories. citeturn1search2
Notes for this repository
- Config docs describe plural subdirectory names, while the plugins doc uses
.opencode/plugin/. This implies singular paths remain accepted for backwards compatibility, but plural paths are the canonical structure. citeturn10view0turn1search2