gemini-for-claude
Bridge Claude Code to Google's Gemini CLI. Mirrors the pattern of the official Codex plugin but for Google's AI stack. Adds 9 slash commands
Open source Repository Open in the app JSON README (API)
About
Bridge Claude Code to Google's Gemini CLI. Mirrors the pattern of the official Codex plugin but for Google's AI stack. Adds 9 slash commands under /gemini: for code review, adversarial security review with CVE search, web-grounded research via Google Search (capability Codex lacks), task delegation with 1M-token context, image generation via nanobanana, and background job management. Supports Google OAuth (free tier), API key, and Vertex AI auth. Zero npm dependencies — one auditable Node.js ESM companion script.
Details
- Kind
- Plugins
- Topic
- AI, RAG & memory
- Publisher
- philipvanlewis
- Origin
- marketplace
- Category
- ferramentas
- Last push
- 2026-04-12T21:18:21Z
- Repository state
- ativo
- Language
- JavaScript
- License
- MIT
- Added
- 2026-08-30 01:48:58
- Updated
- 2026-08-30 01:48:58
- Origin id
philipvanlewis/gemini-for-claude/gemini-for-claude
README
# Gemini for Claude
**The missing Gemini plugin for Claude Code.** Review code, research the web, delegate tasks, and generate images -- all from Claude Code using Google's Gemini CLI.
[](LICENSE)
[](https://docs.anthropic.com/en/docs/claude-code/plugins)
[](https://github.com/google-gemini/gemini-cli)
---
> **Why this exists:** The Codex plugin lets Claude Code delegate to OpenAI. This plugin does the same for Google Gemini -- plus web research, 1M token context, and image generation that Codex can't do.
## What You Get
| Command | What it does | Codex equivalent |
|---------|-------------|-----------------|
| `/gemini:setup` | Check CLI, auth, extensions | `/codex:setup` |
| `/gemini:review` | Structured code review with JSON output | `/codex:review` |
| `/gemini:adversarial` | Red-team security review with CVE search | `/codex:adversarial-review` |
| `/gemini:rescue` | Delegate tasks to Gemini subagent | `/codex:rescue` |
| `/gemini:status` | Check background job status | `/codex:status` |
| `/gemini:result` | Retrieve completed job output | `/codex:result` |
| `/gemini:cancel` | Cancel a running job | `/codex:cancel` |
| **`/gemini:research`** | **Web-grounded research with Google Search** | *No equivalent* |
| **`/gemini:image`** | **Generate images, diagrams, icons** | *No equivalent* |
### Why Not Just Use Codex?
| Capability | Codex | Gemini for Claude |
|-----------|-------|-------------------|
| Code review | Yes | Yes |
| Web research | **No** | **Yes -- Google Search built in** |
| Image generation | **No** | **Yes -- Nano Banana models** |
| Context window | Large | **1M tokens** |
| MCP support | **No** | **Yes** |
| Free tier | Paid only | **60 RPM / 1,000 RPD free** |
| Auth | OpenAI account | Google account (OAuth) or API key |
## Quick Start
### 1. Install the Gemini CLI
```bash
npm install -g @google/gemini-cli
```
### 2. Authenticate
```bash
gemini # Opens browser for Google OAuth -- no API key needed
```
### 3. Install the Plugin
In Claude Code, add this repo as a marketplace and install the plugin:
```
/plugin marketplace add philipvanlewis/gemini-for-claude
/plugin install gemini@gemini-for-claude
```
Restart Claude Code so the new slash commands load.
### 4. Verify
In Claude Code, run:
```
/gemini:setup
```
### 5. (Optional) Enable Image Generation
```bash
gemini extensions install https://github.com/gemini-cli-extensions/nanobanana
```
## Usage Examples
### Code Review
```
/gemini:review
```
Returns structured JSON with verdict, findings, and suggestions. Works on staged changes, working tree, or full branch diff.
### Adversarial Security Review
```
/gemini:adversarial focus on SQL injection and auth bypass
```
Red-team review that actively tries to break your code. Uses Google Search to check for known CVEs.
### Web Research
```
/gemini:research what are the breaking changes in Next.js 15.2?
```
Returns findings with source URLs. Something Codex literally cannot do.
### Delegate a Task
```
/gemini:rescue analyze the entire src/ directory for dead code and unused exports
```
Leverages Gemini's 1M token context to ingest entire codebases.
### Generate Images
```
/gemini:image a clean architecture diagram showing microservices with message queue
/gemini:image --icon a minimalist logo for a developer tool, blue gradient
/gemini:image --diagram OAuth2 authorization code flow with PKCE
```
## Authentication
Three methods, in order of recommendation:
| Method | Setup | Cost | Best for |
|--------|-------|------|----------|
| **Google OAuth** | `gemini` (browser flow) | Free (60 RPM / 1K RPD) | Personal use |
| **API Key** | `export GEMINI_API_KEY="..."` | Pay-as-you-go | Higher limits |
| **Vertex AI** | `export GOOGLE_CLOUD_PROJECT="..."` | Enterprise billing | Production |
OAuth uses your Google account subscription (including Gemini Advanced). No API key management required.
## Architecture
```
Claude Code
│
├─ /gemini:review ──────┐
├─ /gemini:adversarial ──┤
├─ /gemini:rescue ───────┤
├─ /gemini:research ─────┤ ┌──────────────────────┐
├─ /gemini:image ────────┼───►│ gemini-companion.mjs │
├─ /gemini:status ───────┤ │ │
├─ /gemini:result ───────┤ │ - Job management │
└─ /gemini:cancel ───────┘ │ - Git context │
│ - Output parsing │
│ - Error handling │
└──────────┬───────────┘
│
▼
┌─────────────────┐
│ Gemini CLI │
│ │
│ - Google Search │
│ - Code sandbox │
│ - MCP support │
│ - Extensions │
│ (nanobanana) │
└─────────────────┘
```
## Project Structure
The repo doubles as a single-plugin Claude Code marketplace. The marketplace manifest lives at the root, and the plugin itself lives in `plugin/`.
```
gemini-for-claude/
├── .claude-plugin/
│ └── marketplace.json # Marketplace manifest (references ./plugin)
├── plugin/
│ ├── .claude-plugin/
│ │ └── plugin.json # Plugin metadata
│ ├── agents/
│ │ └── gemini-rescue.md # Thin forwarding subagent
│ ├── commands/
│ │ ├── setup.md # /gemini:setup
│ │ ├── review.md # /gemini:review
│ │ ├── adversarial-review.md # /gemini:adversarial
│ │ ├── rescue.md # /gemini:rescue
│ │ ├── research.md # /gemini:research
│ │ ├── image.md # /gemini:image
│ │ ├── status.md # /gemini:status
│ │ ├── result.md # /gemini:result
│ │ └── cancel.md # /gemini:cancel
│ ├── skills/
│ │ ├── gemini-prompting/ # Model-specific prompt guidance
│ │ ├── gemini-result-handling/ # How to present Gemini output
│ │ └── gemini-cli-runtime/ # Helper contract for CLI invocation
│ ├── schemas/
│ │ ├── review-output.schema.json # Structured review output
│ │ └── research-output.schema.json # Structured research output
│ ├── scripts/
│ │ └── gemini-companion.mjs # Core runtime (~500 lines)
│ └── hooks/
│ └── hooks.json # Lifecycle hooks
├── .github/
│ └── ISSUE_TEMPLATE/
├── CONTRIBUTING.md
├── LICENSE # MIT
└── README.md # You are here
```
## How It Compares to Existing Plugins
| Plugin | Stars | Job Mgmt | Structured Output | Research | Images | Full CLI |
|--------|-------|----------|-------------------|----------|--------|---------|
| [gemini-manager-skill](https://github.com/alchemiststudiosDOTai/claude-code-gemini-manager-skill) | 60 | No | No | No | No | No |
| [gemini-search-plugin](https://github.com/d-oit/gemini-search-plugin) | 12 | No | No | Partial | No | No |
| [cc-gemini-plugin](https://github.com/thepushkarp/cc-gemini-plugin) | 8 | No | No | No | No | Partial |
| **gemini-for-claude** | -- | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** |
## Contributing
See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines. Issues and PRs welcome.
## License
[MIT](LICENSE) -- Element Zero Ltd
---
Built by [Element Zero](https://ezero.ai) -- AI automation for the real world.