gemini-cli
Google Gemini CLI orchestration for AI-assisted development. Capabilities: second opinion/cross-validation, real-time web search (Google Search), codebase architecture analysis, parallel code generation, code review from different perspective. Actions: query, search, analyze, generate, review with Gemini. Keywords: Gemini CLI, second opinion, cross-validation, Google Search, web research, current information, parallel AI, code review, architecture analysis, gemini prompt, AI comparison, real-time search, alternative perspective, code generation. Use when: needing second AI opinion, searching current web information, analyzing codebase architecture, generating code in parallel, getting alternative code review, researching current events/docs.
NPX Install
npx skill4agent add samhvw8/dot-claude gemini-cliTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Gemini CLI Integration Skill
When to Use This Skill
Ideal Use Cases
-
Second Opinion / Cross-Validation
- Code review after writing code (different AI perspective)
- Security audit with alternative analysis
- Finding bugs Claude might have missed
-
Google Search Grounding
- Questions requiring current internet information
- Latest library versions, API changes, documentation updates
- Current events or recent releases
-
Codebase Architecture Analysis
- Use Gemini's tool
codebase_investigator - Understanding unfamiliar codebases
- Mapping cross-file dependencies
- Use Gemini's
-
Parallel Processing
- Offload tasks while continuing other work
- Run multiple code generations simultaneously
- Background documentation generation
-
Specialized Generation
- Test suite generation
- JSDoc/documentation generation
- Code translation between languages
When NOT to Use
- Simple, quick tasks (overhead not worth it)
- Tasks requiring immediate response (rate limits cause delays)
- When context is already loaded and understood
- Interactive refinement requiring conversation
Core Instructions
1. Verify Installation
command -v gemini || which gemini2. Basic Command Pattern
gemini "[prompt]" --yolo -o text 2>&1- or
--yolo: Auto-approve all tool calls-y - : Human-readable output
-o text - : Structured output with stats
-o json - : Use faster model for simple tasks
-m gemini-2.5-flash
3. Critical Behavioral Notes
- "Apply now"
- "Start immediately"
- "Do this without asking for confirmation"
4. Output Processing
-o json{
"response": "actual content",
"stats": {
"models": { "tokens": {...} },
"tools": { "byName": {...} }
}
}Quick Reference Commands
Code Generation
gemini "Create [description] with [features]. Output complete file content." --yolo -o textCode Review
gemini "Review [file] for: 1) features, 2) bugs/security issues, 3) improvements" -o textBug Fixing
gemini "Fix these bugs in [file]: [list]. Apply fixes now." --yolo -o textTest Generation
gemini "Generate [Jest/pytest] tests for [file]. Focus on [areas]." --yolo -o textDocumentation
gemini "Generate JSDoc for all functions in [file]. Output as markdown." --yolo -o textArchitecture Analysis
gemini "Use codebase_investigator to analyze this project" -o textWeb Research
gemini "What are the latest [topic]? Use Google Search." -o textFaster Model (Simple Tasks)
gemini "[prompt]" -m gemini-2.5-flash -o textError Handling
Rate Limit Exceeded
- CLI auto-retries with backoff
- Use for lower priority tasks
-m gemini-2.5-flash - Run in background for long operations
Command Failures
- Check JSON output for detailed error stats
- Verify Gemini is authenticated:
gemini --version - Check for config issues
~/.gemini/settings.json
Validation After Generation
- Check for security vulnerabilities (XSS, injection)
- Test functionality matches requirements
- Review code style consistency
- Verify dependencies are appropriate
Integration Workflow
Standard Generate-Review-Fix Cycle
# 1. Generate
gemini "Create [code]" --yolo -o text
# 2. Review (Gemini reviews its own work)
gemini "Review [file] for bugs and security issues" -o text
# 3. Fix identified issues
gemini "Fix [issues] in [file]. Apply now." --yolo -o textBackground Execution
gemini "[long task]" --yolo -o text 2>&1 &
# Monitor with BashOutput toolGemini's Unique Capabilities
- google_web_search - Real-time internet search via Google
- codebase_investigator - Deep architectural analysis
- save_memory - Cross-session persistent memory
Configuration
Project Context (Optional)
.gemini/GEMINI.mdSession Management
gemini --list-sessionsecho "follow-up" | gemini -r [index] -o textSee Also
- - Complete command and flag reference
reference.md - - Prompt templates for common operations
templates.md - - Advanced integration patterns
patterns.md - - Gemini's built-in tools documentation
tools.md