mirror of
https://github.com/anomalyco/opencode.git
synced 2026-04-29 09:16:36 +00:00
157 lines
3.7 KiB
Plaintext
157 lines
3.7 KiB
Plaintext
---
|
|
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](https://zed.dev) config(`~/.config/zed/settings.json`)에 다음을 추가하세요.
|
|
|
|
```json title="~/.config/zed/settings.json"
|
|
{
|
|
"agent_servers": {
|
|
"OpenCode": {
|
|
"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 및 권한 시스템
|