OpenCode
OpenCode CLI
- opencode
XDG paths on every platform, one SQLite database, its own MCP dialect.
- Invoke
- 2 of 6 · official
- Models
- no listing
- MCP
- json · opencode
- Agents file
- ~/.config/opencode/AGENTS.md
Access
- Get
getHarness("opencode") - CLI
harnesses paths opencode --json - Tryopencode in the explorer
OpenCode is the tidy one. Config is opencode.json or .jsonc at the user level under ~/.config/opencode/ and at the project level either in the root or under .opencode/. Everything it writes goes into one SQLite database under ~/.local/share/opencode/, through Drizzle, and the same paths hold on Windows, which the notes say so nobody adds an %APPDATA% variant.
MCP servers use the opencode dialect, which nests entries differently from the standard family; the library normalizes both directions. opencode run is the headless mode, --format json the structured one. No advisor and no sandbox, and it reads .claude/skills/ and ~/.agents/skills/ beside its own.
Capabilities and invocation
- mcp: yes
- vision: yes
- audio: no
- video: no
- tools: yes
- streaming: yes
Binary opencode, evidence official. Model selection appends --model {model}.
- advisor{}rejected
- advisor · json{ structured: true }rejected
- read-only{ readOnly: true }rejected
- read-only · json{ readOnly: true, structured: true }rejected
- agent{ tools: true }
run {prompt} - agent · json{ tools: true, structured: true }
run --format json {prompt}
Paths
Templates as the registry stores them. ~, ${HOME}, ${TMPDIR} and %VAR% expand in resolve(); entries tagged with a platform are dropped on the others. Open in the explorer to see them expanded for a home directory of your choice.
config
~/.config/opencode/opencode.jsoncXDG-based, same path on all platforms.
~/.config/opencode/opencode.jsonopencode.jsoncopencode.json.opencode/opencode.jsonc.opencode/opencode.json
sessions
~/.local/share/opencode/opencode.dbSQLite database with sessions, messages, and parts. XDG-based, same path on all platforms.
instructions
AGENTS.mdCLAUDE.mdSupported for Claude Code compatibility.
~/.config/opencode/AGENTS.mdGlobal user-level instructions.
skills
.opencode/skills/.claude/skills/Claude Code compatible.
.agents/skills/~/.config/opencode/skills/~/.claude/skills/Claude Code compatible.
~/.agents/skills/
commands
.opencode/commands/Markdown prompt commands; also configurable through command entries in opencode.json.
~/.config/opencode/commands/Global Markdown prompt commands.
promptTemplates
.opencode/commands/Markdown prompt commands; also configurable through command entries in opencode.json.
~/.config/opencode/commands/Global Markdown prompt commands.
Empty
hookstempThat is not the same as the feature being missing.
MCP servers
~/.config/opencode/opencode.jsonuser · json · opencode · mcpopencode.jsonproject · json · opencode · mcp
Detection
envVars
None. Detection is by project markers only.
projectMarkers
- .opencode
- opencode.jsonc
- opencode.json
Persistence
- JSON/JSONC - Config files. (official)
- SQLite - Session and message storage via Drizzle ORM. (official)
syncAgentsFiles links ~/.config/opencode/AGENTS.md to the master bundle.