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

Function uninstall_editor_agents

src/cli/cli.c:10800–10992  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

10798
10799/* Remove editor agent configs (Zed, KiloCode, VS Code, OpenClaw). */
10800static void uninstall_editor_agents(const cbm_detected_agents_t *agents, const char *home,
10801 bool dry_run) {
10802 char installed_binary[CLI_BUF_1K];
10803 cbm_agent_installed_binary_path(home, installed_binary, sizeof(installed_binary));
10804 if (agents->zed) {
10805 char config_dir[CLI_BUF_1K];
10806 char cp[CLI_BUF_1K];
10807 char ip[CLI_BUF_1K];
10808 char skills_dir[CLI_BUF_1K];
10809 cbm_zed_config_dir(home, config_dir, sizeof(config_dir));
10810 cbm_zed_instructions_path(home, ip, sizeof(ip));
10811 snprintf(cp, sizeof(cp), "%s/settings.json", config_dir);
10812 snprintf(skills_dir, sizeof(skills_dir), "%s/.agents/skills", home);
10813 uninstall_agent_mcp_instr((mcp_uninstall_args_t){"Zed", cp, ip}, dry_run,
10814 cbm_remove_zed_mcp_owned);
10815 uninstall_agent_skill("Zed", skills_dir, dry_run);
10816 }
10817 if (agents->kilocode) {
10818 char cp[CLI_BUF_1K];
10819 char ip[CLI_BUF_1K];
10820 char ap[CLI_BUF_1K];
10821 snprintf(cp, sizeof(cp), "%s/.config/kilo/kilo.jsonc", home);
10822 snprintf(ip, sizeof(ip), "%s/.config/kilo/rules/codebase-memory-mcp.md", home);
10823 snprintf(ap, sizeof(ap), "%s/.config/kilo/agents/codebase-memory.md", home);
10824 if (!dry_run) {
10825 if (cbm_remove_kilo_mcp_owned(installed_binary, cp) != CLI_OK) {
10826 record_agent_config_error(true, "KiloCode", "mcp_uninstall", cp);
10827 }
10828 if (cbm_json_like_remove_string(cp, "instructions", ip) != CLI_OK) {
10829 record_agent_config_error(true, "KiloCode", "instruction_reference_uninstall", cp);
10830 }
10831 if (cbm_remove_instructions(ip) != CLI_OK) {
10832 record_agent_config_error(true, "KiloCode", "instructions_uninstall", ip);
10833 }
10834
10835 char legacy_cp[CLI_BUF_1K];
10836 char legacy_ip[CLI_BUF_1K];
10837#ifdef __APPLE__
10838 snprintf(legacy_cp, sizeof(legacy_cp),
10839 "%s/Library/Application Support/Code/User/globalStorage/"
10840 "kilocode.kilo-code/settings/mcp_settings.json",
10841 home);
10842#elif defined(_WIN32)
10843 snprintf(legacy_cp, sizeof(legacy_cp),
10844 "%s/AppData/Roaming/Code/User/globalStorage/"
10845 "kilocode.kilo-code/settings/mcp_settings.json",
10846 home);
10847#else
10848 snprintf(legacy_cp, sizeof(legacy_cp),
10849 "%s/.config/Code/User/globalStorage/"
10850 "kilocode.kilo-code/settings/mcp_settings.json",
10851 home);
10852#endif
10853 snprintf(legacy_ip, sizeof(legacy_ip), "%s/.kilocode/rules/codebase-memory-mcp.md",
10854 home);
10855 if (cbm_file_exists(legacy_cp) &&
10856 cbm_remove_editor_mcp_owned(installed_binary, legacy_cp) != CLI_OK) {
10857 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