| agents | ||
| commands | ||
| skills/summarize | ||
| .gitignore | ||
| opencode.jsonc | ||
| package.json | ||
| README.md | ||
opencode-config
Personal global config for OpenCode, meant to be cloned into ~/.config/opencode on any device to get the same agents, commands, skills, and permission rules — independent of which model/provider that device uses.
Setup on a new device
-
Clone this repo directly into the OpenCode global config directory:
git clone https://github.com/sp4rkiop/opencode-config.git ~/.config/opencode(On Windows:
git clone https://github.com/sp4rkiop/opencode-config.git $env:USERPROFILE\.config\opencode) -
Install the plugin dependency (needed if writing/using custom plugins):
cd ~/.config/opencode npm install # or bun install -
Set the following environment variables (persist them, e.g. via shell profile or Windows User env vars) with whatever model this device should use:
Variable Purpose OPENCODE_SMALL_MODELLightweight model for title generation / cheap tasks OPENCODE_SUBAGENT_MODELModel used by both the exploreandgeneralsubagentsCONTEXT7_API_KEYAPI key for the Context7 MCP server (get one at https://context7.com) Example (PowerShell, persists across sessions):
[System.Environment]::SetEnvironmentVariable('OPENCODE_SMALL_MODEL', 'github-copilot/gpt-5-mini', 'User') [System.Environment]::SetEnvironmentVariable('OPENCODE_SUBAGENT_MODEL', 'github-copilot/gpt-5-mini', 'User') [System.Environment]::SetEnvironmentVariable('CONTEXT7_API_KEY', '<your-key>', 'User')Restart the terminal/opencode session after setting new env vars — they're read at startup, not live-reloaded.
-
(Optional, per device) Set
enabled_providersinopencode.jsoncif you want to restrict OpenCode to specific providers. This is intentionally not committed here since it's device/account specific — add it locally without committing, or set it in a separateOPENCODE_CONFIGfile outside this repo.
What's in here
| Path | Purpose |
|---|---|
opencode.jsonc |
Main config — model fields use {env:...} substitution so this file is identical across devices |
agents/ |
Custom primary agents (ask, debug) |
commands/ |
Custom slash commands (/explain, /review) |
skills/ |
Custom skills |
package.json |
Pins @opencode-ai/plugin (caret range) — only needed if adding custom plugin files under plugins/ |
Notes for an agent picking this up
- Don't hardcode a model/provider into
opencode.jsonc. Any model field should stay as an{env:VAR}reference. - Don't commit
enabled_providers, API keys, or anything account/device-specific — those belong in local env vars or an untracked local override. node_modules,package-lock.json, andbun.lockare gitignored — regenerate via install, don't commit them.