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

Function uninstall_editor_agents

src/cli/cli.c:10862–11054  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

10860
10861/* Remove editor agent configs (Zed, KiloCode, VS Code, OpenClaw). */
10862static void uninstall_editor_agents(const cbm_detected_agents_t *agents, const char *home,
10863 bool dry_run) {
10864 char installed_binary[CLI_BUF_1K];
10865 cbm_agent_installed_binary_path(home, installed_binary, sizeof(installed_binary));
10866 if (agents->zed) {
10867 char config_dir[CLI_BUF_1K];
10868 char cp[CLI_BUF_1K];
10869 char ip[CLI_BUF_1K];
10870 char skills_dir[CLI_BUF_1K];
10871 cbm_zed_config_dir(home, config_dir, sizeof(config_dir));
10872 cbm_zed_instructions_path(home, ip, sizeof(ip));
10873 snprintf(cp, sizeof(cp), "%s/settings.json", config_dir);
10874 snprintf(skills_dir, sizeof(skills_dir), "%s/.agents/skills", home);
10875 uninstall_agent_mcp_instr((mcp_uninstall_args_t){"Zed", cp, ip}, dry_run,
10876 cbm_remove_zed_mcp_owned);
10877 uninstall_agent_skill("Zed", skills_dir, dry_run);
10878 }
10879 if (agents->kilocode) {
10880 char cp[CLI_BUF_1K];
10881 char ip[CLI_BUF_1K];
10882 char ap[CLI_BUF_1K];
10883 snprintf(cp, sizeof(cp), "%s/.config/kilo/kilo.jsonc", home);
10884 snprintf(ip, sizeof(ip), "%s/.config/kilo/rules/codebase-memory-mcp.md", home);
10885 snprintf(ap, sizeof(ap), "%s/.config/kilo/agents/codebase-memory.md", home);
10886 if (!dry_run) {
10887 if (cbm_remove_kilo_mcp_owned(installed_binary, cp) != CLI_OK) {
10888 record_agent_config_error(true, "KiloCode", "mcp_uninstall", cp);
10889 }
10890 if (cbm_json_like_remove_string(cp, "instructions", ip) != CLI_OK) {
10891 record_agent_config_error(true, "KiloCode", "instruction_reference_uninstall", cp);
10892 }
10893 if (cbm_remove_instructions(ip) != CLI_OK) {
10894 record_agent_config_error(true, "KiloCode", "instructions_uninstall", ip);
10895 }
10896
10897 char legacy_cp[CLI_BUF_1K];
10898 char legacy_ip[CLI_BUF_1K];
10899#ifdef __APPLE__
10900 snprintf(legacy_cp, sizeof(legacy_cp),
10901 "%s/Library/Application Support/Code/User/globalStorage/"
10902 "kilocode.kilo-code/settings/mcp_settings.json",
10903 home);
10904#elif defined(_WIN32)
10905 snprintf(legacy_cp, sizeof(legacy_cp),
10906 "%s/AppData/Roaming/Code/User/globalStorage/"
10907 "kilocode.kilo-code/settings/mcp_settings.json",
10908 home);
10909#else
10910 snprintf(legacy_cp, sizeof(legacy_cp),
10911 "%s/.config/Code/User/globalStorage/"
10912 "kilocode.kilo-code/settings/mcp_settings.json",
10913 home);
10914#endif
10915 snprintf(legacy_ip, sizeof(legacy_ip), "%s/.kilocode/rules/codebase-memory-mcp.md",
10916 home);
10917 if (cbm_file_exists(legacy_cp) &&
10918 cbm_remove_editor_mcp_owned(installed_binary, legacy_cp) != CLI_OK) {
10919 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