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

Function uninstall_editor_agents

src/cli/cli.c:10341–10533  ·  view source on GitHub ↗

Remove editor agent configs (Zed, KiloCode, VS Code, OpenClaw). */

Source from the content-addressed store, hash-verified

10339
10340/* Remove editor agent configs (Zed, KiloCode, VS Code, OpenClaw). */
10341static void uninstall_editor_agents(const cbm_detected_agents_t *agents, const char *home,
10342 bool dry_run) {
10343 char installed_binary[CLI_BUF_1K];
10344 cbm_agent_installed_binary_path(home, installed_binary, sizeof(installed_binary));
10345 if (agents->zed) {
10346 char config_dir[CLI_BUF_1K];
10347 char cp[CLI_BUF_1K];
10348 char ip[CLI_BUF_1K];
10349 char skills_dir[CLI_BUF_1K];
10350 cbm_zed_config_dir(home, config_dir, sizeof(config_dir));
10351 cbm_zed_instructions_path(home, ip, sizeof(ip));
10352 snprintf(cp, sizeof(cp), "%s/settings.json", config_dir);
10353 snprintf(skills_dir, sizeof(skills_dir), "%s/.agents/skills", home);
10354 uninstall_agent_mcp_instr((mcp_uninstall_args_t){"Zed", cp, ip}, dry_run,
10355 cbm_remove_zed_mcp_owned);
10356 uninstall_agent_skill("Zed", skills_dir, dry_run);
10357 }
10358 if (agents->kilocode) {
10359 char cp[CLI_BUF_1K];
10360 char ip[CLI_BUF_1K];
10361 char ap[CLI_BUF_1K];
10362 snprintf(cp, sizeof(cp), "%s/.config/kilo/kilo.jsonc", home);
10363 snprintf(ip, sizeof(ip), "%s/.config/kilo/rules/codebase-memory-mcp.md", home);
10364 snprintf(ap, sizeof(ap), "%s/.config/kilo/agents/codebase-memory.md", home);
10365 if (!dry_run) {
10366 if (cbm_remove_kilo_mcp_owned(installed_binary, cp) != CLI_OK) {
10367 record_agent_config_error(true, "KiloCode", "mcp_uninstall", cp);
10368 }
10369 if (cbm_json_like_remove_string(cp, "instructions", ip) != CLI_OK) {
10370 record_agent_config_error(true, "KiloCode", "instruction_reference_uninstall", cp);
10371 }
10372 if (cbm_remove_instructions(ip) != CLI_OK) {
10373 record_agent_config_error(true, "KiloCode", "instructions_uninstall", ip);
10374 }
10375
10376 char legacy_cp[CLI_BUF_1K];
10377 char legacy_ip[CLI_BUF_1K];
10378#ifdef __APPLE__
10379 snprintf(legacy_cp, sizeof(legacy_cp),
10380 "%s/Library/Application Support/Code/User/globalStorage/"
10381 "kilocode.kilo-code/settings/mcp_settings.json",
10382 home);
10383#elif defined(_WIN32)
10384 snprintf(legacy_cp, sizeof(legacy_cp),
10385 "%s/AppData/Roaming/Code/User/globalStorage/"
10386 "kilocode.kilo-code/settings/mcp_settings.json",
10387 home);
10388#else
10389 snprintf(legacy_cp, sizeof(legacy_cp),
10390 "%s/.config/Code/User/globalStorage/"
10391 "kilocode.kilo-code/settings/mcp_settings.json",
10392 home);
10393#endif
10394 snprintf(legacy_ip, sizeof(legacy_ip), "%s/.kilocode/rules/codebase-memory-mcp.md",
10395 home);
10396 if (cbm_file_exists(legacy_cp) &&
10397 cbm_remove_editor_mcp_owned(installed_binary, legacy_cp) != CLI_OK) {
10398 record_agent_config_error(true, "KiloCode", "legacy_mcp_uninstall", legacy_cp);

Callers 1

cli_uninstall_activateFunction · 0.85

Calls 15

cbm_zed_config_dirFunction · 0.85
uninstall_agent_skillFunction · 0.85
cbm_remove_instructionsFunction · 0.85
cbm_file_existsFunction · 0.85

Tested by

no test coverage detected