Skip to content

Instantly share code, notes, and snippets.

@pythoninthegrass
Last active September 15, 2025 04:25
Show Gist options
  • Save pythoninthegrass/d25e8293b9e0e3b70cc1e91a273d0c1b to your computer and use it in GitHub Desktop.
Save pythoninthegrass/d25e8293b9e0e3b70cc1e91a273d0c1b to your computer and use it in GitHub Desktop.
opencode config
CONTEXT7_API_KEY=
opencode.jsonc
{
"$schema": "https://opencode.ai/config.json",
"theme": "tokyonight",
"autoupdate": true,
"model": "Unsloth GPT OSS 20B",
"provider": {
"lmstudio": {
"npm": "@ai-sdk/openai-compatible",
"name": "LM Studio (local)",
"options": {
"baseURL": "http://127.0.0.1:1234/v1"
},
"models": {
"unsloth/gpt-oss-20b": {
"name": "Unsloth GPT OSS 20B"
}
}
}
},
"mcp": {
"context7": {
"type": "local",
"command": [
"npx",
"-y",
"@upstash/context7-mcp",
"--api-key",
"$CONTEXT7_API_KEY"
],
"enabled": true
},
"serena": {
"type": "local",
"command": [
"uvx",
"--from",
"git+https://github.com/oraios/serena",
"serena",
"start-mcp-server"
],
"enabled": true
},
"screencap": {
"type": "local",
"command": [
"uv",
"--directory",
"$HOME/git/screencap",
"run",
"server.py"
],
"environment": {
"UV_PROJECT_ENVIRONMENT": "$HOME/git/screencap/.venv"
},
"enabled": true
},
"sequentialthinking": {
"type": "local",
"command": [
"npx",
"@modelcontextprotocol/server-sequential-thinking"
],
"enabled": true
}
}
}
@pythoninthegrass
Copy link
Author

Clone gist and symlink to config dir

git clone [email protected]:d25e8293b9e0e3b70cc1e91a273d0c1b.git opencode_config && cd $_
mkdir -p ~/.config/opencode
ln -s $(pwd)/opencode.jsonc ~/.config/opencode/opencode.jsonc
cp .env.example .env
# fill out env vars

Add this snippet to ~/.bash_aliases

# opencode
if [[ -f "$HOME/git/opencode_config/.env" ]]; then
    export $(grep -v '^#' "$HOME/git/opencode_config/.env" | xargs)
    envsubst '$CONTEXT7_API_KEY $HOME $UV_PROJECT_ENVIRONMENT' \
        < "$HOME/git/opencode_config/opencode.jsonc.tpl" \
        > "$HOME/git/opencode_config/opencode.jsonc"
fi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment