Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 34 additions & 1 deletion src/cli/cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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 ──────────────────────────────────────── */
Expand Down Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions src/cli/cli.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
19 changes: 19 additions & 0 deletions tests/test_cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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();
Expand Down Expand Up @@ -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) */
Expand Down