本页还没有译文
本页 27 段还没译成日本語,下面显示的是英文原文。OpenCode
还没翻译译自英文(docs.ollama.com)本页 27 段都还没译
OpenCode is an open-source coding agent that runs in your terminal, reads your project, edits files, and runs commands.
Ollama configures OpenCode to use local and cloud models.
Get started
Launch OpenCode with Ollama:
ollama launch opencodeCapabilities
Chat
Command line
File edits
Subagents
Web fetch
Vision
Models
Choose a model with enough context for your repository.
Use larger models without downloading them.
Choose a model and set a 64k+ context window.
Note
OpenCode requires a context length of 64k or higher. See Context length for more information.
Manual setup
1. Install OpenCode
curl -fsSL https://opencode.ai/install | bashnpm install -g opencode-ai2. Configure Ollama as a provider
Add an Ollama provider to opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"ollama": {
"npm": "@ai-sdk/openai-compatible",
"name": "Ollama",
"options": {
"baseURL": "http://localhost:11434/v1"
},
"models": {
"qwen3.5": {
"name": "qwen3.5"
}
}
}
}
}3. Run OpenCode
opencodeTo configure OpenCode with Ollama without starting an interactive session:
ollama launch opencode --configConfiguration precedence
ollama launch opencode starts OpenCode with an inline config for the selected Ollama model. It does not overwrite ~/.config/opencode/opencode.json; existing OpenCode settings still apply.
Models defined only in opencode.json do not appear in the ollama launch model picker.
See OpenCode's config precedence.