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

Function install_editor_agent_configs

src/cli/cli.c:8562–8788  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

8560
8561/* Install MCP configs for editor-based agents (Zed, KiloCode, VS Code, OpenClaw). */
8562static void install_editor_agent_configs(const cbm_detected_agents_t *agents, const char *home,
8563 const char *binary_path, bool force, bool dry_run) {
8564 if (agents->zed) {
8565 char config_dir[CLI_BUF_1K];
8566 char cp[CLI_BUF_1K];
8567 char ip[CLI_BUF_1K];
8568 char skills_dir[CLI_BUF_1K];
8569 cbm_zed_config_dir(home, config_dir, sizeof(config_dir));
8570 cbm_zed_instructions_path(home, ip, sizeof(ip));
8571 snprintf(cp, sizeof(cp), "%s/settings.json", config_dir);
8572 snprintf(skills_dir, sizeof(skills_dir), "%s/.agents/skills", home);
8573 install_generic_agent_config("Zed", binary_path, cp, ip, dry_run, cbm_install_zed_mcp);
8574 install_agent_skill("Zed", skills_dir, force, dry_run);
8575 }
8576 if (agents->kilocode) {
8577 char cp[CLI_BUF_1K];
8578 char ip[CLI_BUF_1K];
8579 char ap[CLI_BUF_1K];
8580 snprintf(cp, sizeof(cp), "%s/.config/kilo/kilo.jsonc", home);
8581 snprintf(ip, sizeof(ip), "%s/.config/kilo/rules/codebase-memory-mcp.md", home);
8582 snprintf(ap, sizeof(ap), "%s/.config/kilo/agents/codebase-memory.md", home);
8583 install_generic_agent_config("KiloCode", binary_path, cp, ip, dry_run, cbm_upsert_kilo_mcp);
8584 install_tiered_agent_profiles(
8585 (cbm_tiered_profile_set_t){
8586 .label = "KiloCode",
8587 .verify_path = ap,
8588 .binary_path = binary_path,
8589 .legacy_verify_content = legacy_kilo_verify_agent_content,
8590 .dialect = CBM_GRAPH_DIALECT_KILO,
8591 },
8592 dry_run);
8593 if (!dry_run && !g_install_plan) {
8594 if (cbm_json_like_add_unique_string(cp, "instructions", ip) != CLI_OK) {
8595 record_agent_config_error(false, "KiloCode", "instruction_reference_install", cp);
8596 }
8597
8598 /* Migrate only the fragments owned by releases that targeted the
8599 * retired VS Code extension storage path. */
8600 char legacy_cp[CLI_BUF_1K];
8601 char legacy_ip[CLI_BUF_1K];
8602#ifdef __APPLE__
8603 snprintf(legacy_cp, sizeof(legacy_cp),
8604 "%s/Library/Application Support/Code/User/globalStorage/"
8605 "kilocode.kilo-code/settings/mcp_settings.json",
8606 home);
8607#elif defined(_WIN32)
8608 snprintf(legacy_cp, sizeof(legacy_cp),
8609 "%s/AppData/Roaming/Code/User/globalStorage/"
8610 "kilocode.kilo-code/settings/mcp_settings.json",
8611 home);
8612#else
8613 snprintf(legacy_cp, sizeof(legacy_cp),
8614 "%s/.config/Code/User/globalStorage/"
8615 "kilocode.kilo-code/settings/mcp_settings.json",
8616 home);
8617#endif
8618 snprintf(legacy_ip, sizeof(legacy_ip), "%s/.kilocode/rules/codebase-memory-mcp.md",
8619 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