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

Function install_editor_agent_configs

src/cli/cli.c:9778–10004  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

9776
9777/* Install MCP configs for editor-based agents (Zed, KiloCode, VS Code, OpenClaw). */
9778static void install_editor_agent_configs(const cbm_detected_agents_t *agents, const char *home,
9779 const char *binary_path, bool force, bool dry_run) {
9780 if (agents->zed) {
9781 char config_dir[CLI_BUF_1K];
9782 char cp[CLI_BUF_1K];
9783 char ip[CLI_BUF_1K];
9784 char skills_dir[CLI_BUF_1K];
9785 cbm_zed_config_dir(home, config_dir, sizeof(config_dir));
9786 cbm_zed_instructions_path(home, ip, sizeof(ip));
9787 snprintf(cp, sizeof(cp), "%s/settings.json", config_dir);
9788 snprintf(skills_dir, sizeof(skills_dir), "%s/.agents/skills", home);
9789 install_generic_agent_config("Zed", binary_path, cp, ip, dry_run, cbm_install_zed_mcp);
9790 install_agent_skill("Zed", skills_dir, force, dry_run);
9791 }
9792 if (agents->kilocode) {
9793 char cp[CLI_BUF_1K];
9794 char ip[CLI_BUF_1K];
9795 char ap[CLI_BUF_1K];
9796 snprintf(cp, sizeof(cp), "%s/.config/kilo/kilo.jsonc", home);
9797 snprintf(ip, sizeof(ip), "%s/.config/kilo/rules/codebase-memory-mcp.md", home);
9798 snprintf(ap, sizeof(ap), "%s/.config/kilo/agents/codebase-memory.md", home);
9799 install_generic_agent_config("KiloCode", binary_path, cp, ip, dry_run, cbm_upsert_kilo_mcp);
9800 install_tiered_agent_profiles(
9801 (cbm_tiered_profile_set_t){
9802 .label = "KiloCode",
9803 .verify_path = ap,
9804 .binary_path = binary_path,
9805 .legacy_verify_content = legacy_kilo_verify_agent_content,
9806 .dialect = CBM_GRAPH_DIALECT_KILO,
9807 },
9808 dry_run);
9809 if (!dry_run && !g_install_plan) {
9810 if (cbm_json_like_add_unique_string(cp, "instructions", ip) != CLI_OK) {
9811 record_agent_config_error(false, "KiloCode", "instruction_reference_install", cp);
9812 }
9813
9814 /* Migrate only the fragments owned by releases that targeted the
9815 * retired VS Code extension storage path. */
9816 char legacy_cp[CLI_BUF_1K];
9817 char legacy_ip[CLI_BUF_1K];
9818#ifdef __APPLE__
9819 snprintf(legacy_cp, sizeof(legacy_cp),
9820 "%s/Library/Application Support/Code/User/globalStorage/"
9821 "kilocode.kilo-code/settings/mcp_settings.json",
9822 home);
9823#elif defined(_WIN32)
9824 snprintf(legacy_cp, sizeof(legacy_cp),
9825 "%s/AppData/Roaming/Code/User/globalStorage/"
9826 "kilocode.kilo-code/settings/mcp_settings.json",
9827 home);
9828#else
9829 snprintf(legacy_cp, sizeof(legacy_cp),
9830 "%s/.config/Code/User/globalStorage/"
9831 "kilocode.kilo-code/settings/mcp_settings.json",
9832 home);
9833#endif
9834 snprintf(legacy_ip, sizeof(legacy_ip), "%s/.kilocode/rules/codebase-memory-mcp.md",
9835 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