
Gemini Cli
- 57 installs
- 51 repo stars
- Updated November 25, 2025
- ovachiever/droid-tings
Helps with ai & agent building tasks during AI-assisted development.
About
gemini cli is a Claude Code skill for ai & agent building. It helps solo builders move faster with AI-assisted coding.
- gemini cli
- AI & Agent Building
- AI-coding skill
Gemini Cli by the numbers
- 57 all-time installs (skills.sh)
- Ranked #6,520 of 16,556 AI & Agent Building skills by installs in the Skillselion catalog
- Data as of Jul 27, 2026 (Skillselion catalog sync)
npx skills add https://github.com/ovachiever/droid-tings --skill gemini-cliAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 57 |
|---|---|
| repo stars | ★ 51 |
| Last updated | November 25, 2025 |
| Repository | ovachiever/droid-tings ↗ |
What it does
Helps with ai & agent building tasks during AI-assisted development.
Files
Gemini CLI
Leverage Gemini's 1M+ context window as your AI pair programmer within Claude Code workflows.
This skill teaches Claude Code how to use the official Google Gemini CLI (gemini command) to get second opinions, architectural advice, debugging help, and comprehensive code reviews. Based on production testing with the official CLI tool.
---
Table of Contents
1. Quick Start 2. When to Use Gemini Consultation 3. Installation 4. Using Gemini CLI 5. Model Selection: Flash vs Pro 6. Proactive Consultation Patterns 7. AI-to-AI Prompting Best Practices 8. Common Use Cases 9. Integration Examples 10. Troubleshooting & Known Issues
---
Quick Start
Prerequisites:
- Gemini CLI installed (
npm install -g @google/gemini-cli) - Authenticated with Google account (run
geminionce to authenticate)
Basic Usage Patterns:
# Quick question (non-interactive with -p flag)
gemini -p "Should I use D1 or KV for session storage?"
# Code review with file context (using --all-files)
gemini --all-files -p "Review this auth implementation for security issues"
# Architecture advice using Pro model
gemini -m gemini-2.5-pro -p "Best way to handle WebSockets in Cloudflare Workers?"
# Pipe file content for review
cat src/auth.ts | gemini -p "Review this authentication code for security vulnerabilities"
# Interactive mode for follow-up questions
gemini -i "Help me debug this authentication error"---
When to Use Gemini Consultation
ALWAYS Consult (Critical Scenarios)
Claude Code should automatically invoke Gemini in these situations:
1. Major Architectural Decisions
- Example: "Should I use D1 or KV for session storage?"
- Example: "Durable Objects vs Workflows for long-running tasks?"
- Why: Gemini provides complementary perspective, may prioritize different concerns
- Pattern:
gemini -m gemini-2.5-pro -p "[architectural question]"
2. Security-Sensitive Code Changes
- Authentication systems
- Payment processing
- Data handling (PII, sensitive data)
- API key/secret management
- Why: Gemini 2.5 Pro excels at security audits
- Pattern:
cat [security-file] | gemini -m gemini-2.5-pro -p "Security audit this code"
3. Large Refactors
- Affecting 5+ files
- Core architecture changes
- Database schema migrations
- Why: Fresh perspective prevents tunnel vision
- Pattern:
gemini --all-files -m gemini-2.5-pro -p "Review this refactoring plan"
4. Stuck Debugging (2+ Failed Attempts)
- Error persists after 2 debugging attempts
- Stack trace unclear
- Intermittent bugs
- Why: Different reasoning approach may spot root cause
- Pattern:
gemini -p "Help debug: [error message]" < error.log
5. Context Window Pressure (70%+ Full)
- Approaching token limit
- Need to offload analysis to Gemini
- Why: Gemini's 1M context can handle large code files
- Pattern:
cat large-file.ts | gemini -p "Analyze this code structure"
OPTIONALLY Consult
6. Unfamiliar Technology
- Using library/framework for first time
- Experimenting with new patterns
- Why: Gemini may have more recent training data
- Pattern:
gemini -p "Best practices for [new technology]"
7. Code Reviews
- Before committing major changes
- Pull request preparation
- Why: Catches edge cases and improvements
- Pattern:
git diff | gemini -p "Review these changes"
---
Installation
1. Install Gemini CLI
npm install -g @google/gemini-cli2. Authenticate
geminiFollow the authentication prompts to link your Google account.
3. Verify Installation
gemini --versionShould show version 0.13.0 or higher.
4. Test Connection
gemini -p "What is 2+2?"---
Using Gemini CLI
Core Command Patterns
Non-Interactive Mode (-p flag)
Best for Claude Code integration:
# Direct question
gemini -p "Your question here"
# With model selection
gemini -m gemini-2.5-flash -p "Quick debugging question"
gemini -m gemini-2.5-pro -p "Complex architectural decision"
# With file context via pipe
cat src/auth.ts | gemini -p "Review this code"
# With all files in current directory
gemini --all-files -p "Analyze project structure"
# With stdin input
echo "Error: Cannot connect to database" | gemini -p "Help debug this error"Interactive Mode (-i flag)
For follow-up conversations:
# Start interactive session with initial prompt
gemini -i "Let's discuss the architecture"
# Interactive with model selection
gemini -m gemini-2.5-pro -i "Help me design a database schema"YOLO Mode (-y flag)
Auto-accepts all actions (use with caution):
# Dangerous: Auto-executes suggested commands
gemini -y -p "Fix all linting errors"⚠️ Warning: YOLO mode can execute commands without confirmation. Only use in trusted environments.
---
Model Selection: Flash vs Pro
gemini-2.5-flash (Default)
Characteristics:
- Fast response time: ~5-25 seconds
- Good quality for most tasks
- Lower cost
- Safe for general questions
Use For:
- Code reviews
- Debugging
- General questions
- Quick consultations
- When speed matters
Example:
gemini -m gemini-2.5-flash -p "Review this function for performance issues"gemini-2.5-pro
Characteristics:
- Response time: ~15-30 seconds
- Excellent quality, thorough analysis
- Higher cost
- Best for critical decisions
Use For:
- Architecture decisions (critical)
- Security audits (thorough)
- Complex reasoning tasks
- Major refactoring plans
- When accuracy > speed
Example:
gemini -m gemini-2.5-pro -p "Security audit this authentication system"gemini-3-pro-preview (Preview - November 2025)
Characteristics:
- Google's newest and most intelligent AI model (announced Nov 18, 2025)
- State-of-the-art reasoning and multimodal understanding
- Outperforms Gemini 2.5 Pro on every major AI benchmark
- Supports text, image, video, audio, and PDF inputs
- Response time: TBD (in testing)
- Higher cost (preview pricing)
Use For:
- Most complex reasoning tasks requiring deep analysis
- Critical architectural decisions on cutting-edge projects
- Advanced multimodal analysis (diagrams, videos, complex docs)
- Benchmark-critical applications
- When absolute best quality is required (and cost is secondary)
Example:
gemini -m gemini-3-pro-preview -p "Deep architectural analysis of this distributed system"
cat architecture-diagram.png | gemini -m gemini-3-pro-preview -p "Analyze this system design"⚠️ Preview Status: Model is in preview. For production-critical decisions, consider using gemini-2.5-pro (stable) until Gemini 3 reaches general availability.
How to Choose
Quick question? → Flash
Security/architecture? → 3-Pro-Preview (cutting-edge) or 2.5-Pro (stable)
Debugging? → Flash (try Pro if stuck)
Code review? → Flash
Refactoring 5+ files? → 3-Pro-Preview or 2.5-Pro
Multimodal analysis? → 3-Pro-Preview---
Proactive Consultation Patterns
Pattern 1: Architecture Decision
Trigger: User asks about technology choice Claude Action: Automatically consult Gemini for second opinion
# Claude runs:
gemini -m gemini-2.5-pro -p "Compare D1 vs KV for session storage in Cloudflare Workers. Consider: read/write patterns, cost, performance, complexity."
# Then synthesizes both perspectivesPattern 2: Security Review
Trigger: Working on auth/payment/sensitive code Claude Action: Request Gemini security audit
# Claude runs:
cat src/auth/verify-token.ts | gemini -m gemini-2.5-pro -p "Security audit this authentication code. Check for: token validation, timing attacks, injection vulnerabilities, error handling."Pattern 3: Debugging Assistance
Trigger: Error persists after 2 attempts Claude Action: Get Gemini's perspective
# Claude runs:
echo "[error message and stack trace]" | gemini -p "Help debug this error. What's the likely root cause?"Pattern 4: Code Review
Trigger: Major changes ready to commit Claude Action: Request comprehensive review
# Claude runs:
git diff HEAD | gemini --all-files -p "Review these changes for: correctness, edge cases, performance, security, best practices."---
AI-to-AI Prompting Best Practices
How Claude Should Format Prompts to Gemini
✅ GOOD: Context-Rich, Specific
gemini -m gemini-2.5-pro -p "I'm building a Cloudflare Worker with user authentication. Should I use D1 or KV for storing session data? Consider: 1) Session reads on every request, 2) TTL-based expiration, 3) Cost under 10M requests/month, 4) Deployment complexity."❌ BAD: Vague, No Context
gemini -p "D1 or KV?"Prompt Structure Template
[Context: What you're building]
[Question]
[Considerations: Key factors (numbered)]Example: Architecture Decision
gemini -m gemini-2.5-pro -p "
Context: Building a real-time collaborative editing app on Cloudflare Workers.
Question: Should I use Durable Objects or Workflows for managing document state?
Considerations:
1. Need to handle WebSocket connections (100+ simultaneous users per document)
2. Document state must be consistent across all clients
3. Need to persist changes every 5 seconds
4. Budget: <\$100/month at 1000 documents
5. Simple deployment preferred
"---
Common Use Cases
1. Technology Selection
# Compare two technologies
gemini -m gemini-2.5-pro -p "Compare Drizzle ORM vs raw SQL for Cloudflare D1. Consider: type safety, performance, query complexity, bundle size."2. Security Audit
# Audit authentication code
cat src/middleware/auth.ts | gemini -m gemini-2.5-pro -p "
Security audit this authentication middleware. Check for:
1. Token validation vulnerabilities
2. Timing attack risks
3. Error handling leaks
4. CSRF protection
5. Rate limiting
"3. Debugging Root Cause
# Analyze error logs
tail -100 error.log | gemini -p "
These errors started appearing after deploying auth changes. What's the likely root cause?
Context:
- Added JWT validation middleware
- Using @cloudflare/workers-jwt
- Errors only on /api/* routes
"4. Code Review
# Review pull request changes
git diff main...feature-branch | gemini --all-files -p "
Review this pull request. Focus on:
1. Breaking changes
2. Edge cases not handled
3. Performance implications
4. Security concerns
"5. Refactoring Plan
# Plan large refactor
gemini --all-files -m gemini-2.5-pro -p "
I want to refactor this Express app to Cloudflare Workers with Hono. Analyze the codebase and suggest:
1. Migration order (which routes first)
2. Potential blockers (middleware that won't work)
3. Testing strategy
4. Deployment plan
"6. Performance Optimization
# Analyze performance
cat src/api/heavy-endpoint.ts | gemini -p "
This endpoint is slow (500ms+ response time). Identify performance bottlenecks and suggest optimizations.
Context:
- Cloudflare Worker
- Fetches data from 3 external APIs
- Processes 1000+ items
"---
Integration Examples
Example 1: Claude Consulting Gemini Automatically
Scenario: User asks architectural question
User: "Should I use D1 or KV for storing user sessions?"
Claude (internal): This is an architectural decision. Consult Gemini for second opinion.
[Runs: gemini -m gemini-2.5-pro -p "Compare D1 vs KV for user session storage in Cloudflare Workers..."]
Claude (to user): "I've consulted Gemini for a second opinion. Here's what we both think:
My perspective: [Claude's analysis]
Gemini's perspective: [Gemini's analysis]
Key differences: [synthesis]
Recommendation: [combined recommendation]"Example 2: Security Review Before Commit
User: "Ready to commit these auth changes"
Claude (internal): Security-sensitive code. Request Gemini audit.
[Runs: cat src/auth/*.ts | gemini -m gemini-2.5-pro -p "Security audit..."]
Claude (to user): "I've reviewed the code and consulted Gemini for security concerns:
Gemini identified: [security issues]
Additional checks I recommend: [Claude's additions]
Safe to commit after addressing: [list]"Example 3: Debugging Assistance
User: "Still getting this error after trying your suggestions: [error]"
Claude (internal): Two failed attempts. Consult Gemini for fresh perspective.
[Runs: echo "[error details]" | gemini -p "Help debug..."]
Claude (to user): "Let me get a second opinion from Gemini...
Gemini suggests: [Gemini's diagnosis]
This makes sense because: [Claude's analysis]
Let's try: [combined solution]"---
Troubleshooting & Known Issues
Issue 1: Not Authenticated
Error: Error: Not authenticated
Solution:
gemini
# Follow authentication promptsIssue 2: Model Not Found
Error: Error: Model not found: gemini-2.5-flash-lite
Cause: Model deprecated or renamed
Solution:
# Use stable models
gemini -m gemini-2.5-flash -p "Your question"
gemini -m gemini-2.5-pro -p "Your question"Issue 3: Rate Limit
Error: Error: Rate limit exceeded
Solution: Wait 1-5 minutes, then retry
Prevention: Space out requests
Issue 4: Large File Context
Error: File too large for context
Solution: Use --all-files carefully or pipe specific sections
# Instead of:
gemini --all-files -p "Review everything"
# Do:
cat src/specific-file.ts | gemini -p "Review this file"Issue 5: Command Hangs
Cause: Interactive mode when expecting non-interactive
Solution: Always use -p flag for non-interactive commands
# ✅ Correct
gemini -p "Question"
# ❌ Wrong (will hang waiting for input)
gemini "Question"---
Production Best Practices
1. Always Use -p for Automation
# ✅ Good for scripts
gemini -p "Question"
# ❌ Bad for scripts (interactive)
gemini2. Select Model Based on Criticality
# Architecture/security → Pro
gemini -m gemini-2.5-pro -p "[critical question]"
# Debugging/review → Flash
gemini -m gemini-2.5-flash -p "[general question]"3. Provide Context in Prompts
# ✅ Good
gemini -p "Context: Building Cloudflare Worker. Question: Best auth pattern? Considerations: 1) Stateless, 2) JWT, 3) <100ms overhead"
# ❌ Bad
gemini -p "Best auth?"4. Pipe File Content for Reviews
# ✅ Good
cat src/auth.ts | gemini -p "Review for security"
# ❌ Inefficient
gemini -p "Review src/auth.ts" # Gemini has to read file separately5. Handle Errors Gracefully
# Add error handling
if output=$(gemini -p "Question" 2>&1); then
echo "Gemini says: $output"
else
echo "Gemini consultation failed, proceeding with Claude's recommendation"
fi6. Synthesize, Don't Just Forward
❌ BAD: Just paste Gemini's response
User: "Should I use D1?"
Claude: [runs gemini] "Gemini says: [paste]"✅ GOOD: Synthesize both perspectives
User: "Should I use D1?"
Claude: [runs gemini]
"I've consulted Gemini for a second opinion:
My analysis: [Claude's perspective]
Gemini's analysis: [Gemini's perspective]
Key differences: [synthesis]
Recommendation: [unified answer]"---
Version History
2.1.0 (2025-11-19):
- Added Gemini 3 Pro Preview model (
gemini-3-pro-preview) - Updated model selection guidance for Gemini 3
- Added multimodal analysis use cases
- Updated model comparison matrix
2.0.0 (2025-11-13):
- Complete rewrite for official Gemini CLI (removed gemini-coach wrapper)
- Direct CLI integration patterns
- Simplified to core use cases
- Updated command examples for
geminiCLI v0.13.0+
1.0.0 (2025-11-08):
- Initial release with gemini-coach wrapper
- Production testing and experimentation
- 8+ documented errors prevented
---
Related Skills
- google-gemini-api - Gemini API integration via SDK
- google-gemini-embeddings - Gemini embeddings for RAG
- google-gemini-file-search - Managed RAG with Gemini
---
License
MIT - See LICENSE
---
Support
- Issues: https://github.com/jezweb/claude-skills/issues
- Email: jeremy@jezweb.net
- Official Gemini CLI: https://github.com/google-gemini/gemini-cli
{
"name": "gemini-cli",
"description": "Consult Google Gemini CLI for second opinions on architecture, debugging, and security audits. Use Geminis 1M+ context window for comprehensive code analysis. Compare Flash (fast) vs Pro (thorough) vs 3-Pro-Preview (cutting-edge). Use when: need second opinion on architectural decisions, stuck debugging after 2+ attempts, writing security- sensitive code, planning refactors (5+ files), approaching 70%+ context capacity, unfamiliar with tech stack, need peer review, or want Flash vs Pro vs 3-Pro-",
"version": "1.0.0",
"author": {
"name": "Jeremy Dawes",
"email": "jeremy@jezweb.net"
},
"license": "MIT",
"repository": "https://github.com/jezweb/claude-skills",
"keywords": ["gemini-cli","google gemini","gemini command line","second opinion","model comparison","gemini-2.5-flash","gemini-2.5-pro","gemini-3-pro-preview","architectural decisions","debugging assistant","code review gemini","security audit gemini","1M context window","AI pair programming","gemini consultation"]
}
gemini-cli
Status: ✅ Production-Ready | v2.1.0 | Last Updated: 2025-11-19
Use the official Google Gemini CLI directly from Claude Code for second opinions, architectural advice, debugging help, and comprehensive code reviews using Gemini's 1M+ context window. Now includes Gemini 3 Pro Preview (Nov 2025).
---
Auto-Trigger Keywords
This skill should activate when Claude Code encounters these scenarios:
Commands
gemini(official CLI tool)gemini-cli(installation package)gemini-2.5-flash,gemini-2.5-pro,gemini-3-pro-preview(model names)
Use Cases
- "second opinion"
- "consult Gemini"
- "peer review"
- "architectural decision"
- "stuck debugging" (after 2+ attempts)
- "security audit"
- "compare implementations"
- "model comparison"
- "Flash vs Pro"
- "1M context window"
- "large codebase analysis"
Technologies
- Google Gemini
- Gemini CLI
- @google/gemini-cli
- AI pair programming
- AI-to-AI prompting
Scenarios (Proactive)
- Major architectural decisions (D1 vs KV, Durable Objects vs Workflows, etc.)
- Security-sensitive code (auth, payments, data handling)
- Large refactors (5+ files, core architecture changes)
- Context approaching 70%+ full
- Unfamiliar technology stack
- Debugging failures (2+ attempts on same bug)
---
When to Use
✅ Use This Skill When:
- [ ] User asks major architectural question ("Should I use D1 or KV for sessions?")
- [ ] Writing security-sensitive code (auth, payments, PII)
- [ ] Planning large refactor (5+ files or core architecture)
- [ ] Stuck debugging after 2+ failed attempts
- [ ] Context approaching 70%+ capacity, need full codebase analysis
- [ ] Unfamiliar with technology stack or library
- [ ] Need to compare two implementations (old vs new, alternative approaches)
- [ ] User explicitly requests Gemini consultation
- [ ] Want complementary perspective on critical decision
- [ ] Need 1M+ context window for comprehensive analysis
❌ Don't Use This Skill When:
- [ ] Simple questions answerable with Claude's knowledge
- [ ] Trivial code reviews (small, non-critical changes)
- [ ] Every single decision (reserve for critical scenarios)
- [ ] API rate limits exceeded
- [ ] No internet connection available
---
Quick Example
Scenario: User asks "Should I use D1 or KV for session storage?"
Claude's Workflow:
# 1. Detect architectural decision
# 2. Inform user: "Consulting Gemini for second opinion..."
# 3. Get Gemini's perspective (Pro model)
gemini -m gemini-2.5-pro -p "I'm building a Cloudflare Worker with 1000-5000 DAU. Should I use D1 or KV for session storage? Consider: 1) Session reads on every request, 2) TTL-based expiration after 30 days, 3) Remember me functionality, 4) Multi-device tracking, 5) Cost under $50/month."
# 4. Synthesize both perspectives
# 5. Present unified recommendationUser sees:
Based on consultation with Gemini:
**My Perspective**: Both viable, depends on priorities
- KV excels at read performance (sub-millisecond)
- D1 provides better querying for multi-device tracking
**Gemini's Perspective** (2.5-Pro): D1 recommended
- Strong consistency is critical for sessions
- Query flexibility for "remember me" across devices
- Cost effective at this scale
**Recommendation**: Start with D1---
Installation
Via Marketplace (Recommended)
# Add marketplace
/plugin marketplace add https://github.com/jezweb/claude-skills
# Install skill
/plugin install gemini-cli@claude-skillsManual Installation
# Clone repository
git clone https://github.com/jezweb/claude-skills.git
cd claude-skills
# Symlink skill
ln -s $(pwd)/skills/gemini-cli ~/.claude/skills/gemini-cliInstall Gemini CLI
# Install official Gemini CLI
npm install -g @google/gemini-cli
# Authenticate
gemini
# Test
gemini --version
gemini -p "What is 2+2?"---
Features
Core Capabilities
- ✅ Direct CLI Integration: Use official
geminicommand (no wrapper needed) - ✅ Model Selection: Flash (fast) vs Pro (thorough)
- ✅ 1M+ Context Window: Analyze large code files
- ✅ Non-Interactive Mode: Perfect for Claude Code automation (
-pflag) - ✅ File Context: Pipe files or use
--all-files - ✅ AI-to-AI Prompting: Optimized prompts for Gemini from Claude
Use Cases Covered
1. Architecture Decisions: Technology selection, pattern choices 2. Security Audits: Authentication, payments, sensitive data handling 3. Debugging Assistance: Root cause analysis after failed attempts 4. Code Reviews: Before commits, pull requests 5. Refactoring Plans: Large-scale changes (5+ files) 6. Performance Optimization: Bottleneck identification
Token Efficiency
- ~60-70% token savings vs manual consultation
- 6+ common errors prevented (see SKILL.md)
- Automated synthesis of both AI perspectives
---
Usage Patterns
Pattern 1: Quick Consultation
gemini -p "Should I use Drizzle ORM or raw SQL for Cloudflare D1?"Pattern 2: Security Review
cat src/auth/middleware.ts | gemini -m gemini-2.5-pro -p "Security audit this auth middleware"Pattern 3: Code Review
git diff HEAD | gemini --all-files -p "Review these changes for edge cases and security"Pattern 4: Architecture Advice
gemini -m gemini-2.5-pro -p "Best way to handle WebSocket state in Cloudflare Durable Objects? Consider: 1) 100+ concurrent connections, 2) Persistence requirements, 3) Failover"Pattern 5: Debugging
echo "[error message]" | gemini -p "Help debug this error. What's the likely root cause?"---
Comparison: gemini-cli vs google-gemini-api
| Feature | gemini-cli (this skill) | google-gemini-api |
|---|---|---|
| Purpose | Second opinions, peer review | Direct API integration |
| Context | Full codebase (1M+ tokens) | Request-specific |
| Integration | Command-line tool | SDK (@google/genai) |
| Use Case | AI-to-AI consultation | Building Gemini-powered apps |
| Best For | Architecture, security audits | Chat, embeddings, function calling |
Use both: gemini-cli for consulting Gemini, google-gemini-api for building with Gemini.
---
Related Skills
- [google-gemini-api](../google-gemini-api/) - Gemini API integration via SDK
- [google-gemini-embeddings](../google-gemini-embeddings/) - Gemini embeddings for RAG
- [google-gemini-file-search](../google-gemini-file-search/) - Managed RAG with Gemini
- [openai-api](../openai-api/) - Alternative for second opinions
---
Known Issues
1. Model Deprecation: gemini-2.5-flash-lite removed (use flash or pro) 2. Rate Limits: Space out requests if hitting limits 3. Large Files: Use --all-files carefully (can exceed context)
See SKILL.md for complete troubleshooting guide.
---
Version History
2.0.0 (2025-11-13):
- ✨ Complete rewrite for official Gemini CLI (removed gemini-coach wrapper)
- ✨ Direct CLI integration patterns
- ✨ Simplified to core use cases
- ✨ Updated for gemini CLI v0.13.0+
1.0.0 (2025-11-08):
- Initial release with gemini-coach wrapper
- Production testing and experimentation
---
Contributing
Issues and improvements welcome:
- Issues: https://github.com/jezweb/claude-skills/issues
- Email: jeremy@jezweb.net
---
License
MIT - See LICENSE
---
Maintained by: Jeremy Dawes | Jezweb
Gemini Models Comparison Guide
Based on systematic testing (2025-11-08, updated 2025-11-19 for Gemini 3)
---
Available Models
gemini-3-pro-preview (Latest - Preview)
Status: 🆕 Preview release (November 18, 2025)
Characteristics:
- Google's newest and most intelligent AI model
- State-of-the-art reasoning and multimodal understanding
- Outperforms Gemini 2.5 Pro on every major AI benchmark
- Supports text, image, video, audio, and PDF inputs
- Response time: TBD (in testing)
- Higher cost (preview pricing)
Best For:
- Most complex reasoning tasks
- Critical architectural decisions requiring deep analysis
- Advanced multimodal understanding
- Cutting-edge capabilities and benchmarks
- When absolute best quality is required
Example:
gemini -m gemini-3-pro-preview -p "Complex architectural decision requiring deep analysis"
cat complex-diagram.png | gemini -m gemini-3-pro-preview -p "Analyze this system architecture diagram"⚠️ Preview Status: Model is in preview. Use for evaluation and testing. Consider using gemini-2.5-pro for production-critical decisions until Gemini 3 reaches stable release.
---
gemini-2.5-flash (Default)
Characteristics:
- Fast response time: ~5-25 seconds (average ~20s)
- Good quality for most tasks: ⭐⭐⭐⭐
- Prioritizes: Performance, simplicity, speed
- Safe with directory scanning
- Lower cost
Best For:
- Code reviews
- Debugging (root cause analysis is strong)
- Directory/file scanning
- General questions
- When speed matters
Example:
cat src/auth.ts | gemini -p "Review this code"
echo "Error message here" | gemini -p "Help debug this error"---
gemini-2.5-pro
Characteristics:
- Response time: ~15-30 seconds (average ~23s, often similar to Flash!)
- Excellent quality: ⭐⭐⭐⭐⭐
- Prioritizes: Correctness, consistency, thoroughness
- May get confused with directory scanning (tries to use tools)
- Higher cost
Best For:
- Architecture decisions (critical)
- Security audits (thorough)
- Complex reasoning tasks
- When accuracy > speed
- Major refactoring plans
Example:
gemini -m gemini-2.5-pro -p "Should I use D1 or KV for session storage? Explain trade-offs."
cat ./src/api/* | gemini -m gemini-2.5-pro -p "Perform a security audit on this code"---
gemini-2.5-flash-lite
Status: ❌ Not accessible via Gemini CLI
Model exists in Gemini API but returns 404 error when accessed via CLI. Do not use.
---
When Models Disagree
Critical Finding: Flash and Pro can give opposite recommendations for the same question, and both can be valid.
Example (D1 vs KV for sessions):
- Flash: Recommends KV
- Prioritizes: Performance, edge caching, TTL
- "Usually acceptable" eventual consistency
- Pro: Recommends D1
- Prioritizes: Strong consistency, SQL queries
- "Critical" consistency for sessions
Why This Happens:
- Flash: Performance-focused
- Pro: Consistency-focused
How to Handle: 1. For critical/security decisions → Prefer Pro's perspective 2. For performance-sensitive apps → Consider Flash's perspective 3. For major architectural choices → Get both viewpoints:
gemini -p "Question?" # Flash (default)
gemini -m gemini-2.5-pro -p "Same question" # Pro---
Model Selection Matrix
| Task Type | Recommended Model | Why |
|---|---|---|
| Quick questions | Flash | Acceptable quality, fast |
| Architecture decisions | 3-Pro-Preview or 2.5-Pro | Most thorough trade-off analysis |
| Security reviews | 3-Pro-Preview or 2.5-Pro | Catches subtle issues |
| Debug assistance | Flash or 2.5-Pro | Root cause analysis is good enough |
| Code review | Flash | Comprehensive enough for most cases |
| Directory scanning | Flash | Pro models may get confused, use tools |
| Whole project analysis | 3-Pro-Preview or 2.5-Pro | Better with 1M context |
| Complex multimodal tasks | 3-Pro-Preview | Best multimodal understanding |
| Cutting-edge evaluation | 3-Pro-Preview | Latest capabilities |
---
Performance Comparison
Based on testing with same question ("D1 vs KV for sessions"):
| Model | Time | Quality | Recommendation |
|---|---|---|---|
| Flash | ~25s | ⭐⭐⭐⭐ | KV (performance) |
| Pro | ~23s | ⭐⭐⭐⭐⭐ | D1 (consistency) |
| Flash-lite | 404 error | N/A | Not accessible |
Key Finding: Pro isn't significantly slower than Flash on many queries!
---
Override Default Model
# Use Pro for single command
gemini -m gemini-2.5-pro -p "Review this code" < src/auth.ts
# Or set as environment variable for all commands in session
export GEMINI_MODEL=gemini-2.5-pro
gemini -p "Review this code" < src/auth.ts
gemini -p "Architecture question here"---
Recommendations
Default Strategy: Use Flash for most tasks, Pro (2.5 or 3) for critical decisions
When to Consider Gemini 3 Pro Preview:
- Cutting-edge projects requiring latest capabilities
- Complex multimodal analysis (images, videos, PDFs)
- Most critical architectural decisions
- Benchmark-critical applications
- Evaluation of newest features
- When cost is not primary concern
When to Use Gemini 2.5 Pro (Stable):
- Production-critical decisions
- Security audits
- Major refactors
- Stable, proven performance required
- Cost-effective Pro-level analysis
When Flash is Better:
- Quick code reviews
- Debugging
- Directory/file scanning
- Non-critical questions
- Cost-sensitive workflows
When to Get Multiple Perspectives:
- Critical architectural decisions
- Technology choices that affect entire project
- Performance vs consistency trade-offs
- Compare preview vs stable recommendations
---
Last Updated: 2025-11-19 (Gemini 3 preview release) Source: Systematic testing documented in gemini-experiments.md + official Gemini 3 announcement
AI-to-AI Prompting Best Practices
The Gemini CLI skill uses AI-to-AI prompting format for effective collaboration (based on systematic testing)
---
Format Structure
[Claude Code consulting Gemini for peer review]
Task: [Specific task description]
Provide direct analysis with file:line references. I will synthesize your
findings with mine before presenting to the developer.---
Why This Format Works
1. Prevents Role Confusion: Gemini knows it's advising Claude, not the human developer 2. Reduces Chattiness: More direct, less "helpful assistant" framing 3. Better Output: File:line references, concrete suggestions 4. Peer Review Dynamic: Two AI systems collaborating
---
Comparison
❌ Old Format (less effective):
You're an expert security researcher. Review this code for vulnerabilities...- More verbose
- "Helpful assistant" tone
- Chattier responses
✅ New Format (recommended):
[Claude Code consulting Gemini for peer review]
Task: Security review - identify vulnerabilities...
Provide direct analysis. I will synthesize findings.- Clear AI-to-AI context
- Direct task description
- Concise output
---
Custom Prompt Template
gemini "[Claude Code consulting Gemini for peer review]
Task: [Your specific task here - be concrete]
Provide direct analysis with [file:line | code examples | recommendations].
I will synthesize your findings before presenting to developer." \
--yolo -m gemini-2.5-flashKey Elements: 1. [Claude Code consulting Gemini for peer review] - AI-to-AI context 2. Task: - Specific task 3. Provide direct analysis... - Output format 4. I will synthesize... - Workflow explanation
---
Source: Testing documented in gemini-experiments.md (Experiment 1)
#!/bin/bash
# Setup /ask-gemini slash command for Claude Code
# Part of gemini-cli-integration skill
set -e
SKILL_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
COMMANDS_DIR="$HOME/.claude/commands"
COMMAND_NAME="ask-gemini.md"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "Setting up /ask-gemini slash command"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo ""
# Check if source file exists
if [ ! -f "$SKILL_DIR/assets/$COMMAND_NAME" ]; then
echo "❌ Error: $SKILL_DIR/assets/$COMMAND_NAME not found"
echo ""
echo "Make sure you're running this from the skill directory:"
echo " cd /path/to/claude-skills/skills/gemini-cli-integration/"
echo " ./scripts/setup-slash-command.sh"
exit 1
fi
# Create ~/.claude/commands if it doesn't exist
if [ ! -d "$COMMANDS_DIR" ]; then
echo "Creating $COMMANDS_DIR..."
mkdir -p "$COMMANDS_DIR"
fi
# Copy command file
echo "Copying $COMMAND_NAME to $COMMANDS_DIR..."
cp "$SKILL_DIR/assets/$COMMAND_NAME" "$COMMANDS_DIR/"
echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "✅ Slash command installed!"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo ""
echo "Usage in Claude Code sessions:"
echo " /ask-gemini Should I use D1 or KV for sessions?"
echo " /ask-gemini architect: Best way to handle WebSockets?"
echo " /ask-gemini review src/auth.ts for security issues"
echo ""
echo "The command will invoke the Gemini CLI with appropriate"
echo "AI-to-AI prompts and return Gemini's analysis to Claude Code."
echo ""
#!/bin/bash
# Test Gemini CLI installation and connectivity
# Part of gemini-cli skill (v2.0.0+)
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "Testing Gemini CLI Integration"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo ""
# Test 1: Check if Gemini CLI is installed
echo "1️⃣ Checking Gemini CLI installation..."
if ! command -v gemini &> /dev/null; then
echo " ❌ Gemini CLI not found"
echo ""
echo " Install with:"
echo " npm install -g @google/gemini-cli"
echo ""
exit 1
else
echo " ✅ Gemini CLI found"
gemini --version 2>&1 | sed 's/^/ /'
fi
echo ""
# Test 2: Check API connectivity with simple question
echo "2️⃣ Testing Gemini API connectivity..."
echo " Running: echo \"What is 2+2?\" | gemini -p \"Answer briefly\""
echo ""
if output=$(echo "What is 2+2?" | gemini -p "Answer briefly" 2>&1); then
echo " ✅ Gemini CLI executed successfully"
echo ""
echo " Response preview:"
echo "$output" | head -5 | sed 's/^/ /'
echo ""
else
echo " ❌ Gemini CLI failed"
echo ""
echo " Error:"
echo "$output" | sed 's/^/ /'
echo ""
echo " Common issues:"
echo " • Not authenticated: Run 'gemini' and follow auth prompts"
echo " • Rate limit exceeded: Wait 1-5 minutes"
echo " • Network issue: Check internet connection"
echo ""
exit 1
fi
# Test 3: Check if /ask-gemini slash command is installed (optional)
echo "3️⃣ Checking /ask-gemini slash command..."
if [ -f "$HOME/.claude/commands/ask-gemini.md" ]; then
echo " ✅ /ask-gemini command found"
else
echo " ⚠️ /ask-gemini command not found (optional)"
echo ""
echo " Install with:"
echo " ./scripts/setup-slash-command.sh"
echo ""
fi
echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "✅ All tests passed!"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo ""
echo "You can now use:"
echo " gemini -p \"Your question\""
echo " cat file.ts | gemini -p \"Review this code\""
echo " gemini -m gemini-2.5-pro -p \"Architecture question\""
echo " cat ./src | gemini -m gemini-2.5-pro -p \"Security audit\""
echo ""
echo "Or from Claude Code sessions:"
echo " /ask-gemini Your question here"
echo ""