Skip to content

feat(adapters): add gemini-cli runtime adapter - #379

Merged
HongmingWang-Rabbit merged 1 commit into
mainfrom
feat/gemini-cli-adapter
Apr 16, 2026
Merged

feat(adapters): add gemini-cli runtime adapter#379
HongmingWang-Rabbit merged 1 commit into
mainfrom
feat/gemini-cli-adapter

Conversation

@HongmingWang-Rabbit

Copy link
Copy Markdown
Contributor

Summary

What changed

File Change
workspace-template/adapters/gemini_cli/ New adapter — Dockerfile, adapter.py, __init__.py, requirements.txt
workspace-template/cli_executor.py Adds gemini-cli to RUNTIME_PRESETS; adds mcp_via_settings preset flag to skip --mcp-config injection for runtimes that own their own settings file
workspace-configs-templates/gemini-cli/ Default config.yaml + system-prompt.md
workspace-template/tests/test_adapters.py Adds gemini-cli to expected adapter registry set
CLAUDE.md Documents new runtime in image table

Architecture decisions

  • Peer adapter, not base-class refactor. Per the scope discussion on feat(adapters): add gemini-cli runtime adapter to workspace-template #332, this is a standalone adapter alongside claude-code, not a shared agentic-cli base class. The shared-base refactor is deferred to when a 3rd agentic-CLI runtime arrives (tracked separately).
  • MCP via ~/.gemini/settings.json. Gemini CLI does not accept --mcp-config as a CLI flag — it reads from the user settings file. The adapter's setup() method merges the A2A MCP server into that file, preserving any user-defined MCP tools.
  • GEMINI.md as memory file. Gemini CLI reads GEMINI.md from the working directory as persistent context (equivalent of CLAUDE.md for claude-code). setup() seeds it from system-prompt.md on first boot.
  • GEMINI_API_KEY required. Must be set as a global secret before provisioning a gemini-cli workspace.

Build

bash workspace-template/build-all.sh gemini-cli

Test plan

  • All 1213 pytest tests pass (1213 passed, 2 skipped, 2 xfailed)
  • Adapter discovery returns gemini-cli in discover_adapters()
  • CLIAgentExecutor command for gemini-cli is ['gemini', '--yolo', '--model', ..., '-p', ...] — no --mcp-config flag
  • docker build -t workspace-template:gemini-cli -f workspace-template/adapters/gemini_cli/Dockerfile workspace-template/ succeeds (requires Docker + npm registry access)
  • With GEMINI_API_KEY set: workspace boots, delegate_task round-trips, commit_memory/recall_memory work

🤖 Generated with Claude Code

Adds a `gemini-cli` workspace runtime backed by Google's Gemini CLI
(@google/gemini-cli, ~101k ★, Apache 2.0). Mirrors the claude-code
adapter pattern: Docker image installs the CLI, CLIAgentExecutor
drives the subprocess, A2A MCP tools wire via ~/.gemini/settings.json.

Changes:
- workspace-template/adapters/gemini_cli/ — new adapter (Dockerfile,
  adapter.py, __init__.py, requirements.txt); setup() seeds GEMINI.md
  from system-prompt.md and injects A2A MCP server into settings.json
- workspace-template/cli_executor.py — adds gemini-cli to
  RUNTIME_PRESETS (--yolo flag, -p prompt, --model, GEMINI_API_KEY env
  auth); adds mcp_via_settings preset flag to skip --mcp-config
  injection for runtimes that own their own settings file
- workspace-configs-templates/gemini-cli/ — default config.yaml +
  system-prompt.md template
- tests/test_adapters.py — adds gemini-cli to expected adapter set
- CLAUDE.md — documents new runtime row in the image table

Requires: GEMINI_API_KEY global secret. Build:
  bash workspace-template/build-all.sh gemini-cli

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@HongmingWang-Rabbit
HongmingWang-Rabbit merged commit 0aec764 into main Apr 16, 2026
7 checks passed
HongmingWang-Rabbit added a commit that referenced this pull request Apr 16, 2026
docs(devrel): gemini-cli runtime tutorial (feat #379)
molecule-ai Bot pushed a commit that referenced this pull request Apr 21, 2026
Adds a `gemini-cli` workspace runtime backed by Google's Gemini CLI
(@google/gemini-cli, ~101k ★, Apache 2.0). Mirrors the claude-code
adapter pattern: Docker image installs the CLI, CLIAgentExecutor
drives the subprocess, A2A MCP tools wire via ~/.gemini/settings.json.

Changes:
- workspace-template/adapters/gemini_cli/ — new adapter (Dockerfile,
  adapter.py, __init__.py, requirements.txt); setup() seeds GEMINI.md
  from system-prompt.md and injects A2A MCP server into settings.json
- workspace-template/cli_executor.py — adds gemini-cli to
  RUNTIME_PRESETS (--yolo flag, -p prompt, --model, GEMINI_API_KEY env
  auth); adds mcp_via_settings preset flag to skip --mcp-config
  injection for runtimes that own their own settings file
- workspace-configs-templates/gemini-cli/ — default config.yaml +
  system-prompt.md template
- tests/test_adapters.py — adds gemini-cli to expected adapter set
- CLAUDE.md — documents new runtime row in the image table

Requires: GEMINI_API_KEY global secret. Build:
  bash workspace-template/build-all.sh gemini-cli

Co-authored-by: DevOps Engineer <devops@molecule.ai>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
molecule-ai Bot pushed a commit that referenced this pull request Apr 21, 2026
docs(devrel): gemini-cli runtime tutorial (feat #379)
HongmingWang-Rabbit pushed a commit that referenced this pull request Jun 12, 2026
Both tutorials cited misattributed PRs and claimed shipped runtimes that
didn't exist (RFC internal#730 finding):
- google-adk-runtime.md: cited 'PR #550' (actually a MemoryTab test suite) +
  'already first-class'. Rewritten to the REAL implementation — ADK engine-only
  (google-adk[mcp]==2.1.0, no [a2a]), Vertex AI via ADC (keyless), a2a-1.x
  bridge — with correct PR refs (template PR #1, core #2003, ci #26) + a
  landing-status banner.
- gemini-cli-runtime.md: cited 'PR #379' (actually CI cleanup); no gemini-cli
  runtime exists in manifest/knownRuntimes. Added a correction banner pointing
  to the real google-adk runtime.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

feat(adapters): add gemini-cli runtime adapter to workspace-template

1 participant