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

Function install_agent_client_registry

src/cli/cli.c:8522–8592  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8520}
8521
8522static void install_agent_client_registry(const char *home, const char *binary_path,
8523 bool inherit_claude_session, bool force, bool dry_run) {
8524 cbm_agent_registry_context_t registry;
8525 cbm_init_agent_registry_context(home, &registry);
8526 for (size_t index = 0U; index < cbm_agent_client_count(); index++) {
8527 const cbm_agent_client_profile_t *profile = cbm_agent_client_at(index);
8528 if (!profile || !cbm_agent_client_detect(profile->id, &registry.options)) {
8529 continue;
8530 }
8531 if (!g_install_plan) {
8532 printf("%s:\n", profile->display_name);
8533 }
8534
8535 char config_path[CLI_BUF_1K] = {0};
8536 bool config_resolved = false;
8537 if ((profile->capabilities & CBM_AGENT_CAP_MCP) != 0U) {
8538 int resolved = cbm_agent_client_resolve_path(profile->id, &registry.options,
8539 config_path, sizeof(config_path));
8540 if (resolved != 0 || !profile->install_mcp) {
8541 record_agent_config_error(false, profile->display_name, "mcp_resolve",
8542 profile->stable_id);
8543 } else if (g_install_plan) {
8544 config_resolved = true;
8545 plan_record(profile->display_name, "mcp_config", config_path);
8546 } else {
8547 config_resolved = true;
8548 int edit_result = CBM_AGENT_EDIT_OK;
8549 if (!dry_run) {
8550 edit_result = prepare_config_parent(config_path)
8551 ? profile->install_mcp(profile->id, config_path, binary_path)
8552 : CBM_AGENT_EDIT_ERROR;
8553 }
8554 if (edit_result == CBM_AGENT_EDIT_FOREIGN) {
8555 record_agent_config_error(false, profile->display_name, "mcp_foreign",
8556 config_path);
8557 } else if (edit_result != CBM_AGENT_EDIT_OK) {
8558 record_agent_config_error(false, profile->display_name, "mcp_install",
8559 config_path);
8560 } else {
8561 printf(" mcp: %s\n", config_path);
8562 }
8563 }
8564 }
8565
8566 if (profile->id == CBM_AGENT_CLIENT_QODER) {
8567 install_qoder_durable_context(home, binary_path, config_path, config_resolved, force,
8568 dry_run);
8569 } else if (profile->id == CBM_AGENT_CLIENT_KIMI) {
8570 install_kimi_durable_context(&registry, binary_path, force, dry_run);
8571 } else if (profile->id == CBM_AGENT_CLIENT_GITLAB_DUO) {
8572 install_gitlab_durable_context(&registry, binary_path, dry_run);
8573 } else if (profile->id == CBM_AGENT_CLIENT_ROVO_DEV) {
8574 install_rovo_durable_context(home, force, dry_run);
8575 } else if (profile->id == CBM_AGENT_CLIENT_AMP) {
8576 install_amp_durable_context(home, force, dry_run);
8577 } else if (profile->id == CBM_AGENT_CLIENT_DEVIN) {
8578 install_devin_durable_context(&registry, binary_path, config_path, config_resolved,
8579 inherit_claude_session, force, dry_run);

Callers 1

Calls 15

cbm_agent_client_countFunction · 0.85
cbm_agent_client_atFunction · 0.85
cbm_agent_client_detectFunction · 0.85
plan_recordFunction · 0.85
prepare_config_parentFunction · 0.85

Tested by

no test coverage detected