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

Function install_editor_agent_configs

src/cli/cli.c:8869–9095  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

8867
8868/* Install MCP configs for editor-based agents (Zed, KiloCode, VS Code, OpenClaw). */
8869static void install_editor_agent_configs(const cbm_detected_agents_t *agents, const char *home,
8870 const char *binary_path, bool force, bool dry_run) {
8871 if (agents->zed) {
8872 char config_dir[CLI_BUF_1K];
8873 char cp[CLI_BUF_1K];
8874 char ip[CLI_BUF_1K];
8875 char skills_dir[CLI_BUF_1K];
8876 cbm_zed_config_dir(home, config_dir, sizeof(config_dir));
8877 cbm_zed_instructions_path(home, ip, sizeof(ip));
8878 snprintf(cp, sizeof(cp), "%s/settings.json", config_dir);
8879 snprintf(skills_dir, sizeof(skills_dir), "%s/.agents/skills", home);
8880 install_generic_agent_config("Zed", binary_path, cp, ip, dry_run, cbm_install_zed_mcp);
8881 install_agent_skill("Zed", skills_dir, force, dry_run);
8882 }
8883 if (agents->kilocode) {
8884 char cp[CLI_BUF_1K];
8885 char ip[CLI_BUF_1K];
8886 char ap[CLI_BUF_1K];
8887 snprintf(cp, sizeof(cp), "%s/.config/kilo/kilo.jsonc", home);
8888 snprintf(ip, sizeof(ip), "%s/.config/kilo/rules/codebase-memory-mcp.md", home);
8889 snprintf(ap, sizeof(ap), "%s/.config/kilo/agents/codebase-memory.md", home);
8890 install_generic_agent_config("KiloCode", binary_path, cp, ip, dry_run, cbm_upsert_kilo_mcp);
8891 install_tiered_agent_profiles(
8892 (cbm_tiered_profile_set_t){
8893 .label = "KiloCode",
8894 .verify_path = ap,
8895 .binary_path = binary_path,
8896 .legacy_verify_content = legacy_kilo_verify_agent_content,
8897 .dialect = CBM_GRAPH_DIALECT_KILO,
8898 },
8899 dry_run);
8900 if (!dry_run && !g_install_plan) {
8901 if (cbm_json_like_add_unique_string(cp, "instructions", ip) != CLI_OK) {
8902 record_agent_config_error(false, "KiloCode", "instruction_reference_install", cp);
8903 }
8904
8905 /* Migrate only the fragments owned by releases that targeted the
8906 * retired VS Code extension storage path. */
8907 char legacy_cp[CLI_BUF_1K];
8908 char legacy_ip[CLI_BUF_1K];
8909#ifdef __APPLE__
8910 snprintf(legacy_cp, sizeof(legacy_cp),
8911 "%s/Library/Application Support/Code/User/globalStorage/"
8912 "kilocode.kilo-code/settings/mcp_settings.json",
8913 home);
8914#elif defined(_WIN32)
8915 snprintf(legacy_cp, sizeof(legacy_cp),
8916 "%s/AppData/Roaming/Code/User/globalStorage/"
8917 "kilocode.kilo-code/settings/mcp_settings.json",
8918 home);
8919#else
8920 snprintf(legacy_cp, sizeof(legacy_cp),
8921 "%s/.config/Code/User/globalStorage/"
8922 "kilocode.kilo-code/settings/mcp_settings.json",
8923 home);
8924#endif
8925 snprintf(legacy_ip, sizeof(legacy_ip), "%s/.kilocode/rules/codebase-memory-mcp.md",
8926 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