Opencode for dummies, or literally vibe coders or whatever #320

Closed
opened 2026-02-16 17:26:11 -05:00 by yindo · 5 comments
Owner

Originally created by @marcusjihansson on GitHub (Jun 26, 2025).

Originally assigned to: @thdxr on GitHub.

I am using opencode on my macbook.

I have installed this with brew.

I have created a config file like this: touch ~/.opencode.json

Then set up this config with nvim ~/.opencode.json, and after that I export my api keys.

Now when I open opencode, should this work. Correct?

This is my config file structure:

{
"$schema": "https://opencode.ai/config.json",
"theme": "opencode",
"autoshare": false,
"autoupdate": true,
"model": "ollama/starcoder",
"provider": {
"lm-studio": {
"npm": "@ai-sdk/openai-compatible",
"name": "LM Studio",
"options": {
"baseURL": "http://localhost:1234/v1"
},
"models": {
"qwen3-1.7b": {
"name": "Qwen3 1.7B",
"attachment": true,
"reasoning": false,
"temperature": true,
"limit": {
"context": 8192,
"output": 2048
}
}
}
},
"ollama": {
"npm": "@ai-sdk/openai-compatible",
"name": "Ollama",
"options": {
"baseURL": "http://localhost:11434/v1"
},
"models": {
"starcoder": {
"name": "StarCoder 1B",
"attachment": true,
"reasoning": false,
"temperature": true,
"limit": {
"context": 32768,
"output": 4096
}
}
}
},
"gemini": {
"name": "Google Gemini",
"env": ["GEMINI_API_KEY"],
"models": {
"gemini-2.0-flash": {
"name": "Gemini 2.0 Flash",
"attachment": true,
"reasoning": false,
"temperature": true,
"limit": {
"context": 1000000,
"output": 8192
}
}
}
},
"openrouter": {
"name": "OpenRouter",
"env": ["OPENROUTER_API_KEY"],
"models": {
"anthropic/claude-3.5-sonnet": {
"name": "Claude 3.5 Sonnet (via OpenRouter)",
"attachment": true,
"reasoning": false,
"temperature": true,
"limit": {
"context": 200000,
"output": 8192
}
}
}
},
"nvidia": {
"npm": "@ai-sdk/openai-compatible",
"name": "NVIDIA NIM",
"options": {
"baseURL": "https://integrate.api.nvidia.com/v1"
},
"env": ["NVIDIA_API_KEY"],
"models": {
"nvidia/usdcode-llama-3.1-70b-instruct": {
"name": "USD Code Llama 3.1 70B",
"attachment": true,
"reasoning": false,
"temperature": true,
"limit": {
"context": 128000,
"output": 4096
}
}
}
}
}
}

I am really confused.

Originally created by @marcusjihansson on GitHub (Jun 26, 2025). Originally assigned to: @thdxr on GitHub. I am using opencode on my macbook. I have installed this with brew. I have created a config file like this: touch ~/.opencode.json Then set up this config with nvim ~/.opencode.json, and after that I export my api keys. Now when I open opencode, should this work. Correct? This is my config file structure: { "$schema": "https://opencode.ai/config.json", "theme": "opencode", "autoshare": false, "autoupdate": true, "model": "ollama/starcoder", "provider": { "lm-studio": { "npm": "@ai-sdk/openai-compatible", "name": "LM Studio", "options": { "baseURL": "http://localhost:1234/v1" }, "models": { "qwen3-1.7b": { "name": "Qwen3 1.7B", "attachment": true, "reasoning": false, "temperature": true, "limit": { "context": 8192, "output": 2048 } } } }, "ollama": { "npm": "@ai-sdk/openai-compatible", "name": "Ollama", "options": { "baseURL": "http://localhost:11434/v1" }, "models": { "starcoder": { "name": "StarCoder 1B", "attachment": true, "reasoning": false, "temperature": true, "limit": { "context": 32768, "output": 4096 } } } }, "gemini": { "name": "Google Gemini", "env": ["GEMINI_API_KEY"], "models": { "gemini-2.0-flash": { "name": "Gemini 2.0 Flash", "attachment": true, "reasoning": false, "temperature": true, "limit": { "context": 1000000, "output": 8192 } } } }, "openrouter": { "name": "OpenRouter", "env": ["OPENROUTER_API_KEY"], "models": { "anthropic/claude-3.5-sonnet": { "name": "Claude 3.5 Sonnet (via OpenRouter)", "attachment": true, "reasoning": false, "temperature": true, "limit": { "context": 200000, "output": 8192 } } } }, "nvidia": { "npm": "@ai-sdk/openai-compatible", "name": "NVIDIA NIM", "options": { "baseURL": "https://integrate.api.nvidia.com/v1" }, "env": ["NVIDIA_API_KEY"], "models": { "nvidia/usdcode-llama-3.1-70b-instruct": { "name": "USD Code Llama 3.1 70B", "attachment": true, "reasoning": false, "temperature": true, "limit": { "context": 128000, "output": 4096 } } } } } } I am really confused.
yindo closed this issue 2026-02-16 17:26:11 -05:00
Author
Owner

@thdxr commented on GitHub (Jun 26, 2025):

~/.opencode.json isn't a thing https://opencode.ai/docs/config/

@thdxr commented on GitHub (Jun 26, 2025): `~/.opencode.json` isn't a thing [https://opencode.ai/docs/config/](https://opencode.ai/docs/config/)
Author
Owner

@marcusjihansson commented on GitHub (Jun 26, 2025):

https://opencode.ai/docs/config/

Aha I areeee. So it is supposed to be put under ~/.config/opencode/config.json for it to config.

I think I get it now.

Thank you. I appreciate it

@marcusjihansson commented on GitHub (Jun 26, 2025): > https://opencode.ai/docs/config/ Aha I areeee. So it is supposed to be put under ~/.config/opencode/config.json for it to config. I think I get it now. Thank you. I appreciate it
Author
Owner

@Schniz commented on GitHub (Jun 27, 2025):

@thdxr should opencode figure that this file exists and suggest moving it to config? Many people don't know XDG because most tools don't comply with it. And that can be helpful to migrate it to the real location :)

@Schniz commented on GitHub (Jun 27, 2025): @thdxr should opencode figure that this file exists and suggest moving it to config? Many people don't know XDG because most tools don't comply with it. And that can be helpful to migrate it to the real location :)
Author
Owner

@Keyruu commented on GitHub (Jun 27, 2025):

@Schniz just giving my two cents in here: I would say people should just read the documentation.

@Keyruu commented on GitHub (Jun 27, 2025): @Schniz just giving my two cents in here: I would say people should just read the documentation.
Author
Owner

@rekram1-node commented on GitHub (Dec 27, 2025):

[automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!

@rekram1-node commented on GitHub (Dec 27, 2025): [automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#320