No description
Find a file
2026-08-02 02:06:10 +05:30
agents Add opencode global config: agents, commands, skills, and portable env-based model config 2026-08-02 01:46:11 +05:30
commands Add opencode global config: agents, commands, skills, and portable env-based model config 2026-08-02 01:46:11 +05:30
skills/summarize Add opencode global config: agents, commands, skills, and portable env-based model config 2026-08-02 01:46:11 +05:30
.gitignore Add opencode global config: agents, commands, skills, and portable env-based model config 2026-08-02 01:46:11 +05:30
opencode.jsonc Move config to opencode.jsonc with inline comments, drop device-specific enabled_providers, add README 2026-08-02 02:06:10 +05:30
package.json Bump @opencode-ai/plugin to caret range matching current opencode version (1.18.11) 2026-08-02 01:55:50 +05:30
README.md Move config to opencode.jsonc with inline comments, drop device-specific enabled_providers, add README 2026-08-02 02:06:10 +05:30

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

  1. 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)

  2. Install the plugin dependency (needed if writing/using custom plugins):

    cd ~/.config/opencode
    npm install   # or bun install
    
  3. 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_MODEL Lightweight model for title generation / cheap tasks
    OPENCODE_SUBAGENT_MODEL Model used by both the explore and general subagents
    CONTEXT7_API_KEY API 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.

  4. (Optional, per device) Set enabled_providers in opencode.jsonc if 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 separate OPENCODE_CONFIG file 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, and bun.lock are gitignored — regenerate via install, don't commit them.