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

Function install_editor_agent_configs

src/cli/cli.c:8704–8930  ·  view source on GitHub ↗

Install MCP configs for editor-based agents (Zed, KiloCode, VS Code, OpenClaw). */

Source from the content-addressed store, hash-verified

8702
8703/* Install MCP configs for editor-based agents (Zed, KiloCode, VS Code, OpenClaw). */
8704static void install_editor_agent_configs(const cbm_detected_agents_t *agents, const char *home,
8705 const char *binary_path, bool force, bool dry_run) {
8706 if (agents->zed) {
8707 char config_dir[CLI_BUF_1K];
8708 char cp[CLI_BUF_1K];
8709 char ip[CLI_BUF_1K];
8710 char skills_dir[CLI_BUF_1K];
8711 cbm_zed_config_dir(home, config_dir, sizeof(config_dir));
8712 cbm_zed_instructions_path(home, ip, sizeof(ip));
8713 snprintf(cp, sizeof(cp), "%s/settings.json", config_dir);
8714 snprintf(skills_dir, sizeof(skills_dir), "%s/.agents/skills", home);
8715 install_generic_agent_config("Zed", binary_path, cp, ip, dry_run, cbm_install_zed_mcp);
8716 install_agent_skill("Zed", skills_dir, force, dry_run);
8717 }
8718 if (agents->kilocode) {
8719 char cp[CLI_BUF_1K];
8720 char ip[CLI_BUF_1K];
8721 char ap[CLI_BUF_1K];
8722 snprintf(cp, sizeof(cp), "%s/.config/kilo/kilo.jsonc", home);
8723 snprintf(ip, sizeof(ip), "%s/.config/kilo/rules/codebase-memory-mcp.md", home);
8724 snprintf(ap, sizeof(ap), "%s/.config/kilo/agents/codebase-memory.md", home);
8725 install_generic_agent_config("KiloCode", binary_path, cp, ip, dry_run, cbm_upsert_kilo_mcp);
8726 install_tiered_agent_profiles(
8727 (cbm_tiered_profile_set_t){
8728 .label = "KiloCode",
8729 .verify_path = ap,
8730 .binary_path = binary_path,
8731 .legacy_verify_content = legacy_kilo_verify_agent_content,
8732 .dialect = CBM_GRAPH_DIALECT_KILO,
8733 },
8734 dry_run);
8735 if (!dry_run && !g_install_plan) {
8736 if (cbm_json_like_add_unique_string(cp, "instructions", ip) != CLI_OK) {
8737 record_agent_config_error(false, "KiloCode", "instruction_reference_install", cp);
8738 }
8739
8740 /* Migrate only the fragments owned by releases that targeted the
8741 * retired VS Code extension storage path. */
8742 char legacy_cp[CLI_BUF_1K];
8743 char legacy_ip[CLI_BUF_1K];
8744#ifdef __APPLE__
8745 snprintf(legacy_cp, sizeof(legacy_cp),
8746 "%s/Library/Application Support/Code/User/globalStorage/"
8747 "kilocode.kilo-code/settings/mcp_settings.json",
8748 home);
8749#elif defined(_WIN32)
8750 snprintf(legacy_cp, sizeof(legacy_cp),
8751 "%s/AppData/Roaming/Code/User/globalStorage/"
8752 "kilocode.kilo-code/settings/mcp_settings.json",
8753 home);
8754#else
8755 snprintf(legacy_cp, sizeof(legacy_cp),
8756 "%s/.config/Code/User/globalStorage/"
8757 "kilocode.kilo-code/settings/mcp_settings.json",
8758 home);
8759#endif
8760 snprintf(legacy_ip, sizeof(legacy_ip), "%s/.kilocode/rules/codebase-memory-mcp.md",
8761 home);

Callers 1

Calls 15

cbm_zed_config_dirFunction · 0.85
install_agent_skillFunction · 0.85
cbm_file_existsFunction · 0.85
cbm_remove_instructionsFunction · 0.85
cbm_app_config_dirFunction · 0.85

Tested by

no test coverage detected