Buckets:
| title: Supporto ACP | |
| description: Usa OpenCode in qualunque editor compatibile con ACP. | |
| OpenCode supporta [Agent Client Protocol](https://agentclientprotocol.com) (ACP), permettendoti di usarlo direttamente in editor e IDE compatibili. | |
| :::tip | |
| Per una lista di editor e tool che supportano ACP, vedi l'[ACP progress report](https://zed.dev/blog/acp-progress-report#available-now). | |
| ::: | |
| ACP e è un protocollo aperto che standardizza la comunicazione tra editor di codice e agenti di coding AI. | |
| ## Configurazione | |
| Per usare OpenCode via ACP, configura l'editor in modo che esegua il comando `opencode acp`. | |
| Il comando avvia OpenCode come sottoprocesso compatibile con ACP che comunica con l'editor via JSON-RPC su stdio. | |
| Qui sotto trovi esempi per editor popolari che supportano ACP. | |
| ### Zed | |
| Aggiungi alla configurazione di [Zed](https://zed.dev) (`~/.config/zed/settings.json`): | |
| ```json title="~/.config/zed/settings.json" | |
| { | |
| "agent_servers": { | |
| "OpenCode": { | |
| "command": "opencode", | |
| "args": ["acp"] | |
| } | |
| } | |
| } | |
| ``` | |
| Per aprirlo, usa l'azione `agent: new thread` nella **Command Palette**. | |
| Puoi anche assegnare una scorciatoia da tastiera modificando `keymap.json`: | |
| ```json title="keymap.json" | |
| [ | |
| { | |
| "bindings": { | |
| "cmd-alt-o": [ | |
| "agent::NewExternalAgentThread", | |
| { | |
| "agent": { | |
| "custom": { | |
| "name": "OpenCode", | |
| "command": { | |
| "command": "opencode", | |
| "args": ["acp"] | |
| } | |
| } | |
| } | |
| } | |
| ] | |
| } | |
| } | |
| ] | |
| ``` | |
| ### JetBrains IDEs | |
| Aggiungi al tuo acp.json per [JetBrains IDE](https://www.jetbrains.com/) secondo la [documentazione](https://www.jetbrains.com/help/ai-assistant/acp.html): | |
| ```json title="acp.json" | |
| { | |
| "agent_servers": { | |
| "OpenCode": { | |
| "command": "/absolute/path/bin/opencode", | |
| "args": ["acp"] | |
| } | |
| } | |
| } | |
| ``` | |
| Per aprirlo, seleziona il nuovo agente 'OpenCode' nel selettore agenti di AI Chat. | |
| ### Avante.nvim | |
| Aggiungi alla configurazione di [Avante.nvim](https://github.com/yetone/avante.nvim): | |
| ```lua | |
| { | |
| acp_providers = { | |
| ["opencode"] = { | |
| command = "opencode", | |
| args = { "acp" } | |
| } | |
| } | |
| } | |
| ``` | |
| Se devi passare variabili d'ambiente: | |
| ```lua {6-8} | |
| { | |
| acp_providers = { | |
| ["opencode"] = { | |
| command = "opencode", | |
| args = { "acp" }, | |
| env = { | |
| OPENCODE_API_KEY = os.getenv("OPENCODE_API_KEY") | |
| } | |
| } | |
| } | |
| } | |
| ``` | |
| ### CodeCompanion.nvim | |
| Per usare OpenCode come agente ACP in [CodeCompanion.nvim](https://github.com/olimorris/codecompanion.nvim), aggiungi quanto segue alla config di Neovim: | |
| ```lua | |
| require("codecompanion").setup({ | |
| interactions = { | |
| chat = { | |
| adapter = { | |
| name = "opencode", | |
| model = "claude-sonnet-4", | |
| }, | |
| }, | |
| }, | |
| }) | |
| ``` | |
| Questa config imposta CodeCompanion per usare OpenCode come agente ACP per la chat. | |
| Se devi passare variabili d'ambiente (come `OPENCODE_API_KEY`), vedi [Configuring Adapters: Environment Variables](https://codecompanion.olimorris.dev/getting-started#setting-an-api-key) nella documentazione di CodeCompanion.nvim. | |
| ## Supporto | |
| OpenCode funziona via ACP come nel terminale. Tutte le funzionalita sono supportate: | |
| :::note | |
| Alcuni comandi slash integrati come `/undo` e `/redo` non sono attualmente supportati. | |
| ::: | |
| - Strumenti integrati (operazioni sui file, comandi da terminale, ecc.) | |
| - Strumenti personalizzati e comandi slash | |
| - Server MCP configurati nella tua configurazione OpenCode | |
| - Regole specifiche del progetto da `AGENTS.md` | |
| - Formatter e linter personalizzati | |
| - Sistema di agenti e permessi | |
Xet Storage Details
- Size:
- 3.64 kB
- Xet hash:
- c0e1f929801c96e2b3c3a35453bb1cba5f3332b9f841f5bfcd2a9ce250f0a156
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.