Skip to content

Commit 404b5f8

Browse files
testdLo999
andcommitted
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, and test. Based on #174 by dLo999, rebased onto refactored install infrastructure. Co-Authored-By: Dustin Obrecht <dustin@kurtnoble.com>
1 parent 8babe67 commit 404b5f8

File tree

5 files changed

+46
-2
lines changed

5 files changed

+46
-2
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ High-quality parsing through [tree-sitter](https://tree-sitter.github.io/tree-si
3333
- **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.
3434
- **66 languages** — vendored tree-sitter grammars compiled into the binary. Nothing to install, nothing that breaks.
3535
- **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.
36-
- **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.
36+
- **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.
3737
- **Built-in graph visualization** — 3D interactive UI at `localhost:9749` (optional UI binary variant).
3838
- **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.
3939
- **14 MCP tools** — search, trace, architecture, impact analysis, Cypher queries, dead code detection, cross-service HTTP linking, ADR management, and more.
@@ -281,6 +281,7 @@ Restart your agent. Verify with `/mcp` — you should see `codebase-memory-mcp`
281281
| KiloCode | `mcp_settings.json` | `~/.kilocode/rules/` ||
282282
| VS Code | `Code/User/mcp.json` |||
283283
| OpenClaw | `openclaw.json` |||
284+
| Kiro | `.kiro/settings/mcp.json` |||
284285

285286
**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.
286287

src/cli/cli.c

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,6 +1029,10 @@ cbm_detected_agents_t cbm_detect_agents(const char *home_dir) {
10291029
snprintf(path, sizeof(path), "%s/.openclaw", home_dir);
10301030
agents.openclaw = dir_exists(path);
10311031

1032+
/* Kiro: ~/.kiro/ */
1033+
snprintf(path, sizeof(path), "%s/.kiro", home_dir);
1034+
agents.kiro = dir_exists(path);
1035+
10321036
return agents;
10331037
}
10341038

@@ -2602,6 +2606,7 @@ static void print_detected_agents(const cbm_detected_agents_t *a) {
26022606
{a->kilocode, "KiloCode"},
26032607
{a->vscode, "VS-Code"},
26042608
{a->openclaw, "OpenClaw"},
2609+
{a->kiro, "Kiro"},
26052610
};
26062611
printf("Detected agents:");
26072612
bool any = false;
@@ -2777,6 +2782,17 @@ static void install_editor_agent_configs(const cbm_detected_agents_t *agents, co
27772782
install_generic_agent_config("OpenClaw", binary_path, cp, NULL, dry_run,
27782783
cbm_install_editor_mcp);
27792784
}
2785+
if (agents->kiro) {
2786+
char cp[CLI_BUF_1K];
2787+
char sd[CLI_BUF_1K];
2788+
snprintf(cp, sizeof(cp), "%s/.kiro/settings/mcp.json", home);
2789+
snprintf(sd, sizeof(sd), "%s/.kiro/settings", home);
2790+
if (!dry_run) {
2791+
cbm_mkdir_p(sd, CLI_OCTAL_PERM);
2792+
}
2793+
install_generic_agent_config("Kiro", binary_path, cp, NULL, dry_run,
2794+
cbm_install_editor_mcp);
2795+
}
27802796
}
27812797

27822798
static void cbm_install_agent_configs(const char *home, const char *binary_path, bool force,
@@ -3081,6 +3097,12 @@ static void uninstall_editor_agents(const cbm_detected_agents_t *agents, const c
30813097
uninstall_agent_mcp_instr((mcp_uninstall_args_t){"OpenClaw", cp, NULL}, dry_run,
30823098
cbm_remove_editor_mcp);
30833099
}
3100+
if (agents->kiro) {
3101+
char cp[CLI_BUF_1K];
3102+
snprintf(cp, sizeof(cp), "%s/.kiro/settings/mcp.json", home);
3103+
uninstall_agent_mcp_instr((mcp_uninstall_args_t){"Kiro", cp, NULL}, dry_run,
3104+
cbm_remove_editor_mcp);
3105+
}
30843106
}
30853107

30863108
int cbm_cmd_uninstall(int argc, char **argv) {

src/cli/cli.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ typedef struct {
120120
bool kilocode; /* KiloCode globalStorage dir exists */
121121
bool vscode; /* VS Code User config dir exists */
122122
bool openclaw; /* ~/.openclaw/ exists */
123+
bool kiro; /* ~/.kiro/ exists */
123124
} cbm_detected_agents_t;
124125

125126
/* Detect which coding agents are installed.

src/main.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,8 @@ static void print_help(void) {
249249
printf(" --ui=false Disable HTTP graph visualization (persisted)\n");
250250
printf(" --port=N Set UI port (default 9749, persisted)\n");
251251
printf("\nSupported agents (auto-detected):\n");
252-
printf(" Claude Code, Codex CLI, Gemini CLI, Zed, OpenCode, Antigravity, Aider, KiloCode\n");
252+
printf(" Claude Code, Codex CLI, Gemini CLI, Zed, OpenCode,\n");
253+
printf(" Antigravity, Aider, KiloCode, Kiro\n");
253254
printf("\nTools: index_repository, search_graph, query_graph, trace_path,\n");
254255
printf(" get_code_snippet, get_graph_schema, get_architecture, search_code,\n");
255256
printf(" list_projects, delete_project, index_status, detect_changes,\n");

tests/test_cli.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1495,6 +1495,23 @@ TEST(cli_detect_agents_finds_kilocode) {
14951495
PASS();
14961496
}
14971497

1498+
TEST(cli_detect_agents_finds_kiro) {
1499+
char tmpdir[256];
1500+
snprintf(tmpdir, sizeof(tmpdir), "/tmp/cli-detect-XXXXXX");
1501+
if (!cbm_mkdtemp(tmpdir))
1502+
SKIP("cbm_mkdtemp failed");
1503+
1504+
char dir[512];
1505+
snprintf(dir, sizeof(dir), "%s/.kiro", tmpdir);
1506+
test_mkdirp(dir);
1507+
1508+
cbm_detected_agents_t agents = cbm_detect_agents(tmpdir);
1509+
ASSERT_TRUE(agents.kiro);
1510+
1511+
test_rmdir_r(tmpdir);
1512+
PASS();
1513+
}
1514+
14981515
TEST(cli_detect_agents_none_found) {
14991516
char tmpdir[256];
15001517
snprintf(tmpdir, sizeof(tmpdir), "/tmp/cli-detect-XXXXXX");
@@ -1511,6 +1528,7 @@ TEST(cli_detect_agents_none_found) {
15111528
ASSERT_FALSE(agents.zed);
15121529
ASSERT_FALSE(agents.antigravity);
15131530
ASSERT_FALSE(agents.kilocode);
1531+
ASSERT_FALSE(agents.kiro);
15141532

15151533
rmdir(tmpdir);
15161534
PASS();
@@ -2425,6 +2443,7 @@ SUITE(cli) {
24252443
RUN_TEST(cli_detect_agents_finds_zed);
24262444
RUN_TEST(cli_detect_agents_finds_antigravity);
24272445
RUN_TEST(cli_detect_agents_finds_kilocode);
2446+
RUN_TEST(cli_detect_agents_finds_kiro);
24282447
RUN_TEST(cli_detect_agents_none_found);
24292448

24302449
/* Codex MCP config upsert (3 tests — group B) */

0 commit comments

Comments
 (0)