OpenCode
lastmod 2026-09-18created 2025-07-0912 edits
AI coding agent for the terminal
Categories
Features
- Open-source project that integrates an AI coding environment into the terminal
- Responsive native terminal UI with support for various themes
- Provider-independent design lets you choose from various LLMs: Anthropic, OpenAI, Google, local models, and more
- Automatically loads the appropriate LSP (Language Server Protocol) to minimize LLM errors
- Can put multiple agents on one project in parallel for collaboration and parallel work
- Modular client/server architecture allows use from various clients: local, remote, mobile, and more
- Every code session can be kept as a share link, useful for code review, debugging, collaboration, and more
- Integrates with Models.dev to support 75+ LLM providers; local models can also be used
- Supported providers are listed under Providers
- Custom LLMs/providers can be added via the config file
Bash terminal execution permission settings
Added read-only commands to the permission.bash allowlist in opencode.json.
{
"$schema": "https://opencode.ai/config.json",
"permission": {
"edit": "allow",
"webfetch": "deny",
"bash": {
"*": "deny",
"ls *": "allow",
"find *": "allow",
"grep *": "allow",
"rg *": "allow",
"wc *": "allow",
"head *": "allow",
"tail *": "allow",
"cat *": "allow",
"date*": "allow",
"mkdir *": "allow",
"sort*": "allow",
"uniq*": "allow",
"cut *": "allow",
"sed -n *": "allow",
"awk *": "allow",
"echo *": "allow",
"diff *": "allow",
"stat *": "allow",
"git status*": "allow",
"git diff*": "allow",
"cd *": "allow",
"tr *": "allow",
"basename *": "allow",
"dirname *": "allow"
}
}
}
How to connect to a custom vllm
~/.config/opencode/opencode.json
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"vllm": {
"npm": "@ai-sdk/openai-compatible",
"name": "vLLM (B200)",
"options": {
"baseURL": "https://nhn-ubuntu.unwiki.net/v1"
},
"models": {
"geo-agent": {
"name": "Qwen3.6-27B",
"tool_call": true,
"reasoning": true,
"attachment": true,
"modalities": {
"input": ["text", "image"],
"output": ["text"]
},
"limit": {
"context": 262144,
"output": 32768
}
}
}
}
},
"model": "vllm/geo-agent",
"small_model": "vllm/geo-agent"
}
If a security key is needed, edit the ~/.local/share/opencode/auth.json file:
Troubleshooting
Fixing opencode bash permission denied errors
The following error occurs when the opencode agent calls the bash tool.
Error: The user has specified a rule which prevents you from using this specific tool call.
Here are some of the relevant rules [{"permission":"*","action":"allow","pattern":"*"},
{"permission":"bash","pattern":"*","action":"deny"},
{"permission":"bash","pattern":"ls *","action":"allow"}, ... ]
The error message only shows the full list of rules, so you cannot tell which command was blocked or why. The actual cause must be checked in the execution logs in the logs/ directory.
- Every subcommand in a pipeline is checked:
- opencode splits the bash command string on pipes (
|),&&, and||, and checks permissions separately for each subcommand. - If even one hits
deny, the entire pipeline is denied.
- opencode splits the bash command string on pipes (
- The pattern
"sort *"matches only whensortis followed by a space and arguments. - Calling
sortalone with no arguments does not match. - This is also why
"date*"in the existing config was written without a space. - Commands that require arguments →
"cat *"form - Commands also used without arguments →
"sort*","uniq*"form
See #Bash terminal execution permission settings for the applied settings.
See also
- LLM
- AI Agent
- Gemini CLI
- OpenWork - OpenCode-based alternative to Claude Cowork
- Cloud CLI - Open-source web UI for Claude Code, Cursor CLI, and Codex
- Frouter - CLI tool that finds free AI APIs
Favorite site
- OpenCode | The open source AI coding agent
- Github - sst/opencode
- OpenCode - AI coding agent for the terminal | GeekNews
Pages that link here