Install MCP configs for CLI-based agents (Codex, Gemini, OpenCode, Antigravity, Aider). */ Install Gemini CLI config with hooks. */
| 9674 | /* Install MCP configs for CLI-based agents (Codex, Gemini, OpenCode, Antigravity, Aider). */ |
| 9675 | /* Install Gemini CLI config with hooks. */ |
| 9676 | static void install_gemini_config(const char *home, const char *binary_path, bool dry_run) { |
| 9677 | char cp[CLI_BUF_1K]; |
| 9678 | char ip[CLI_BUF_1K]; |
| 9679 | char ap[CLI_BUF_1K]; |
| 9680 | snprintf(cp, sizeof(cp), "%s/.gemini/settings.json", home); |
| 9681 | snprintf(ip, sizeof(ip), "%s/.gemini/GEMINI.md", home); |
| 9682 | snprintf(ap, sizeof(ap), "%s/.gemini/agents/codebase-memory.md", home); |
| 9683 | install_generic_agent_config("Gemini CLI", binary_path, cp, ip, dry_run, |
| 9684 | cbm_install_editor_mcp); |
| 9685 | install_tiered_agent_profiles( |
| 9686 | (cbm_tiered_profile_set_t){ |
| 9687 | .label = "Gemini CLI", |
| 9688 | .verify_path = ap, |
| 9689 | .binary_path = binary_path, |
| 9690 | .legacy_verify_content = legacy_gemini_verify_agent_content, |
| 9691 | .dialect = CBM_GRAPH_DIALECT_GEMINI, |
| 9692 | }, |
| 9693 | dry_run); |
| 9694 | if (g_install_plan) { |
| 9695 | plan_record("Gemini CLI", "hook", cp); /* BeforeTool + SessionStart in settings.json */ |
| 9696 | return; |
| 9697 | } |
| 9698 | if (!dry_run) { |
| 9699 | if (cbm_upsert_gemini_hooks(cp) != CLI_OK) { |
| 9700 | record_agent_config_error(false, "Gemini CLI", "before_tool_hook_install", cp); |
| 9701 | } |
| 9702 | #ifndef _WIN32 |
| 9703 | if (cbm_upsert_gemini_coverage_hook(cp, binary_path) != CLI_OK) { |
| 9704 | record_agent_config_error(false, "Gemini CLI", "after_tool_hook_install", cp); |
| 9705 | } |
| 9706 | #endif |
| 9707 | if (cbm_upsert_gemini_session_hooks(cp) != CLI_OK) { |
| 9708 | record_agent_config_error(false, "Gemini CLI", "session_hook_install", cp); |
| 9709 | } |
| 9710 | } |
| 9711 | #ifdef _WIN32 |
| 9712 | printf(" hooks: BeforeTool + SessionStart; AfterTool coverage withheld (executor unknown)\n"); |
| 9713 | #else |
| 9714 | printf(" hooks: BeforeTool + AfterTool read_file + SessionStart\n"); |
| 9715 | #endif |
| 9716 | printf(" subagents: Scout + Verify + Auditor\n"); |
| 9717 | } |
| 9718 | |
| 9719 | static void install_cli_agent_configs(const cbm_detected_agents_t *agents, const char *home, |
| 9720 | const char *binary_path, bool force, bool dry_run) { |
no test coverage detected