File size: 4,061 Bytes
0dbc9de | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 | ---
title: ACP Support
description: Use OpenCode in any ACP-compatible editor.
---
OpenCode๋ [Agent Client Protocol](https://agentclientprotocol.com)(ACP)์ ์ง์ํ๋ฏ๋ก, ACP ํธํ ํธ์ง๊ธฐ์ IDE์์ OpenCode๋ฅผ ์ง์ ์ฌ์ฉํ ์ ์์ต๋๋ค.
:::tip
ACP๋ฅผ ์ง์ํ๋ ํธ์ง๊ธฐ์ tool ๋ชฉ๋ก์ [ACP progress report](https://zed.dev/blog/acp-progress-report#available-now)์์ ํ์ธํ์ธ์.
:::
ACP๋ ์ฝ๋ ํธ์ง๊ธฐ์ AI ์ฝ๋ฉ ์์ด์ ํธ ๊ฐ์ ํต์ ์ ํ์คํํ๋ ๊ฐ๋ฐฉํ ํ๋กํ ์ฝ์
๋๋ค.
---
## ๊ตฌ์ฑ
ACP๋ก OpenCode๋ฅผ ์ฌ์ฉํ๋ ค๋ฉด, ํธ์ง๊ธฐ์์ `opencode acp` ๋ช
๋ น์ ์คํํ๋๋ก config๋ฅผ ์ค์ ํ์ธ์.
์ด ๋ช
๋ น์ OpenCode๋ฅผ ACP ํธํ subprocess๋ก ์์ํ๋ฉฐ, stdio ๊ธฐ๋ฐ JSON-RPC๋ฅผ ํตํด ํธ์ง๊ธฐ์ ํต์ ํฉ๋๋ค.
์๋๋ ACP๋ฅผ ์ง์ํ๋ ์ฃผ์ ํธ์ง๊ธฐ ์์์
๋๋ค.
---
### Zed
๋ช
๋ น ํ๋ ํธ์์ `zed: acp registry`๋ฅผ ์คํํ์ฌ [Zed ACP ๋ ์ง์คํธ๋ฆฌ](https://zed.dev/docs/ai/external-agents#registry)์์ OpenCode๋ฅผ ์ค์นํ์ธ์.
๋์ ์ฌ์ฉ์ ์ง์ OpenCode ์คํ ํ์ผ์ ์ฌ์ฉํ๋ ค๋ฉด [Zed](https://zed.dev) ์ค์ (`~/.config/zed/settings.json`)์ ์ถ๊ฐํ์ธ์.
```json title="~/.config/zed/settings.json"
{
"agent_servers": {
"OpenCode": {
"type": "custom",
"command": "opencode",
"args": ["acp"]
}
}
}
```
์ด๋ ค๋ฉด **Command Palette**์์ `agent: new thread` action์ ์ฌ์ฉํ์ธ์.
`keymap.json`์ ์์ ํด ํค๋ณด๋ ๋จ์ถํค๋ฅผ ๋ฐ์ธ๋ฉํ ์๋ ์์ต๋๋ค.
```json title="keymap.json"
[
{
"bindings": {
"cmd-alt-o": [
"agent::NewExternalAgentThread",
{
"agent": {
"custom": {
"name": "OpenCode",
"command": {
"command": "opencode",
"args": ["acp"]
}
}
}
}
]
}
}
]
```
---
### JetBrains IDEs
[JetBrains IDE](https://www.jetbrains.com/)์์๋ [documentation](https://www.jetbrains.com/help/ai-assistant/acp.html)์ ๋ฐ๋ผ `acp.json`์ ๋ค์์ ์ถ๊ฐํ์ธ์.
```json title="acp.json"
{
"agent_servers": {
"OpenCode": {
"command": "/absolute/path/bin/opencode",
"args": ["acp"]
}
}
}
```
์ด๋ ค๋ฉด AI Chat agent selector์์ ์ `OpenCode` agent๋ฅผ ์ ํํ์ธ์.
---
### Avante.nvim
[Avante.nvim](https://github.com/yetone/avante.nvim) config์ ๋ค์์ ์ถ๊ฐํ์ธ์.
```lua
{
acp_providers = {
["opencode"] = {
command = "opencode",
args = { "acp" }
}
}
}
```
ํ๊ฒฝ ๋ณ์๋ฅผ ์ ๋ฌํด์ผ ํ๋ค๋ฉด ๋ค์๊ณผ ๊ฐ์ด ์ค์ ํ์ธ์.
```lua {6-8}
{
acp_providers = {
["opencode"] = {
command = "opencode",
args = { "acp" },
env = {
OPENCODE_API_KEY = os.getenv("OPENCODE_API_KEY")
}
}
}
}
```
---
### CodeCompanion.nvim
[CodeCompanion.nvim](https://github.com/olimorris/codecompanion.nvim)์์ OpenCode๋ฅผ ACP agent๋ก ์ฌ์ฉํ๋ ค๋ฉด Neovim config์ ๋ค์์ ์ถ๊ฐํ์ธ์.
```lua
require("codecompanion").setup({
interactions = {
chat = {
adapter = {
name = "opencode",
model = "claude-sonnet-4",
},
},
},
})
```
์ด config๋ chat์์ OpenCode๋ฅผ ACP agent๋ก ์ฌ์ฉํ๋๋ก CodeCompanion์ ์ค์ ํฉ๋๋ค.
ํ๊ฒฝ ๋ณ์(`OPENCODE_API_KEY` ๋ฑ)๋ฅผ ์ ๋ฌํด์ผ ํ๋ค๋ฉด CodeCompanion.nvim documentation์ [Configuring Adapters: Environment Variables](https://codecompanion.olimorris.dev/getting-started#setting-an-api-key)๋ฅผ ์ฐธ๊ณ ํ์ธ์.
## ์ง์
OpenCode๋ ACP๋ฅผ ํตํด์๋ ํฐ๋ฏธ๋๊ณผ ๋์ผํ๊ฒ ๋์ํฉ๋๋ค. ๋ค์ ๊ธฐ๋ฅ์ ๋ชจ๋ ์ง์ํฉ๋๋ค.
:::note
`/undo` ๋ฐ `/redo`์ ๊ฐ์ ์ผ๋ถ ๋ด์ฅ ์ฌ๋์ ๋ช
๋ น์ ํ์ฌ ์ง์๋์ง ์์ต๋๋ค.
:::
- ๋ด์ฅ tool(ํ์ผ ์์
, terminal ๋ช
๋ น ๋ฑ)
- ์ฌ์ฉ์ ์ ์ tool๊ณผ slash command
- OpenCode config์ ์ค์ ํ MCP ์๋ฒ
- `AGENTS.md`์ ํ๋ก์ ํธ๋ณ ๊ท์น
- ์ฌ์ฉ์ ์ ์ formatter์ linter
- agent ๋ฐ ๊ถํ ์์คํ
|