Install MCP configs for CLI-based agents (Codex, Gemini, OpenCode, Antigravity, Aider). */ Install Gemini CLI config with hooks. */
| 8441 | /* Install MCP configs for CLI-based agents (Codex, Gemini, OpenCode, Antigravity, Aider). */ |
| 8442 | /* Install Gemini CLI config with hooks. */ |
| 8443 | static void install_gemini_config(const char *home, const char *binary_path, bool dry_run) { |
| 8444 | char cp[CLI_BUF_1K]; |
| 8445 | char ip[CLI_BUF_1K]; |
| 8446 | char ap[CLI_BUF_1K]; |
| 8447 | snprintf(cp, sizeof(cp), "%s/.gemini/settings.json", home); |
| 8448 | snprintf(ip, sizeof(ip), "%s/.gemini/GEMINI.md", home); |
| 8449 | snprintf(ap, sizeof(ap), "%s/.gemini/agents/codebase-memory.md", home); |
| 8450 | install_generic_agent_config("Gemini CLI", binary_path, cp, ip, dry_run, |
| 8451 | cbm_install_editor_mcp); |
| 8452 | install_tiered_agent_profiles( |
| 8453 | (cbm_tiered_profile_set_t){ |
| 8454 | .label = "Gemini CLI", |
| 8455 | .verify_path = ap, |
| 8456 | .binary_path = binary_path, |
| 8457 | .legacy_verify_content = legacy_gemini_verify_agent_content, |
| 8458 | .dialect = CBM_GRAPH_DIALECT_GEMINI, |
| 8459 | }, |
| 8460 | dry_run); |
| 8461 | if (g_install_plan) { |
| 8462 | plan_record("Gemini CLI", "hook", cp); /* BeforeTool + SessionStart in settings.json */ |
| 8463 | return; |
| 8464 | } |
| 8465 | if (!dry_run) { |
| 8466 | if (cbm_upsert_gemini_hooks(cp) != CLI_OK) { |
| 8467 | record_agent_config_error(false, "Gemini CLI", "before_tool_hook_install", cp); |
| 8468 | } |
| 8469 | #ifndef _WIN32 |
| 8470 | if (cbm_upsert_gemini_coverage_hook(cp, binary_path) != CLI_OK) { |
| 8471 | record_agent_config_error(false, "Gemini CLI", "after_tool_hook_install", cp); |
| 8472 | } |
| 8473 | #endif |
| 8474 | if (cbm_upsert_gemini_session_hooks(cp) != CLI_OK) { |
| 8475 | record_agent_config_error(false, "Gemini CLI", "session_hook_install", cp); |
| 8476 | } |
| 8477 | } |
| 8478 | #ifdef _WIN32 |
| 8479 | printf(" hooks: BeforeTool + SessionStart; AfterTool coverage withheld (executor unknown)\n"); |
| 8480 | #else |
| 8481 | printf(" hooks: BeforeTool + AfterTool read_file + SessionStart\n"); |
| 8482 | #endif |
| 8483 | printf(" subagents: Scout + Verify + Auditor\n"); |
| 8484 | } |
| 8485 | |
| 8486 | static void install_cli_agent_configs(const cbm_detected_agents_t *agents, const char *home, |
| 8487 | const char *binary_path, bool force, bool dry_run) { |
no test coverage detected