Technical brief / Developer Tools
OpenCode lets you use an AI coding assistant from different interfaces.
What happened
The OpenCode project offers interfaces for a terminal, a desktop app and a code editor. These are different ways to interact with the coding assistant.
When you start the terminal app, it starts both the visible interface and a background program called a server. The interface sends requests to that server. You can also run opencode serve to start the server without the terminal interface.
The server's API is a set of requests other programs can send—for example, to start a conversation, send a message or respond to a request for permission.
Why it matters
Your team could build a small review app with a button labelled Check this change. Clicking it could send a task to OpenCode, show progress and display any resulting code changes for review. The app would use the API to communicate with OpenCode.
There are two different connections to understand:
- Your app → OpenCode: your app sends the assistant a task through its server API.
- OpenCode → another tool: the assistant uses a tool connected through MCP, a standard way to give AI assistants access to external tools. For example, a connected tool could let it look up an issue.
OpenAPI describes the requests your app can send to OpenCode. MCP describes a way to connect extra tools that the assistant can use.
Plan the change, then build it
OpenCode gives you two starting choices: Plan to examine your code and discuss possible changes, and Build to make those changes. For example, you can first ask Plan how to add a search box, then switch to Build to implement the agreed approach. In the terminal app, press Tab to switch between them.
Build is the default and has its tools enabled. Plan asks for approval before changing files or running commands by default.
OpenCode calls Build and Plan primary agents because they are the assistants you talk to directly. A subagent is a helper given a smaller task, such as finding the files that implement search, while the main assistant continues to handle your conversation.
You can define custom roles in JSON or Markdown, choosing their instructions, AI model and permissions.
The permission settings decide what the assistant may actually do: allow means proceed automatically, ask means request approval, and deny means block the action. Plan's default ask setting is not a complete ban on changes.
For a reviewer that must not change files, restrict editing tools and any shell or connected tools that can write. OpenCode controls edit and bash separately, so denying edit alone does not establish read-only access. Test the configuration and use filesystem restrictions when read-only access must be enforced. Merely telling the assistant “you are a reviewer” does not enforce that restriction.
Adding features and sharing access
Plugins are pieces of code that add behaviour to OpenCode. They can react when something happens in a conversation or file, or when a tool runs. Together with custom assistant roles and connected tools, they let a team adapt OpenCode to its work.
The standalone server listens on your own computer by default and supports password protection. If you make it accessible from other computers, protect both access and the connection.
Like Pi, OpenCode provides the software around an AI model: the interface, tools and rules for carrying out work. OpenCode's server API is useful if you want your own app to send it tasks. Whether it produces good code at an acceptable cost still needs testing with your chosen model and real tasks.
Sources checked on 20 September 2026; server documentation rechecked on 23 September 2026, agent roles on 24 September 2026 and permissions on 28 September 2026.
Correction, 28 September 2026: Blocking editing tools alone does not prevent writes through separately permitted shell commands or other tools. The read-only advice now covers those paths.
AI Disclosure
Researched and drafted with AI assistance, then reviewed by Søren Dalby. Sources are linked; errors may remain, and corrections are welcome.
Sources
- OpenCode: official source repository
- OpenCode: introduction and interfaces
- OpenCode: server architecture and HTTP API
- OpenCode: built-in and custom agents
- OpenCode: permissions and defaults
- OpenCode: plugins and lifecycle hooks
- OpenCode: local and remote MCP servers
- OpenCode School, a free, self-paced course with hands-on exercises