| 9146 | static void cli_clients_print_list(FILE *out); |
| 9147 | |
| 9148 | int cbm_install_agent_configs(const char *home, const char *binary_path, bool force, bool dry_run) { |
| 9149 | g_agent_install_errors = 0; |
| 9150 | cbm_detected_agents_t agents = cbm_detect_agents(home); |
| 9151 | if (g_client_selection && !cli_clients_apply_selection(g_client_selection, &agents)) { |
| 9152 | return CLI_ERR; |
| 9153 | } |
| 9154 | if (!g_install_plan) { |
| 9155 | print_detected_agents(&agents, home); |
| 9156 | } |
| 9157 | |
| 9158 | if (agents.claude_code) { |
| 9159 | install_claude_code_config(home, binary_path, force, dry_run); |
| 9160 | } |
| 9161 | install_cli_agent_configs(&agents, home, binary_path, force, dry_run); |
| 9162 | install_editor_agent_configs(&agents, home, binary_path, force, dry_run); |
| 9163 | install_additional_agent_configs(&agents, home, binary_path, force, dry_run); |
| 9164 | bool inherit_claude_session = |
| 9165 | agents.claude_code && !dry_run && cbm_has_complete_claude_session_hooks(home); |
| 9166 | install_agent_client_registry(home, binary_path, inherit_claude_session, force, dry_run); |
| 9167 | return g_agent_install_errors == 0 ? CLI_OK : CLI_ERR; |
| 9168 | } |
| 9169 | |
| 9170 | static int cbm_install_agent_configs_with_previous(const char *home, const char *binary_path, |
| 9171 | const char *previous_managed_binary_path, |
no test coverage detected