Install MCP configs for CLI-based agents (Codex, Gemini, OpenCode, Antigravity, Aider). */ Install Gemini CLI config with hooks. */
| 8292 | /* Install MCP configs for CLI-based agents (Codex, Gemini, OpenCode, Antigravity, Aider). */ |
| 8293 | /* Install Gemini CLI config with hooks. */ |
| 8294 | static void install_gemini_config(const char *home, const char *binary_path, bool dry_run) { |
| 8295 | char cp[CLI_BUF_1K]; |
| 8296 | char ip[CLI_BUF_1K]; |
| 8297 | char ap[CLI_BUF_1K]; |
| 8298 | snprintf(cp, sizeof(cp), "%s/.gemini/settings.json", home); |
| 8299 | snprintf(ip, sizeof(ip), "%s/.gemini/GEMINI.md", home); |
| 8300 | snprintf(ap, sizeof(ap), "%s/.gemini/agents/codebase-memory.md", home); |
| 8301 | install_generic_agent_config("Gemini CLI", binary_path, cp, ip, dry_run, |
| 8302 | cbm_install_editor_mcp); |
| 8303 | install_tiered_agent_profiles( |
| 8304 | (cbm_tiered_profile_set_t){ |
| 8305 | .label = "Gemini CLI", |
| 8306 | .verify_path = ap, |
| 8307 | .binary_path = binary_path, |
| 8308 | .legacy_verify_content = legacy_gemini_verify_agent_content, |
| 8309 | .dialect = CBM_GRAPH_DIALECT_GEMINI, |
| 8310 | }, |
| 8311 | dry_run); |
| 8312 | if (g_install_plan) { |
| 8313 | plan_record("Gemini CLI", "hook", cp); /* BeforeTool + SessionStart in settings.json */ |
| 8314 | return; |
| 8315 | } |
| 8316 | if (!dry_run) { |
| 8317 | if (cbm_upsert_gemini_hooks(cp) != CLI_OK) { |
| 8318 | record_agent_config_error(false, "Gemini CLI", "before_tool_hook_install", cp); |
| 8319 | } |
| 8320 | #ifndef _WIN32 |
| 8321 | if (cbm_upsert_gemini_coverage_hook(cp, binary_path) != CLI_OK) { |
| 8322 | record_agent_config_error(false, "Gemini CLI", "after_tool_hook_install", cp); |
| 8323 | } |
| 8324 | #endif |
| 8325 | if (cbm_upsert_gemini_session_hooks(cp) != CLI_OK) { |
| 8326 | record_agent_config_error(false, "Gemini CLI", "session_hook_install", cp); |
| 8327 | } |
| 8328 | } |
| 8329 | #ifdef _WIN32 |
| 8330 | printf(" hooks: BeforeTool + SessionStart; AfterTool coverage withheld (executor unknown)\n"); |
| 8331 | #else |
| 8332 | printf(" hooks: BeforeTool + AfterTool read_file + SessionStart\n"); |
| 8333 | #endif |
| 8334 | printf(" subagents: Scout + Verify + Auditor\n"); |
| 8335 | } |
| 8336 | |
| 8337 | static void install_cli_agent_configs(const cbm_detected_agents_t *agents, const char *home, |
| 8338 | const char *binary_path, bool force, bool dry_run) { |
no test coverage detected