Skip to content

Package Gemini CLI as a built-in agent#140

Merged
JAORMX merged 1 commit intomainfrom
add-gemini-cli-agent
May 4, 2026
Merged

Package Gemini CLI as a built-in agent#140
JAORMX merged 1 commit intomainfrom
add-gemini-cli-agent

Conversation

@JAORMX
Copy link
Copy Markdown
Contributor

@JAORMX JAORMX commented May 4, 2026

Summary

  • Adds Google's @google/gemini-cli as the fifth built-in agent (bbox gemini), following the same registry + guest image + MCP injection pattern as Hermes / Codex / OpenCode.
  • New MCPConfigFormatGemini writes ~/.gemini/settings.json with mcpServers.sandbox-tools.httpUrl (HTTP-streaming, matching what vmcp serves at /mcp). Reuses the existing mergeJSONMapEntries helper — no new abstractions.
  • Auth uses Gemini CLI's built-in OAuth flow on first run, persisted between sessions via CredentialPaths: [".gemini/"]. No host-side credential seeder in v1 (mirrors codex/opencode); a --seed-credentials analogue can be added later if needed.
  • Settings injection filters host settings.json to host-portable categories only: general, ui, model, modelConfigs, context, agents, skills, useWriteTodos, experimental, output, privacy. Intentionally excluded: mcpServers, tools, hooks, security, advanced, telemetry, policyPaths, admin, ide — these reference host-only servers, host-side executables, or host-coupled redaction toggles that must not leak into the guest.
  • Also restores hermes to image-push (missing from the prior Hermes change).

Test plan

  • task fmt clean
  • task lint clean (0 issues)
  • task test — all gemini sub-tests pass (TestRegistry_Get_BuiltInAgent/gemini, TestInjectMCPConfig_Dispatch/gemini_writes_~/.gemini/settings.json, TestMCPConfigFilePermissions/gemini)
  • task build succeeds
  • bbox list shows gemini alongside the other four agents
  • task image-base && task image-gemini builds cleanly (npm install -g @google/gemini-cli adds 7 packages on the Wolfi base in 8s)
  • Manual smoke (requires interactive sign-in): bbox gemini -- --help, end-to-end OAuth, MCP tool listing inside the guest, bbox gemini --egress-profile locked reachability check

🤖 Generated with Claude Code

Adds Google's @google/gemini-cli as the fifth built-in agent, using the
same registry + image + MCP injection pattern as the existing four.

MCP config is written to ~/.gemini/settings.json via the new
MCPConfigFormatGemini format, using `mcpServers.sandbox-tools.httpUrl`
(HTTP streaming, matching what vmcp serves). The settings injector
filters host-side settings.json to host-portable categories only —
mcpServers, tools, hooks, security, advanced, and telemetry are
intentionally excluded so host-only servers and host-coupled toggles
never leak into the guest. Auth follows the codex/opencode pattern:
first-run OAuth in the VM, persisted between sessions via
CredentialPaths. The locked egress profile covers the Gemini Developer
API, Vertex AI, Code Assist, and Google OAuth endpoints.

Also restores hermes to image-push, which was missing from the
prior Hermes change.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@JAORMX JAORMX merged commit 8c2dfc2 into main May 4, 2026
8 checks passed
@JAORMX JAORMX deleted the add-gemini-cli-agent branch May 4, 2026 05:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant