Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 67 additions & 1 deletion doc/codecompanion.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*codecompanion.txt* For NVIM v0.11 Last change: 2026 May 06
*codecompanion.txt* For NVIM v0.11 Last change: 2026 May 10

==============================================================================
Table of Contents *codecompanion-table-of-contents*
Expand Down Expand Up @@ -1481,6 +1481,72 @@ You can specify a custom model in your `~/.config/opencode/config.json` file:
<


CREATING CUSTOM ACP ADAPTERS ~

Not every ACP-compatible tool will have a built-in adapter. You can define your
own directly in your configuration — the example below uses a hypothetical
`myagent` CLI tool. Use the built-in ACP adapters
<https://github.com/olimorris/codecompanion.nvim/blob/main/lua/codecompanion/adapters/acp>
as a reference.

>lua
require("codecompanion").setup({
adapters = {
acp = {
my_agent = function()
local helpers = require("codecompanion.adapters.acp.helpers")
return {
name = "my_agent",
formatted_name = "MyAgent",
type = "acp",
roles = {
llm = "assistant",
user = "user",
},
commands = {
default = {
"myagent",
"--acp",
},
},
defaults = {
mcpServers = {},
timeout = 20000, -- 20 seconds
},
parameters = {
protocolVersion = 1,
clientCapabilities = {
fs = { readTextFile = true, writeTextFile = true },
},
clientInfo = {
name = "CodeCompanion.nvim",
version = "1.0.0",
},
},
handlers = {
setup = function(self)
return true
end,
auth = function(self)
return true
end,
form_messages = function(self, messages, capabilities)
return helpers.form_messages(self, messages, capabilities)
end,
on_exit = function(self, code) end,
},
}
end,
},
},
})
<

User-created adapters are shared in the adapter discussions on GitHub
<https://github.com/olimorris/codecompanion.nvim/discussions?discussions_q=is%3Aopen+label%3A%22tip%3A+adapter%22>
— a good place to raise issues or ask questions about your specific adapter.


HTTP ADAPTERS *codecompanion-configuration-http-adapters*


Expand Down
59 changes: 59 additions & 0 deletions doc/configuration/adapters-acp.md
Original file line number Diff line number Diff line change
Expand Up @@ -409,3 +409,62 @@ You can specify a custom model in your `~/.config/opencode/config.json` file:
"model": "github-copilot/claude-sonnet-4.5",
}
```

## Creating Custom ACP Adapters

Not every ACP-compatible tool will have a built-in adapter. You can define your own directly in your configuration — the example below uses a hypothetical `myagent` CLI tool. Use the [built-in ACP adapters](https://github.com/olimorris/codecompanion.nvim/blob/main/lua/codecompanion/adapters/acp) as a reference.

````lua
require("codecompanion").setup({
adapters = {
acp = {
my_agent = function()
local helpers = require("codecompanion.adapters.acp.helpers")
return {
name = "my_agent",
formatted_name = "MyAgent",
type = "acp",
roles = {
llm = "assistant",
user = "user",
},
commands = {
default = {
"myagent",
"--acp",
},
},
defaults = {
mcpServers = {},
timeout = 20000, -- 20 seconds
},
parameters = {
protocolVersion = 1,
clientCapabilities = {
fs = { readTextFile = true, writeTextFile = true },
},
clientInfo = {
name = "CodeCompanion.nvim",
version = "1.0.0",
},
},
handlers = {
setup = function(self)
return true
end,
auth = function(self)
return true
end,
form_messages = function(self, messages, capabilities)
return helpers.form_messages(self, messages, capabilities)
end,
on_exit = function(self, code) end,
},
}
end,
},
},
})
````

User-created adapters are shared in the [adapter discussions on GitHub](https://github.com/olimorris/codecompanion.nvim/discussions?discussions_q=is%3Aopen+label%3A%22tip%3A+adapter%22) — a good place to raise issues or ask questions about your specific adapter.