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

Function install_editor_agent_configs

src/cli/cli.c:9998–10224  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

9996
9997/* Install MCP configs for editor-based agents (Zed, KiloCode, VS Code, OpenClaw). */
9998static void install_editor_agent_configs(const cbm_detected_agents_t *agents, const char *home,
9999 const char *binary_path, bool force, bool dry_run) {
10000 if (agents->zed) {
10001 char config_dir[CLI_BUF_1K];
10002 char cp[CLI_BUF_1K];
10003 char ip[CLI_BUF_1K];
10004 char skills_dir[CLI_BUF_1K];
10005 cbm_zed_config_dir(home, config_dir, sizeof(config_dir));
10006 cbm_zed_instructions_path(home, ip, sizeof(ip));
10007 snprintf(cp, sizeof(cp), "%s/settings.json", config_dir);
10008 snprintf(skills_dir, sizeof(skills_dir), "%s/.agents/skills", home);
10009 install_generic_agent_config("Zed", binary_path, cp, ip, dry_run, cbm_install_zed_mcp);
10010 install_agent_skill("Zed", skills_dir, force, dry_run);
10011 }
10012 if (agents->kilocode) {
10013 char cp[CLI_BUF_1K];
10014 char ip[CLI_BUF_1K];
10015 char ap[CLI_BUF_1K];
10016 snprintf(cp, sizeof(cp), "%s/.config/kilo/kilo.jsonc", home);
10017 snprintf(ip, sizeof(ip), "%s/.config/kilo/rules/codebase-memory-mcp.md", home);
10018 snprintf(ap, sizeof(ap), "%s/.config/kilo/agents/codebase-memory.md", home);
10019 install_generic_agent_config("KiloCode", binary_path, cp, ip, dry_run, cbm_upsert_kilo_mcp);
10020 install_tiered_agent_profiles(
10021 (cbm_tiered_profile_set_t){
10022 .label = "KiloCode",
10023 .verify_path = ap,
10024 .binary_path = binary_path,
10025 .legacy_verify_content = legacy_kilo_verify_agent_content,
10026 .dialect = CBM_GRAPH_DIALECT_KILO,
10027 },
10028 dry_run);
10029 if (!dry_run && !g_install_plan) {
10030 if (cbm_json_like_add_unique_string(cp, "instructions", ip) != CLI_OK) {
10031 record_agent_config_error(false, "KiloCode", "instruction_reference_install", cp);
10032 }
10033
10034 /* Migrate only the fragments owned by releases that targeted the
10035 * retired VS Code extension storage path. */
10036 char legacy_cp[CLI_BUF_1K];
10037 char legacy_ip[CLI_BUF_1K];
10038#ifdef __APPLE__
10039 snprintf(legacy_cp, sizeof(legacy_cp),
10040 "%s/Library/Application Support/Code/User/globalStorage/"
10041 "kilocode.kilo-code/settings/mcp_settings.json",
10042 home);
10043#elif defined(_WIN32)
10044 snprintf(legacy_cp, sizeof(legacy_cp),
10045 "%s/AppData/Roaming/Code/User/globalStorage/"
10046 "kilocode.kilo-code/settings/mcp_settings.json",
10047 home);
10048#else
10049 snprintf(legacy_cp, sizeof(legacy_cp),
10050 "%s/.config/Code/User/globalStorage/"
10051 "kilocode.kilo-code/settings/mcp_settings.json",
10052 home);
10053#endif
10054 snprintf(legacy_ip, sizeof(legacy_ip), "%s/.kilocode/rules/codebase-memory-mcp.md",
10055 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