OpenCode is an open-source AI coding assistant that provides intelligent code completion, code generation, and conversational programming experience.
A powerful AI coding agent. Built for the terminal.
OpenCode is a Go-based CLI application that brings AI assistance to your terminal. It provides a TUI (Terminal User Interface) for interacting with various AI models to help with coding tasks, debugging, and more.
Install
- install script:
curl -fsSL https://opencode.ai/install | bash - install command
```shell
Using Homebrew (macOS/Linux)
brew install opencode-ai/tap/opencode
Using npm
npm install -g opencode-ai
Using Go
go install github.com/opencode-ai/opencode@latest
- offline install(wget)
`https://github.com/anomalyco/opencode/releases`
## Start
```shell
cd <project> # Open directory
opencode # Run command
Docs
Custom Provider
Config opencode.json to set opencode’s default model with OpenAI format.
#~/.config/opencode/opencode.json
# "model": "vllm/deepseek-v4-flash" set default model
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"vllm": {
"npm": "@ai-sdk/openai-compatible",
"name": "vLLM本地模型",
"options": {
"baseURL": "https://api.deepseek.com/v1",
"apiKey": "sk-dummy"
},
"models": {
"deepseek-v4-flash": {
"name": "deepseek-v4-flash"
}
}
}
},
"model": "vllm/deepseek-v4-flash"
}