Install MCP configs for CLI-based agents (Codex, Gemini, OpenCode, Antigravity, Aider). */ Install Gemini CLI config with hooks. */
| 8379 | /* Install MCP configs for CLI-based agents (Codex, Gemini, OpenCode, Antigravity, Aider). */ |
| 8380 | /* Install Gemini CLI config with hooks. */ |
| 8381 | static void install_gemini_config(const char *home, const char *binary_path, bool dry_run) { |
| 8382 | char cp[CLI_BUF_1K]; |
| 8383 | char ip[CLI_BUF_1K]; |
| 8384 | char ap[CLI_BUF_1K]; |
| 8385 | snprintf(cp, sizeof(cp), "%s/.gemini/settings.json", home); |
| 8386 | snprintf(ip, sizeof(ip), "%s/.gemini/GEMINI.md", home); |
| 8387 | snprintf(ap, sizeof(ap), "%s/.gemini/agents/codebase-memory.md", home); |
| 8388 | install_generic_agent_config("Gemini CLI", binary_path, cp, ip, dry_run, |
| 8389 | cbm_install_editor_mcp); |
| 8390 | install_tiered_agent_profiles( |
| 8391 | (cbm_tiered_profile_set_t){ |
| 8392 | .label = "Gemini CLI", |
| 8393 | .verify_path = ap, |
| 8394 | .binary_path = binary_path, |
| 8395 | .legacy_verify_content = legacy_gemini_verify_agent_content, |
| 8396 | .dialect = CBM_GRAPH_DIALECT_GEMINI, |
| 8397 | }, |
| 8398 | dry_run); |
| 8399 | if (g_install_plan) { |
| 8400 | plan_record("Gemini CLI", "hook", cp); /* BeforeTool + SessionStart in settings.json */ |
| 8401 | return; |
| 8402 | } |
| 8403 | if (!dry_run) { |
| 8404 | if (cbm_upsert_gemini_hooks(cp) != CLI_OK) { |
| 8405 | record_agent_config_error(false, "Gemini CLI", "before_tool_hook_install", cp); |
| 8406 | } |
| 8407 | #ifndef _WIN32 |
| 8408 | if (cbm_upsert_gemini_coverage_hook(cp, binary_path) != CLI_OK) { |
| 8409 | record_agent_config_error(false, "Gemini CLI", "after_tool_hook_install", cp); |
| 8410 | } |
| 8411 | #endif |
| 8412 | if (cbm_upsert_gemini_session_hooks(cp) != CLI_OK) { |
| 8413 | record_agent_config_error(false, "Gemini CLI", "session_hook_install", cp); |
| 8414 | } |
| 8415 | } |
| 8416 | #ifdef _WIN32 |
| 8417 | printf(" hooks: BeforeTool + SessionStart; AfterTool coverage withheld (executor unknown)\n"); |
| 8418 | #else |
| 8419 | printf(" hooks: BeforeTool + AfterTool read_file + SessionStart\n"); |
| 8420 | #endif |
| 8421 | printf(" subagents: Scout + Verify + Auditor\n"); |
| 8422 | } |
| 8423 | |
| 8424 | static void install_cli_agent_configs(const cbm_detected_agents_t *agents, const char *home, |
| 8425 | const char *binary_path, bool force, bool dry_run) { |
no test coverage detected