Skip to main content

Opencode Setup

Opencode is an AI-powered CLI tool for software engineering tasks, running locally via Ollama.

For this setup we will be on your preferred development system.

Installation

curl -fsSL https://opencode.ai/install.sh | sh

Verify:

opencode --version

Configuration

Create a configuration file:

mkdir -p ~/.config/opencode

Edit ~/.config/opencode/opencode.json

Here you want to ensure the model keys match the names of the models in Ollama ... the "name" key within is an alias showed within Opencode.

{
"$schema": "https://opencode.ai/config.json",
"provider": {
"ollama": {
"npm": "@ai-sdk/openai-compatible",
"name": "Ollama (local)",
"options": {
"baseURL": "http://127.0.0.1:11434/v1"
},
"models": {
"Qwen3.6-35B-A3B-UD-IQ4_XS": {
"name": "Qwen",
"tools": true
}
}
}
}
}