Install MCP configs for CLI-based agents (Codex, Gemini, OpenCode, Antigravity, Aider). */ Install Gemini CLI config with hooks. */
| 8186 | /* Install MCP configs for CLI-based agents (Codex, Gemini, OpenCode, Antigravity, Aider). */ |
| 8187 | /* Install Gemini CLI config with hooks. */ |
| 8188 | static void install_gemini_config(const char *home, const char *binary_path, bool dry_run) { |
| 8189 | char cp[CLI_BUF_1K]; |
| 8190 | char ip[CLI_BUF_1K]; |
| 8191 | char ap[CLI_BUF_1K]; |
| 8192 | snprintf(cp, sizeof(cp), "%s/.gemini/settings.json", home); |
| 8193 | snprintf(ip, sizeof(ip), "%s/.gemini/GEMINI.md", home); |
| 8194 | snprintf(ap, sizeof(ap), "%s/.gemini/agents/codebase-memory.md", home); |
| 8195 | install_generic_agent_config("Gemini CLI", binary_path, cp, ip, dry_run, |
| 8196 | cbm_install_editor_mcp); |
| 8197 | install_tiered_agent_profiles( |
| 8198 | (cbm_tiered_profile_set_t){ |
| 8199 | .label = "Gemini CLI", |
| 8200 | .verify_path = ap, |
| 8201 | .binary_path = binary_path, |
| 8202 | .legacy_verify_content = legacy_gemini_verify_agent_content, |
| 8203 | .dialect = CBM_GRAPH_DIALECT_GEMINI, |
| 8204 | }, |
| 8205 | dry_run); |
| 8206 | if (g_install_plan) { |
| 8207 | plan_record("Gemini CLI", "hook", cp); /* BeforeTool + SessionStart in settings.json */ |
| 8208 | return; |
| 8209 | } |
| 8210 | if (!dry_run) { |
| 8211 | if (cbm_upsert_gemini_hooks(cp) != CLI_OK) { |
| 8212 | record_agent_config_error(false, "Gemini CLI", "before_tool_hook_install", cp); |
| 8213 | } |
| 8214 | #ifndef _WIN32 |
| 8215 | if (cbm_upsert_gemini_coverage_hook(cp, binary_path) != CLI_OK) { |
| 8216 | record_agent_config_error(false, "Gemini CLI", "after_tool_hook_install", cp); |
| 8217 | } |
| 8218 | #endif |
| 8219 | if (cbm_upsert_gemini_session_hooks(cp) != CLI_OK) { |
| 8220 | record_agent_config_error(false, "Gemini CLI", "session_hook_install", cp); |
| 8221 | } |
| 8222 | } |
| 8223 | #ifdef _WIN32 |
| 8224 | printf(" hooks: BeforeTool + SessionStart; AfterTool coverage withheld (executor unknown)\n"); |
| 8225 | #else |
| 8226 | printf(" hooks: BeforeTool + AfterTool read_file + SessionStart\n"); |
| 8227 | #endif |
| 8228 | printf(" subagents: Scout + Verify + Auditor\n"); |
| 8229 | } |
| 8230 | |
| 8231 | static void install_cli_agent_configs(const cbm_detected_agents_t *agents, const char *home, |
| 8232 | const char *binary_path, bool force, bool dry_run) { |
no test coverage detected