Skip to content

Commit 48c6ae0

Browse files
feat(adapters): add KiloCode ACP (#3034)
1 parent cf3ff08 commit 48c6ae0

3 files changed

Lines changed: 79 additions & 4 deletions

File tree

doc/configuration/adapters-acp.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,19 @@ require("codecompanion").setup({
372372

373373
To use [Goose](https://block.github.io/goose/) in CodeCompanion, ensure you've followed their [documentation](https://block.github.io/goose/docs/getting-started/installation/) to setup and install Goose CLI. Then ensure that in your chat buffer you select the `goose` adapter.
374374

375+
## Setup: Kilo Code
376+
377+
To use [Kilo Code](https://kilo.ai) in CodeCompanion, ensure you've followed their documentation to [install](https://kilo.ai/docs/getting-started/installing#cli) and [configure](https://kilo.ai/docs/getting-started/setup-authentication#cli) it. Then ensure that in your chat buffer you select the `kilocode` adapter.
378+
379+
You can specify a custom model in your `~/.config/kilo/kilo.json` file:
380+
381+
```json
382+
{
383+
"$schema": "https://kilo.ai/config.json",
384+
"model": "kilo/kilo-auto/free",
385+
}
386+
```
387+
375388
## Setup: Kimi CLI
376389

377390
Install [Kimi CLI](https://github.com/MoonshotAI/kimi-cli?tab=readme-ov-file#installation) as per their instructions. Then in the CLI, run `kimi` followed by `/login` to configure your API key. Then ensure that in your chat buffer you select the `kimi_cli` adapter.
@@ -396,4 +409,3 @@ You can specify a custom model in your `~/.config/opencode/config.json` file:
396409
"model": "github-copilot/claude-sonnet-4.5",
397410
}
398411
```
399-

doc/index.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ CodeCompanion is a plugin which enables you to code with AI, using LLMs and agen
2121
- :speech_balloon: [Copilot Chat](https://github.com/features/copilot) meets [Zed AI](https://zed.dev/blog/zed-ai), in Neovim
2222
- :zap: Integrates Neovim with LLMs and Agents in the CLI
2323
- :electric_plug: Support for LLMs from Anthropic, Copilot, GitHub Models, DeepSeek, Gemini, Mistral AI, Novita, Ollama, OpenAI, Azure OpenAI, HuggingFace and xAI out of the box (or bring your own!)
24-
- :robot: Support for [Agent Client Protocol](https://agentclientprotocol.com/overview/introduction), enabling coding with agents like [Augment Code](https://docs.augmentcode.com/cli/overview), [Cagent](https://github.com/docker/cagent) from Docker, [Claude Code](https://docs.anthropic.com/en/docs/claude-code/overview), [Cline CLI](https://docs.cline.bot/home), [Codex](https://openai.com/codex), [Copilot CLI](https://github.com/features/copilot/cli), [Gemini CLI](https://github.com/google-gemini/gemini-cli), [Goose](https://block.github.io/goose/), [Cursor CLI](https://cursor.com/docs/cli/overview), [Kimi CLI](https://github.com/MoonshotAI/kimi-cli), [Kiro](https://kiro.dev/cli/), [Mistral Vibe](https://github.com/mistralai/mistral-vibe) and [OpenCode](https://opencode.ai)
24+
- :robot: Support for [Agent Client Protocol](https://agentclientprotocol.com/overview/introduction), enabling coding with agents like [Augment Code](https://docs.augmentcode.com/cli/overview), [Cagent](https://github.com/docker/cagent) from Docker, [Claude Code](https://docs.anthropic.com/en/docs/claude-code/overview), [Cline CLI](https://docs.cline.bot/home), [Codex](https://openai.com/codex), [Copilot CLI](https://github.com/features/copilot/cli), [Gemini CLI](https://github.com/google-gemini/gemini-cli), [Goose](https://block.github.io/goose/), [Cursor CLI](https://cursor.com/docs/cli/overview), [Kilo Code](https://kilo.ai), [Kimi CLI](https://github.com/MoonshotAI/kimi-cli), [Kiro](https://kiro.dev/cli/), [Mistral Vibe](https://github.com/mistralai/mistral-vibe) and [OpenCode](https://opencode.ai)
2525
- :heart_hands: User contributed and supported [adapters](/configuration/adapters-http#community-adapters)
2626
- :battery: Support for [Model Context Protocol (MCP)](/model-context-protocol)
2727
- :rocket: [Inline transformations](/usage/inline.html), code creation and refactoring
@@ -50,12 +50,13 @@ CodeCompanion uses [HTTP](configuration/adapters-http) and [ACP](configuration/a
5050
- Cline CLI (`cline_cli`)
5151
- Codex (`codex`) - Requires an API key
5252
- Copilot (`copilot`) - Requires a token which is created via `:Copilot setup` in [Copilot.vim](https://github.com/github/copilot.vim)
53+
- DeepSeek (`deepseek`) - Requires an API key
54+
- Gemini (`gemini`) - Requires an API key
5355
- Gemini CLI (`gemini_cli`) - Requires an API key or a Gemini Pro subscription
5456
- GitHub Models (`githubmodels`) - Requires [`gh`](https://github.com/cli/cli) to be installed and logged in
5557
- Goose (`goose`) - Requires an API key
56-
- DeepSeek (`deepseek`) - Requires an API key
57-
- Gemini (`gemini`) - Requires an API key
5858
- HuggingFace (`huggingface`) - Requires an API key
59+
- Kilo Code (`kilocode`) - Requires an API key
5960
- Kimi CLI (`kimi_cli`) - Requires an API key
6061
- Mistral AI (`mistral`) - Requires an API key or a Le Chat Pro subscription
6162
- Novita (`novita`) - Requires an API key
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
local helpers = require("codecompanion.adapters.acp.helpers")
2+
3+
---@class CodeCompanion.ACPAdapter.KiloCode: CodeCompanion.ACPAdapter
4+
return {
5+
name = "kilocode",
6+
formatted_name = "Kilo Code",
7+
type = "acp",
8+
roles = {
9+
llm = "assistant",
10+
user = "user",
11+
},
12+
opts = {
13+
vision = true,
14+
},
15+
commands = {
16+
default = {
17+
"kilo",
18+
"acp",
19+
},
20+
},
21+
defaults = {
22+
mcpServers = {},
23+
timeout = 20000, -- 20 seconds
24+
},
25+
parameters = {
26+
protocolVersion = 1,
27+
clientCapabilities = {
28+
fs = { readTextFile = true, writeTextFile = true },
29+
},
30+
clientInfo = {
31+
name = "CodeCompanion.nvim",
32+
version = "1.0.0",
33+
},
34+
},
35+
handlers = {
36+
---@param self CodeCompanion.ACPAdapter
37+
---@return boolean
38+
setup = function(self)
39+
return true
40+
end,
41+
42+
---@param self CodeCompanion.ACPAdapter
43+
---@return boolean
44+
auth = function(self)
45+
-- Declaring auth a success
46+
return true
47+
end,
48+
49+
---@param self CodeCompanion.ACPAdapter
50+
---@param messages table
51+
---@param capabilities table
52+
---@return table
53+
form_messages = function(self, messages, capabilities)
54+
return helpers.form_messages(self, messages, capabilities)
55+
end,
56+
57+
---@param self CodeCompanion.ACPAdapter
58+
---@param code number
59+
---@return nil
60+
on_exit = function(self, code) end,
61+
},
62+
}

0 commit comments

Comments
 (0)