MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / cbm_detect_agents

Function cbm_detect_agents

src/cli/cli.c:3168–3303  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3166}
3167
3168cbm_detected_agents_t cbm_detect_agents(const char *home_dir) {
3169 cbm_detected_agents_t agents;
3170 memset(&agents, 0, sizeof(agents));
3171 if (!home_dir || !home_dir[0]) {
3172 return agents;
3173 }
3174
3175 char path[CLI_BUF_1K];
3176
3177 agents.claude_code = cbm_claude_code_detected(home_dir);
3178
3179 cbm_codex_config_dir(home_dir, path, sizeof(path));
3180 agents.codex = path[0] != '\0' && dir_exists(path);
3181
3182 snprintf(path, sizeof(path), "%s/.gemini/antigravity-cli", home_dir);
3183 agents.antigravity = dir_exists(path) || cbm_agent_cli_exists("antigravity", home_dir);
3184
3185 snprintf(path, sizeof(path), "%s/.gemini/settings.json", home_dir);
3186 agents.gemini = cbm_file_exists(path) || cbm_agent_cli_exists("gemini", home_dir);
3187
3188 cbm_zed_config_dir(home_dir, path, sizeof(path));
3189 agents.zed = dir_exists(path);
3190
3191 agents.opencode = cbm_opencode_detected(home_dir);
3192
3193 agents.aider = cbm_agent_cli_exists("aider", home_dir);
3194
3195#ifdef __APPLE__
3196 snprintf(path, sizeof(path),
3197 "%s/Library/Application Support/Code/User/globalStorage/kilocode.kilo-code", home_dir);
3198#elif defined(_WIN32)
3199 snprintf(path, sizeof(path), "%s/AppData/Roaming/Code/User/globalStorage/kilocode.kilo-code",
3200 home_dir);
3201#else
3202 snprintf(path, sizeof(path), "%s/.config/Code/User/globalStorage/kilocode.kilo-code", home_dir);
3203#endif
3204 agents.kilocode = dir_exists(path);
3205 snprintf(path, sizeof(path), "%s/.config/kilo", home_dir);
3206 agents.kilocode = agents.kilocode || dir_exists(path) || cbm_agent_cli_exists("kilo", home_dir);
3207
3208#ifdef __APPLE__
3209 snprintf(path, sizeof(path), "%s/Library/Application Support/Code/User", home_dir);
3210#elif defined(_WIN32)
3211 snprintf(path, sizeof(path), "%s/AppData/Roaming/Code/User", home_dir);
3212#else
3213 snprintf(path, sizeof(path), "%s/.config/Code/User", home_dir);
3214#endif
3215 agents.vscode = dir_exists(path);
3216
3217 /* Cursor stores its user MCP config in ~/.cursor/mcp.json on all platforms. */
3218 snprintf(path, sizeof(path), "%s/.cursor", home_dir);
3219 agents.cursor = dir_exists(path);
3220
3221 snprintf(path, sizeof(path), "%s/.codeium/windsurf", home_dir);
3222 agents.windsurf = dir_exists(path);
3223
3224 snprintf(path, sizeof(path), "%s/.augment", home_dir);
3225 agents.augment = dir_exists(path) || cbm_agent_cli_exists("auggie", home_dir);

Callers 6

cbm_cmd_installFunction · 0.85
cbm_cmd_uninstallFunction · 0.85
test_cli.cFile · 0.85
repro_issue431.cFile · 0.85

Calls 15

cbm_claude_code_detectedFunction · 0.85
cbm_codex_config_dirFunction · 0.85
dir_existsFunction · 0.85
cbm_agent_cli_existsFunction · 0.85
cbm_file_existsFunction · 0.85
cbm_zed_config_dirFunction · 0.85
cbm_opencode_detectedFunction · 0.85
cbm_openclaw_config_pathFunction · 0.85
cbm_openclaw_state_dirFunction · 0.85
cbm_kiro_home_dirFunction · 0.85
cbm_hermes_home_dirFunction · 0.85
cbm_cline_root_dirFunction · 0.85

Tested by

no test coverage detected