gemini-cli
БесплатноЗапускает вложенные скриптыНе проверенGoogle Gemini CLI for second opinions, architectural advice, code reviews, security audits. Leverage 1M+ context for comprehensive codebase analysis via…
от secondsky★ 257 звёзд на GitHubОб этом скилле
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
- Model Selection: Flash vs Pro
- Top 3 Use Cases
- Integration Example
- Top 3 Errors & Solutions
- When to Load References
- Production Rules
Quick Start
Prerequisites:
- Gemini CLI installed (
bun add -g @google/gemini-cli) - Authenticated with Google account (run
geminionce to authenticate)
Core Command Patterns:
# Quick question (non-interactive with -p flag)
gemini -p "Should I use D1 or KV for session storage?"
# Code review with file context
cat src/auth.ts | gemini -p "Review this authentication code for security vulnerabilities"
# Architecture advice using Pro model
gemini -m gemini-2.5-pro -p "Best way to handle WebSockets in Cloudflare Workers?"
# With all files in directory
gemini --all-files -p "Review this auth implementation for security issues"
# Interactive mode for follow-up questions
gemini -i "Help me debug this authentication error"
Critical: Always use -p flag for non-interactive commands in automation/scripts.
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?"
- Pattern:
gemini -m gemini-2.5-pro -p "[architectural question]"
Security-Sensitive Code Changes
- Authentication systems, payment processing, PII handling
- API key/secret management
- Pattern:
cat [security-file] | gemini -m gemini-2.5-pro -p "Security audit this code"
Stuck Debugging (2+ Failed Attempts)
- Error persists after 2 debugging attempts
- Stack trace unclear or intermittent bugs
- Pattern:
gemini -p "Help debug: [error message]" < error.log
Large Refactors (5+ Files)
- Core architecture changes, database schema migrations
- Pattern:
gemini --all-files -m gemini-2.5-pro -p "Review this refactoring plan"
Context Window Pressure (70%+ Full)
- Approaching token limit, need to offload analysis
- Pattern:
cat large-file.ts | gemini -p "Analyze this code structure"
OPTIONALLY Consult
- Unfamiliar Technology - Using library/framework for first time
- Code Reviews - Before committing major changes
Installation
1. Install Gemini CLI
bun add -g @google/gemini-cli
2. Authenticate
gemini
Follow the authentication prompts to link your Google account.
3. Verify Installation
gemini --version # Should show 0.13.0+
gemini -p "What is 2+2?" # Test connection
Model Selection: Flash vs Pro
gemini-2.5-flash (Default)
- Speed: ~5-25 seconds
- Quality: Good for most tasks
- Use For: Code reviews, debugging, quick questions
- Cost: Lower
gemini -m gemini-2.5-flash -p "Review this function for performance issues"
gemini-2.5-pro
- Speed: ~15-30 seconds
- Quality: Excellent, thorough analysis
- Use For: Architecture decisions, security audits, major refactors
- Cost: Higher
gemini -m gemini-2.5-pro -p "Security audit this authentication system"
Quick Decision Guide
Quick question? → Flash
Security/architecture? → Pro
Debugging? → Flash (try Pro if stuck)
Refactoring 5+ files? → Pro
CRITICAL FINDING: Flash and Pro can give opposite recommendations on the same question (both valid, different priorities). Flash prioritizes performance, Pro prioritizes consistency/correctness. For details, load references/models-guide.md.
Top 3 Use Cases
1. 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
"
2. Architecture Decision
# Compare technologies with context
gemini -m gemini-2.5-pro -p "
Context: Building Cloudflare Worker with user authentication.
Question: Should I use D1 or KV for storing session data?
Considerations:
1. Session reads on every request
2. TTL-based expiration
3. Cost under 10M requests/month
4. Deployment complexity
Установить gemini-cli в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл gemini-cli?
Google Gemini CLI for second opinions, architectural advice, code reviews, security audits. Leverage 1M+ context for comprehensive codebase analysis via command-line tool.
Как установить скилл 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