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

Function install_editor_agent_configs

src/cli/cli.c:8642–8868  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

8640
8641/* Install MCP configs for editor-based agents (Zed, KiloCode, VS Code, OpenClaw). */
8642static void install_editor_agent_configs(const cbm_detected_agents_t *agents, const char *home,
8643 const char *binary_path, bool force, bool dry_run) {
8644 if (agents->zed) {
8645 char config_dir[CLI_BUF_1K];
8646 char cp[CLI_BUF_1K];
8647 char ip[CLI_BUF_1K];
8648 char skills_dir[CLI_BUF_1K];
8649 cbm_zed_config_dir(home, config_dir, sizeof(config_dir));
8650 cbm_zed_instructions_path(home, ip, sizeof(ip));
8651 snprintf(cp, sizeof(cp), "%s/settings.json", config_dir);
8652 snprintf(skills_dir, sizeof(skills_dir), "%s/.agents/skills", home);
8653 install_generic_agent_config("Zed", binary_path, cp, ip, dry_run, cbm_install_zed_mcp);
8654 install_agent_skill("Zed", skills_dir, force, dry_run);
8655 }
8656 if (agents->kilocode) {
8657 char cp[CLI_BUF_1K];
8658 char ip[CLI_BUF_1K];
8659 char ap[CLI_BUF_1K];
8660 snprintf(cp, sizeof(cp), "%s/.config/kilo/kilo.jsonc", home);
8661 snprintf(ip, sizeof(ip), "%s/.config/kilo/rules/codebase-memory-mcp.md", home);
8662 snprintf(ap, sizeof(ap), "%s/.config/kilo/agents/codebase-memory.md", home);
8663 install_generic_agent_config("KiloCode", binary_path, cp, ip, dry_run, cbm_upsert_kilo_mcp);
8664 install_tiered_agent_profiles(
8665 (cbm_tiered_profile_set_t){
8666 .label = "KiloCode",
8667 .verify_path = ap,
8668 .binary_path = binary_path,
8669 .legacy_verify_content = legacy_kilo_verify_agent_content,
8670 .dialect = CBM_GRAPH_DIALECT_KILO,
8671 },
8672 dry_run);
8673 if (!dry_run && !g_install_plan) {
8674 if (cbm_json_like_add_unique_string(cp, "instructions", ip) != CLI_OK) {
8675 record_agent_config_error(false, "KiloCode", "instruction_reference_install", cp);
8676 }
8677
8678 /* Migrate only the fragments owned by releases that targeted the
8679 * retired VS Code extension storage path. */
8680 char legacy_cp[CLI_BUF_1K];
8681 char legacy_ip[CLI_BUF_1K];
8682#ifdef __APPLE__
8683 snprintf(legacy_cp, sizeof(legacy_cp),
8684 "%s/Library/Application Support/Code/User/globalStorage/"
8685 "kilocode.kilo-code/settings/mcp_settings.json",
8686 home);
8687#elif defined(_WIN32)
8688 snprintf(legacy_cp, sizeof(legacy_cp),
8689 "%s/AppData/Roaming/Code/User/globalStorage/"
8690 "kilocode.kilo-code/settings/mcp_settings.json",
8691 home);
8692#else
8693 snprintf(legacy_cp, sizeof(legacy_cp),
8694 "%s/.config/Code/User/globalStorage/"
8695 "kilocode.kilo-code/settings/mcp_settings.json",
8696 home);
8697#endif
8698 snprintf(legacy_ip, sizeof(legacy_ip), "%s/.kilocode/rules/codebase-memory-mcp.md",
8699 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