Install MCP configs for CLI-based agents (Codex, Gemini, OpenCode, Antigravity, Aider). */ Install Gemini CLI config with hooks. */
| 8594 | /* Install MCP configs for CLI-based agents (Codex, Gemini, OpenCode, Antigravity, Aider). */ |
| 8595 | /* Install Gemini CLI config with hooks. */ |
| 8596 | static void install_gemini_config(const char *home, const char *binary_path, bool dry_run) { |
| 8597 | char cp[CLI_BUF_1K]; |
| 8598 | char ip[CLI_BUF_1K]; |
| 8599 | char ap[CLI_BUF_1K]; |
| 8600 | snprintf(cp, sizeof(cp), "%s/.gemini/settings.json", home); |
| 8601 | snprintf(ip, sizeof(ip), "%s/.gemini/GEMINI.md", home); |
| 8602 | snprintf(ap, sizeof(ap), "%s/.gemini/agents/codebase-memory.md", home); |
| 8603 | install_generic_agent_config("Gemini CLI", binary_path, cp, ip, dry_run, |
| 8604 | cbm_install_editor_mcp); |
| 8605 | install_tiered_agent_profiles( |
| 8606 | (cbm_tiered_profile_set_t){ |
| 8607 | .label = "Gemini CLI", |
| 8608 | .verify_path = ap, |
| 8609 | .binary_path = binary_path, |
| 8610 | .legacy_verify_content = legacy_gemini_verify_agent_content, |
| 8611 | .dialect = CBM_GRAPH_DIALECT_GEMINI, |
| 8612 | }, |
| 8613 | dry_run); |
| 8614 | if (g_install_plan) { |
| 8615 | plan_record("Gemini CLI", "hook", cp); /* BeforeTool + SessionStart in settings.json */ |
| 8616 | return; |
| 8617 | } |
| 8618 | if (!dry_run) { |
| 8619 | if (cbm_upsert_gemini_hooks(cp) != CLI_OK) { |
| 8620 | record_agent_config_error(false, "Gemini CLI", "before_tool_hook_install", cp); |
| 8621 | } |
| 8622 | #ifndef _WIN32 |
| 8623 | if (cbm_upsert_gemini_coverage_hook(cp, binary_path) != CLI_OK) { |
| 8624 | record_agent_config_error(false, "Gemini CLI", "after_tool_hook_install", cp); |
| 8625 | } |
| 8626 | #endif |
| 8627 | if (cbm_upsert_gemini_session_hooks(cp) != CLI_OK) { |
| 8628 | record_agent_config_error(false, "Gemini CLI", "session_hook_install", cp); |
| 8629 | } |
| 8630 | } |
| 8631 | #ifdef _WIN32 |
| 8632 | printf(" hooks: BeforeTool + SessionStart; AfterTool coverage withheld (executor unknown)\n"); |
| 8633 | #else |
| 8634 | printf(" hooks: BeforeTool + AfterTool read_file + SessionStart\n"); |
| 8635 | #endif |
| 8636 | printf(" subagents: Scout + Verify + Auditor\n"); |
| 8637 | } |
| 8638 | |
| 8639 | static void install_cli_agent_configs(const cbm_detected_agents_t *agents, const char *home, |
| 8640 | const char *binary_path, bool force, bool dry_run) { |
no test coverage detected