Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/web/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ export default defineConfig({
"lsp",
"mcp-servers",
"custom-tools",
"acp",
],
},

Expand Down
103 changes: 103 additions & 0 deletions packages/web/src/content/docs/acp.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
---
title: Agent Client Protocol
description: Use OpenCode in any ACP-compatible editor.
---

OpenCode supports the [Agent Client Protocol (ACP)](https://agentclientprotocol.com), allowing you to use it directly in compatible editors and IDEs.

ACP is an open protocol that standardizes communication between code editors and AI coding agents. Similar to LSP for language servers, ACP allows agents like OpenCode to work seamlessly across different development environments.

:::tip
For a list of editors and tools that support ACP, see the [ACP progress report](https://zed.dev/blog/acp-progress-report#available-now).
:::

---

## Configure

To use OpenCode via ACP, configure your editor to run the `opencode acp` command.

The command starts OpenCode as an ACP-compatible subprocess that communicates with your editor over JSON-RPC via stdio.

Below are examples for popular editors that support ACP.

---

### Zed

Add to your Zed configuration (`~/.config/zed/settings.json`):

```json
{
"agent_servers": {
"OpenCode": {
"command": "opencode",
"args": ["acp"]
}
}
}
```

To open it, use the `agent: new thread` action in the Command Palette

You can also bind a keyboard shortcut by editing your `keymap.json`:

```json
[
{
"bindings": {
"cmd-alt-o": ["agent::NewExternalAgentThread", { "agent": "OpenCode" }]
}
}
]
```

---

### Avante.nvim

Add to your Avante configuration:

```lua
{
acp_providers = {
["opencode"] = {
command = "opencode",
args = { "acp" }
}
}
}
```

If you need to pass environment variables:

```lua
{
acp_providers = {
["opencode"] = {
command = "opencode",
args = { "acp" },
env = {
OPENCODE_API_KEY = os.getenv("OPENCODE_API_KEY")
}
}
}
}
```

---

## Capabilities

OpenCode works the same via ACP as it does in the terminal. All features are supported:

- Built-in tools (file operations, terminal commands, etc.)
- Custom tools and slash commands
- MCP servers configured in your OpenCode config
- Project-specific rules from `AGENTS.md`
- Custom formatters and linters
- Agents and permissions system

:::note
Some built-in slash commands like `/undo` and `/redo` are currently unsupported in ACP mode.
:::