diff --git a/README.md b/README.md index 675ee135..5f5c26de 100644 --- a/README.md +++ b/README.md @@ -342,6 +342,7 @@ local defaults = { cursor = {}, gemini = {}, grok = {}, + kimi = {}, opencode = {}, pi = {}, qwen = {}, @@ -725,6 +726,7 @@ Sidekick preconfigures popular AI CLIs. Run `:checkhealth sidekick` to see which | [`cursor`](https://cursor.com/cli) | Cursor CLI agent | See [Cursor docs](https://cursor.com/cli) | | [`gemini`](https://github.com/google-gemini/gemini-cli) | Google Gemini CLI | See [repo](https://github.com/google-gemini/gemini-cli) | | [`grok`](https://github.com/superagent-ai/grok-cli) | xAI Grok CLI | See [repo](https://github.com/superagent-ai/grok-cli) | +| [`kimi`](https://github.com/MoonshotAI/kimi-code) | Moonshot Kimi CLI | `npm install -g @moonshot-ai/kimi-code` | | [`opencode`](https://github.com/sst/opencode) | OpenCode CLI | `npm install -g opencode` | | [`qwen`](https://github.com/QwenLM/qwen-code) | Alibaba Qwen Code | See [repo](https://github.com/QwenLM/qwen-code) | diff --git a/lua/sidekick/config.lua b/lua/sidekick/config.lua index d30e92e8..12e0fd45 100644 --- a/lua/sidekick/config.lua +++ b/lua/sidekick/config.lua @@ -113,6 +113,7 @@ local defaults = { cursor = {}, gemini = {}, grok = {}, + kimi = {}, opencode = {}, pi = {}, qwen = {}, diff --git a/sk/cli/kimi.lua b/sk/cli/kimi.lua new file mode 100644 index 00000000..4296ea77 --- /dev/null +++ b/sk/cli/kimi.lua @@ -0,0 +1,22 @@ +---@type sidekick.cli.Config +return { + cmd = { "kimi" }, + is_proc = "\\", + url = "https://github.com/MoonshotAI/kimi-code", + resume = { "--session" }, + continue = { "--continue" }, + format = function(text) + local Text = require("sidekick.text") + + Text.transform(text, function(str) + return str:find("[^%w/_%.%-]") and ('"' .. str .. '"') or str + end, "SidekickLocFile") + + local ret = Text.to_string(text) + + -- transform line ranges to a format that Kimi Code understands + ret = ret:gsub("@([^@]-) :L(%d+)%-L(%d+)", "@%1#L%2-%3") + + return ret + end, +}