Back to Discover

gemini-as-tool

plugin

MarioMagdy

Use Google Gemini (3.x Pro/Flash) as a headless tool, builder, or judge from Claude Code — via Google AI Pro OAuth, no API key.

View on GitHub
1 starsMITSynced Aug 2, 2026

Install to Claude Code

/plugin marketplace add MarioMagdy/gemini-as-tool

README

gemini-as-tool — use Gemini as a tool from Claude Code (no API key)

gemini-as-tool is a Claude Code plugin that lets Claude call Google Gemini (3.x Pro and Flash) as a headless second-opinion agent, builder, or judge — authenticated through a Google AI Pro OAuth subscription, with no API key and no per-token billing.

License: MIT Claude Code Plugin

Last verified: June 2026. Gemini CLI / agy backends verified 2026-06-04.

It packages the gemini-as-tool skill plus a small, tested Python harness (gemini_tool.py) that drives the Gemini CLI / Antigravity (agy) backends for you — so Claude Code can get a second model's opinion, run a builder→judge pipeline, or fan out prompts to Gemini in parallel, all without you wiring up an API key.

Install

/plugin marketplace add MarioMagdy/gemini-as-tool
/plugin install gemini-as-tool@gemini-as-tool

Then just ask Claude things like "use Gemini to review this" — the skill auto-invokes.

Prefer not to use the plugin system? Clone the repo and run python skills/gemini-as-tool/gemini_tool.py ask "..." directly.

When to use this

Install this if you want Claude Code to:

  • Get a second opinion from Gemini on any output or decision
  • Use Gemini as a builder or judge in a multi-model pipeline (Pro builds, Flash judges)
  • Cross-check Claude's reasoning with another frontier model
  • Run Gemini headlessly and in parallel, using a Google AI Pro subscription (no API key)

Trigger phrases the skill responds to: "use Gemini", "ask Gemini", "second opinion from Gemini", "have Gemini judge/review this", "cross-check with Gemini", "orchestrate Gemini".

Quick start

# one answer from Gemini 3.5 Flash
python gemini_tool.py ask "Explain this stack trace"

# one answer from Gemini 3.1 Pro
python gemini_tool.py ask "Design a rate limiter" --model pro

# builder -> judge: Pro builds, Flash reviews and returns a JSON verdict
python gemini_tool.py pipeline "Write a thread-safe LRU cache in Python"

# fan out N prompts concurrently
python gemini_tool.py parallel "prompt 1" "prompt 2" "prompt 3"

Python API: from gemini_tool import askask(prompt, model="pro"|"flash", backend="agy"|"gemini-cli").

How it works

gemini_tool.py wraps two subscription-backed backends and normalizes their quirks:

  • agy (Antigravity CLI) — the primary backend and the only one with Gemini 3.5 Flash. It works around the known Windows bug where agy -p prints nothing to stdout by reading the response from agy's own transcript store, and runs each call in its own job workspace so parallel calls never collide.
  • gemini CLI — a secondary backend that returns a clean JSON envelope.

Prompts are delivered per backend:

  • The gemini CLI backend receives the prompt over stdin (so untrusted prompt text can't reach a shell).
  • The agy backend passes the prompt as a direct process argument (no shell is involved, so it is not injectable), which means very long prompts are bounded by the OS command-line length limit.

Requirements

  • Python 3.8+
  • A Google AI Pro account, and at least one of:
    • the Antigravity CLI (agy) installed and signed in (recommended — required for 3.5 Flash), or
    • the Gemini CLI (@google/gemini-cli) installed and signed in.
  • Auth is OAuth (browser sign-in, stored in your OS keyring). No API key is used or stored.

FAQ

What is gemini-as-tool? A Claude Code plugin that lets Claude call Google Gemini (3.x Pro and Flash) as a headless second-opinion agent, builder, or judge — authenticated through a Google AI Pro OAuth subscription, with no API key and no per-token billing.

Does this require a Gemini / Google AI Studio API key? No. It authenticates with OAuth via your existing Google AI Pro subscription. No API key is read, set, or stored.

Which Gemini models does it support? --model flash → Gemini 3.5 Flash (via agy), --model pro → Gemini 3.1 Pro. The model aliases are resolved per backend.

How is this different from a Gemini MCP server? This is a Claude Code skill/plugin, not an MCP server. It auto-invokes from context (no per- session MCP config), supports the builder→judge and parallel patterns out of the box, and needs no API key — it rides your Pro subscription.

Can it run prompts in parallel? Yes — parallel fans out N prompts concurrently (each agy call uses an isolated workspace).

Is it safe to feed it untrusted text? The gemini CLI backend receives the prompt over stdin, so untrusted text never reaches a shell. The agy backend passes the prompt as a direct process argument (a list-form argv, so no shell is involved and it is not injectable); on top of that the model label is allowlist-validated and the prompt length is capped.

How do I use Gemini from Claude Code? Install the plugin (/plugin marketplace add MarioMagdy/gemini-as-tool then /plugin install gemini-as-tool@gemini-as-tool) and just ask Claude things like "use Gemini to review this" — the skill auto-invokes. Under the hood it calls python "$CLAUDE_PLUGIN_ROOT/skills/gemini-as-tool/gemini_tool.py" ask "..." for you.

Is this free? Yes, with a Google AI Pro subscription. The plugin authenticates with OAuth via your existing Google account — no separate API key, and no per-token billing on top of the subscription. (We don't quote a specific subscription price here; check Google's site for current AI Pro pricing.)

Troubleshooting

These are the verbatim error strings users Google for — match the string exactly to the fix.

Error (verbatim)Fix
agy run finished but conversation could not be locatedIncrease the timeout. For builds pass --timeout 2700 (the default 300 s kills the run mid-build). The harness needs the post-run window to read agy's transcript store.
agy -p prints nothing on WindowsThat is a known agy bug (antigravity-cli#115 / gemini-cli#27466) — agy -p is intentionally empty on stdout. Use the gemini-as-tool harness; it reads the response from agy's own transcript store at ~/.gemini/antigravity-cli/brain/<conv-id>/.system_generated/logs/transcript.jsonl.

Comparison

MethodAPI keyAuto-invokes in Claude CodeBuilder/judge + parallel
gemini-as-tool (this)No (OAuth)YesYes
Gemini MCP serverUsually yesNo (manual)Manual
Direct Gemini API callYesNoManual

License

MIT © MarioMagdy

Rendered live from MarioMagdy/gemini-as-tool's GitHub README — not stored, always reflects the source repo.

1 Plugin

NameDescriptionCategorySource
gemini-as-toolUse Google Gemini (3.x Pro/Flash) as a headless tool, builder, or judge from Claude Code — via Google AI Pro OAuth, no API key.ai-integration./

0 Comments

Login required
Log in to post a comment or update on this repo.

No comments yet — be the first to share an update.