Skip to content

Commit 7dec383

Browse files
xtatsuxclaude
andcommitted
feat(cli): add Cortex Code CLI support
Add Snowflake Cortex Code as a new AI CLI tool integration. Document how to configure Snowflake connection via setup(). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent c2bdf8c commit 7dec383

3 files changed

Lines changed: 35 additions & 0 deletions

File tree

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -728,6 +728,7 @@ Sidekick preconfigures popular AI CLIs. Run `:checkhealth sidekick` to see which
728728
| [`claude`](https://github.com/anthropics/claude-code) | Claude Code CLI | `npm install -g @anthropic-ai/claude-code` |
729729
| [`codex`](https://github.com/openai/codex) | OpenAI Codex CLI | See [OpenAI docs](https://github.com/openai/codex) |
730730
| [`copilot`](https://github.com/github/copilot-cli) | GitHub Copilot CLI | `npm install -g @githubnext/github-copilot-cli` |
731+
| [`cortex`](https://docs.snowflake.com/en/developer-guide/cortex-code/overview) | Snowflake Cortex Code | See [Snowflake docs](https://docs.snowflake.com/en/developer-guide/cortex-code/overview) |
731732
| [`crush`](https://github.com/charmbracelet/crush) | Charm's AI assistant | See [installation](https://github.com/charmbracelet/crush) |
732733
| [`cursor`](https://cursor.com/cli) | Cursor CLI agent | See [Cursor docs](https://cursor.com/cli) |
733734
| [`gemini`](https://github.com/google-gemini/gemini-cli) | Google Gemini CLI | See [repo](https://github.com/google-gemini/gemini-cli) |
@@ -738,6 +739,20 @@ Sidekick preconfigures popular AI CLIs. Run `:checkhealth sidekick` to see which
738739
> [!TIP]
739740
> After installing tools, restart Neovim or run `:Sidekick cli select` to see them available.
740741
742+
> [!TIP]
743+
> **Cortex Code** supports specifying a Snowflake connection with the `-c` option.
744+
> Configure it in your `setup()`:
745+
>
746+
> ```lua
747+
> require("sidekick").setup({
748+
> cli = {
749+
> tools = {
750+
> cortex = { cmd = { "cortex", "-c", "my_connection" } },
751+
> },
752+
> },
753+
> })
754+
> ```
755+
741756
## 🚀 Commands
742757
743758
Sidekick provides a `:Sidekick` command that allows you to interact with the plugin

lua/sidekick/config.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ local defaults = {
105105
claude = { cmd = { "claude" } },
106106
codex = { cmd = { "codex", "--enable", "web_search_request" } },
107107
copilot = { cmd = { "copilot", "--banner" } },
108+
cortex = { cmd = { "cortex" } },
108109
crush = {
109110
cmd = { "crush" },
110111
-- crush uses <a-p> for its own functionality, so we override the default

sk/cli/cortex.lua

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---@type sidekick.cli.Config
2+
return {
3+
cmd = { "cortex" },
4+
is_proc = "\\<cortex\\>",
5+
url = "https://docs.snowflake.com/en/developer-guide/cortex-code/overview",
6+
resume = { "resume" },
7+
continue = { "--continue" },
8+
format = function(text)
9+
local Text = require("sidekick.text")
10+
11+
Text.transform(text, function(str)
12+
return str:find("[^%w/_%.%-]") and ('"' .. str .. '"') or str
13+
end, "SidekickLocFile")
14+
15+
local ret = Text.to_string(text)
16+
ret = ret:gsub("@([^@]-) :L(%d+)%-L(%d+)", "@%1#L%2-%3")
17+
return ret
18+
end,
19+
}

0 commit comments

Comments
 (0)