Skip to content

Commit 3934bbb

Browse files
committed
feat(codecompanion): claude acp integration
1 parent 37243b1 commit 3934bbb

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

.nvim.env.template

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
AI_CODING_AGENT_TOOL=
2+
AI_CHAT_TOOL=
23
AI_SUGGESTIONS_ENABLED=
34
AI_SUGGESTIONS_ENGINE=
45
BLINK_FUZZY_IMPLEMENTATION=
6+
CLAUDE_CODE_OAUTH_TOKEN=
57
COPILOT_PROXY=
68
FORMAT_ON_SAVE=true
79
GREP_EXCLUDE_FILES=package-lock.json,lazy-lock.json

lua/plugins/codecompanion.lua

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,16 @@ return {
175175
adapters = {
176176
acp = {
177177
opencode = false,
178+
-- $ claude setup-token # Copy token
179+
-- $ npm install -g @zed-industries/claude-agent-acp # Install ACP bridge
180+
-- Add token to .nvim.env
181+
claude_code = function()
182+
return require("codecompanion.adapters").extend("claude_code", {
183+
env = {
184+
CLAUDE_CODE_OAUTH_TOKEN = "CLAUDE_CODE_OAUTH_TOKEN",
185+
},
186+
})
187+
end,
178188
},
179189
http = {
180190
opencode = function()
@@ -195,7 +205,7 @@ return {
195205
},
196206
interactions = {
197207
chat = {
198-
adapter = "opencode",
208+
adapter = T.env.get("AI_CHAT_TOOL"),
199209
keymaps = {
200210
close = {
201211
modes = { n = key_cancel, i = key_cancel },
@@ -206,7 +216,7 @@ return {
206216
},
207217
},
208218
inline = {
209-
adapter = "opencode",
219+
adapter = T.env.get("AI_CHAT_TOOL"),
210220
},
211221
},
212222
},

0 commit comments

Comments
 (0)