Gemini CLI
БесплатноЗапускает вложенные скриптыНе проверенConsult Google Gemini CLI for second opinions on architecture, debugging, and security audits. Use Gemini's 1M+ context window for comprehensive code…
Об этом скилле
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
- Quick Start
- When to Use Gemini Consultation
- Installation
- Using Gemini CLI
- Model Selection: Flash vs Pro
- Proactive Consultation Patterns
- AI-to-AI Prompting Best Practices
- Common Use Cases
- Integration Examples
- 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:
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]"
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"
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"
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
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
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]"
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-cli
2. Authenticate
gemini
Follow the authentication prompts to link your Google account.
3. Verify Installation
gemini --version
Should 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-acce
Установить Gemini CLI в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл Gemini CLI?
Consult Google Gemini CLI for second opinions on architecture, debugging, and security audits. Use Gemini's 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-Preview comparison. 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, flash vs pro, AI-to-AI prompting, peer review, codebase analysis, gemini CLI tool, shell gemini, command line AI assistant, gemini architecture advice, gemini debug help, gemini security scan, gemini code compare
Как установить скилл Gemini CLI?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл Gemini CLI запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic