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 ๋ฐ ๊ถŒํ•œ ์‹œ์Šคํ…œ