Files
molecule-core/docs/tutorials/gemini-cli-runtime.md
core-devops 1b543d8582
ci-arm64-advisory / fast-checks (pull_request) Waiting to run
Lint shellcheck (arm64 pilot) / shellcheck-arm64 (pilot) (pull_request) Successful in 12s
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 4s
CI / Python Lint & Test (pull_request) Successful in 4s
CI / Detect changes (pull_request) Successful in 6s
E2E API Smoke Test / detect-changes (pull_request) Successful in 9s
E2E Chat / detect-changes (pull_request) Successful in 8s
E2E Staging Canvas (Playwright) / detect-changes (pull_request) Successful in 5s
CI / all-required (pull_request) Successful in 38s
Handlers Postgres Integration / detect-changes (pull_request) Successful in 7s
Harness Replays / detect-changes (pull_request) Successful in 4s
Lint forbidden tenant-env keys / Scan workspace_secrets writers for forbidden env keys (pull_request) Successful in 4s
Lint no tenant GITEA or GITHUB token write / Scan for repo-host token write into tenant workspace surface (pull_request) Successful in 3s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 4s
verify-providers-gen / Regenerate providers artifact and fail on drift (pull_request) Successful in 43s
gate-check-v3 / gate-check (pull_request) Successful in 3s
qa-review / approved (pull_request) Successful in 4s
security-review / approved (pull_request) Successful in 4s
sop-checklist / na-declarations (pull_request) N/A: (none)
sop-checklist / all-items-acked (pull_request) Successful in 4s
sop-checklist / review-refire (pull_request) Has been skipped
lint-required-no-paths / lint-required-no-paths (pull_request) Successful in 1m7s
sop-tier-check / tier-check (pull_request) Successful in 6s
CI / Platform (Go) (pull_request) Successful in 4s
CI / Canvas (Next.js) (pull_request) Successful in 2s
CI / Shellcheck (E2E scripts) (pull_request) Successful in 2s
E2E API Smoke Test / E2E API Smoke Test (pull_request) Successful in 2s
E2E Chat / E2E Chat (pull_request) Successful in 7s
E2E Staging Canvas (Playwright) / Canvas tabs E2E (pull_request) Successful in 5s
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Successful in 2s
Harness Replays / Harness Replays (pull_request) Successful in 2s
CI / Canvas Deploy Reminder (pull_request) Has been skipped
audit-force-merge / audit (pull_request) Successful in 6s
docs: correct fabricated google-adk + gemini-cli runtime tutorials
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>
2026-05-28 23:07:13 -07:00

3.6 KiB

Running a Gemini CLI Workspace on Molecule AI

⚠️ Accuracy correction (2026-05-29): this page is aspirational, not shipped. There is no gemini-cli runtime in manifest.json or the provisioner's knownRuntimes, and the "PR #379" cited below is unrelated (a CI-workflow-cleanup PR, not a gemini-cli adapter). Do not follow this as-is.

For Gemini on Molecule, use the real google-adk runtime instead — see google-adk-runtime.md (ADK engine + Gemini on Vertex AI/AI Studio), implemented in PR molecule-ai-workspace-template-google-adk#1 per RFC internal#730. This gemini-cli page is retained only until it's either implemented for real or removed.

Molecule AI now ships a gemini-cli runtime adapter alongside the existing claude-code adapter. This tutorial walks you from zero to a running Gemini agent workspace in under five minutes.

What you'll need

  • A Molecule AI account with at least one provisioned tenant
  • A Google GEMINI_API_KEY (get one at aistudio.google.com)
  • The Molecule AI CLI (pip install molecule-ai)

Setup (10 steps)

# 1. Install / upgrade the CLI
pip install --upgrade molecule-ai

# 2. Authenticate
molecule auth login

# 3. Store your Gemini API key as a global secret
molecule secrets set GEMINI_API_KEY="YOUR_KEY_HERE" --global

# 4. Create a gemini-cli workspace
molecule workspace create my-gemini-agent --runtime gemini-cli

# 5. Confirm it's running (status → "ready" within ~30 s)
molecule workspace status my-gemini-agent

# 6. Send your first task
molecule workspace run my-gemini-agent "Summarise the last 5 git commits in this repo"

# 7. View the streamed response
molecule workspace logs my-gemini-agent --follow

# 8. Check the agent's memory file (GEMINI.md)
molecule workspace exec my-gemini-agent cat GEMINI.md

# 9. Delegate a cross-workspace task to your new Gemini peer
molecule workspace run orchestrator "delegate_task my-gemini-agent 'Draft release notes for v1.4'"

# 10. Tear down when done
molecule workspace delete my-gemini-agent

Expected output

After step 5 you should see:

my-gemini-agent  gemini-cli  ready   ord   2026-04-16T06:30:00Z

After step 6, Gemini CLI streams its reasoning and final answer directly to stdout. The agent uses GEMINI.md (seeded from your workspace's system-prompt.md) as persistent context — equivalent to CLAUDE.md for Claude Code workspaces.

How it works

Molecule AI's gemini-cli adapter mirrors the battle-tested claude-code pattern: a Docker image installs @google/gemini-cli globally, and CLIAgentExecutor drives the subprocess. Because Gemini CLI reads MCP config from ~/.gemini/settings.json rather than accepting a --mcp-config flag, the adapter's setup() method merges the A2A MCP server definition into that file at boot — preserving any user-defined tools.

Multi-provider teams

The real power surfaces when you mix runtimes on the same Molecule AI tenant. Your orchestrator workspace can delegate tasks to both claude-code and gemini-cli workers simultaneously using delegate_task_async, then synthesize results — all through the same A2A protocol. This is provider diversity at the infrastructure layer, not at the application layer.