From 083d137de0982204809171140e3a5fd4d2ab82ed Mon Sep 17 00:00:00 2001 From: Dustin Date: Sun, 29 Mar 2026 01:03:57 -0700 Subject: [PATCH 1/2] feat: add Kiro CLI support (#96) Detect ~/.kiro/ directory, auto-configure MCP at ~/.kiro/settings/mcp.json using standard mcpServers format. Adds install, uninstall, detection test. Co-Authored-By: Claude Opus 4.6 (1M context) --- src/cli/cli.c | 35 ++++++++++++++++++++++++++++++++++- src/cli/cli.h | 1 + src/main.c | 2 +- tests/test_cli.c | 19 +++++++++++++++++++ 4 files changed, 55 insertions(+), 2 deletions(-) diff --git a/src/cli/cli.c b/src/cli/cli.c index fb965d9b..fd28764d 100644 --- a/src/cli/cli.c +++ b/src/cli/cli.c @@ -950,6 +950,12 @@ cbm_detected_agents_t cbm_detect_agents(const char *home_dir) { agents.openclaw = true; } + /* Kiro: ~/.kiro/ */ + snprintf(path, sizeof(path), "%s/.kiro", home_dir); + if (stat(path, &st) == 0 && S_ISDIR(st.st_mode)) { + agents.kiro = true; + } + return agents; } @@ -2420,9 +2426,12 @@ static void cbm_install_agent_configs(const char *home, const char *binary_path, if (agents.openclaw) { printf(" OpenClaw"); } + if (agents.kiro) { + printf(" Kiro"); + } if (!agents.claude_code && !agents.codex && !agents.gemini && !agents.zed && !agents.opencode && !agents.antigravity && !agents.aider && !agents.kilocode && !agents.vscode && - !agents.openclaw) { + !agents.openclaw && !agents.kiro) { printf(" (none)"); } printf("\n\n"); @@ -2613,6 +2622,21 @@ static void cbm_install_agent_configs(const char *home, const char *binary_path, } printf(" mcp: %s\n", config_path); } + + /* Kiro */ + if (agents.kiro) { + char mcp_path[1024]; + snprintf(mcp_path, sizeof(mcp_path), "%s/.kiro/settings/mcp.json", home); + if (!dry_run) { + /* Ensure ~/.kiro/settings/ directory exists */ + char settings_dir[1024]; + snprintf(settings_dir, sizeof(settings_dir), "%s/.kiro/settings", home); + cbm_mkdir_p(settings_dir, 0755); + cbm_install_editor_mcp(binary_path, mcp_path); + } + printf("Kiro:\n"); + printf(" mcp: %s\n", mcp_path); + } } /* ── Subcommand: install ──────────────────────────────────────── */ @@ -2904,6 +2928,15 @@ int cbm_cmd_uninstall(int argc, char **argv) { printf("OpenClaw: removed MCP config entry\n"); } + if (agents.kiro) { + char mcp_path[1024]; + snprintf(mcp_path, sizeof(mcp_path), "%s/.kiro/settings/mcp.json", home); + if (!dry_run) { + cbm_remove_editor_mcp(mcp_path); + } + printf("Kiro: removed MCP config entry\n"); + } + /* Step 2: Remove indexes */ int index_count = 0; const char *cache_dir = get_cache_dir(home); diff --git a/src/cli/cli.h b/src/cli/cli.h index efa022e7..d526ba04 100644 --- a/src/cli/cli.h +++ b/src/cli/cli.h @@ -118,6 +118,7 @@ typedef struct { bool antigravity; /* ~/.gemini/antigravity/ exists */ bool aider; /* aider on PATH */ bool kilocode; /* KiloCode globalStorage dir exists */ + bool kiro; /* ~/.kiro/ exists */ bool vscode; /* VS Code User config dir exists */ bool openclaw; /* ~/.openclaw/ exists */ } cbm_detected_agents_t; diff --git a/src/main.c b/src/main.c index 800f9ab7..d4de9d07 100644 --- a/src/main.c +++ b/src/main.c @@ -147,7 +147,7 @@ static void print_help(void) { printf(" --ui=false Disable HTTP graph visualization (persisted)\n"); printf(" --port=N Set UI port (default 9749, persisted)\n"); printf("\nSupported agents (auto-detected):\n"); - printf(" Claude Code, Codex CLI, Gemini CLI, Zed, OpenCode, Antigravity, Aider, KiloCode\n"); + printf(" Claude Code, Codex CLI, Gemini CLI, Zed, OpenCode, Antigravity, Aider, KiloCode, Kiro\n"); printf("\nTools: index_repository, search_graph, query_graph, trace_path,\n"); printf(" get_code_snippet, get_graph_schema, get_architecture, search_code,\n"); printf(" list_projects, delete_project, index_status, detect_changes,\n"); diff --git a/tests/test_cli.c b/tests/test_cli.c index 61cfae48..bc19fff1 100644 --- a/tests/test_cli.c +++ b/tests/test_cli.c @@ -1493,6 +1493,23 @@ TEST(cli_detect_agents_finds_kilocode) { PASS(); } +TEST(cli_detect_agents_finds_kiro) { + char tmpdir[256]; + snprintf(tmpdir, sizeof(tmpdir), "/tmp/cli-detect-XXXXXX"); + if (!cbm_mkdtemp(tmpdir)) + SKIP("cbm_mkdtemp failed"); + + char dir[512]; + snprintf(dir, sizeof(dir), "%s/.kiro", tmpdir); + test_mkdirp(dir); + + cbm_detected_agents_t agents = cbm_detect_agents(tmpdir); + ASSERT_TRUE(agents.kiro); + + test_rmdir_r(tmpdir); + PASS(); +} + TEST(cli_detect_agents_none_found) { char tmpdir[256]; snprintf(tmpdir, sizeof(tmpdir), "/tmp/cli-detect-XXXXXX"); @@ -1509,6 +1526,7 @@ TEST(cli_detect_agents_none_found) { ASSERT_FALSE(agents.zed); ASSERT_FALSE(agents.antigravity); ASSERT_FALSE(agents.kilocode); + ASSERT_FALSE(agents.kiro); rmdir(tmpdir); PASS(); @@ -2423,6 +2441,7 @@ SUITE(cli) { RUN_TEST(cli_detect_agents_finds_zed); RUN_TEST(cli_detect_agents_finds_antigravity); RUN_TEST(cli_detect_agents_finds_kilocode); + RUN_TEST(cli_detect_agents_finds_kiro); RUN_TEST(cli_detect_agents_none_found); /* Codex MCP config upsert (3 tests — group B) */ From 012942ee14e9e9e82bf0aa1cf1c745a1eb9f0708 Mon Sep 17 00:00:00 2001 From: Dustin Date: Sun, 29 Mar 2026 02:26:17 -0700 Subject: [PATCH 2/2] docs: add Kiro to README multi-agent table and count Co-Authored-By: Claude Opus 4.6 (1M context) --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 71cea408..8ea504d4 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ High-quality parsing through [tree-sitter](https://tree-sitter.github.io/tree-si - **Plug and play** — single static binary for macOS (arm64/amd64), Linux (arm64/amd64), and Windows (amd64). No Docker, no runtime dependencies, no API keys. Download → `install` → restart agent → done. - **66 languages** — vendored tree-sitter grammars compiled into the binary. Nothing to install, nothing that breaks. - **120x fewer tokens** — 5 structural queries: ~3,400 tokens vs ~412,000 via file-by-file search. One graph query replaces dozens of grep/read cycles. -- **10 agents, one command** — `install` auto-detects Claude Code, Codex CLI, Gemini CLI, Zed, OpenCode, Antigravity, Aider, KiloCode, VS Code, and OpenClaw — configures MCP entries, instruction files, and pre-tool hooks for each. +- **11 agents, one command** — `install` auto-detects Claude Code, Codex CLI, Gemini CLI, Zed, OpenCode, Antigravity, Aider, KiloCode, VS Code, OpenClaw, and Kiro — configures MCP entries, instruction files, and pre-tool hooks for each. - **Built-in graph visualization** — 3D interactive UI at `localhost:9749` (optional UI binary variant). - **Infrastructure-as-code indexing** — Dockerfiles, Kubernetes manifests, and Kustomize overlays indexed as graph nodes with cross-references. `Resource` nodes for K8s kinds, `Module` nodes for Kustomize overlays with `IMPORTS` edges to referenced resources. - **14 MCP tools** — search, trace, architecture, impact analysis, Cypher queries, dead code detection, cross-service HTTP linking, ADR management, and more. @@ -266,6 +266,7 @@ Restart your agent. Verify with `/mcp` — you should see `codebase-memory-mcp` | KiloCode | `mcp_settings.json` | `~/.kilocode/rules/` | — | | VS Code | `Code/User/mcp.json` | — | — | | OpenClaw | `openclaw.json` | — | — | +| Kiro | `.kiro/settings/mcp.json` | — | — | **Hooks** are advisory (exit code 0) — they remind agents to prefer MCP graph tools when they reach for grep/glob/read, without blocking the tool call.