Skip to content
Back to search

gemini-cli

Wield Google's Gemini CLI as a powerful auxiliary tool for code generation, review, analysis, and web research. Use when tasks benefit from a second AI perspective, current web information via Google Search, codebase architecture analysis, or parallel code generation. Also use when user explicitly requests Gemini operations.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/forayconsulting-gemini-cli-skill/badge.svg)](/listings/forayconsulting-gemini-cli-skill)

HTML

<a href="/listings/forayconsulting-gemini-cli-skill"><img src="/api/listings/forayconsulting-gemini-cli-skill/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

Copy the skill directory to your Claude Code skills folder:

# Clone the repo
git clone https://github.com/forayconsulting/gemini_cli_skill.git

# Copy to Claude Code skills directory
cp -r gemini_cli_skill ~/.claude/skills/gemini-cli

Or manually create `~/.claude/skills/gemini-cli/` and copy the files.

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

SKILL.md · Manifest · 202 lines · 4 findings marked

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. ---
  2. name: gemini-cli
  3. description: Wield Google's Gemini CLI as a powerful auxiliary tool for code generation, review, analysis, and web research. Use when tasks benefit from a second AI perspective, current web information via Google Search, codebase architecture analysis, or parallel code generation. Also use when user explicitly requests Gemini operations.
  4. allowed-tools:
  5. - Bash
  6. - Read
  7. - Write
  8. - Grep
  9. - Glob
  10. ---
  11. # Gemini CLI Integration Skill
  12. This skill enables Claude Code to effectively orchestrate Gemini CLI (v0.16.0+) with Gemini 3 Pro for code generation, review, analysis, and specialized tasks.
  13. ## When to Use This Skill
  14. ### Ideal Use Cases
  15. 1. **Second Opinion / Cross-Validation**
  16. - Code review after writing code (different AI perspective)
  17. - Security audit with alternative analysis
  18. - Finding bugs Claude might have missed
  19. 2. **Google Search Grounding**
  20. - Questions requiring current internet information
  21. - Latest library versions, API changes, documentation updates
  22. - Current events or recent releases
  23. 3. **Codebase Architecture Analysis**
  24. - Use Gemini's `codebase_investigator` tool
  25. - Understanding unfamiliar codebases
  26. - Mapping cross-file dependencies
  27. 4. **Parallel Processing**
  28. - Offload tasks while continuing other work
  29. - Run multiple code generations simultaneously
  30. - Background documentation generation
  31. 5. **Specialized Generation**
  32. - Test suite generation
  33. - JSDoc/documentation generation
  34. - Code translation between languages
  35. ### When NOT to Use
  36. - Simple, quick tasks (overhead not worth it)
  37. - Tasks requiring immediate response (rate limits cause delays)
  38. - When context is already loaded and understood
  39. - Interactive refinement requiring conversation
  40. ## Core Instructions
  41. ### 1. Verify Installation
  42. ```bash
  43. command -v gemini || which gemini
  44. ```
  45. ### 2. Basic Command Pattern
  46. ```bash
  47. gemini "[prompt]" --yolo -o text 2>&1
  48. ```
  49. Key flags:
  50. - `--yolo` or `-y`: Auto-approve all tool calls
  51. - `-o text`: Human-readable output
  52. - `-o json`: Structured output with stats
  53. - `-m gemini-2.5-flash`: Use faster model for simple tasks
  54. ### 3. Critical Behavioral Notes
  55. **YOLO Mode Behavior**: Auto-approves tool calls but does NOT prevent planning prompts. Gemini may still present plans and ask "Does this plan look good?" Use forceful language:
  56. - "Apply now"
  57. - "Start immediately"
  58. - "Do this without asking for confirmation"
  59. **Rate Limits**: Free tier has 60 requests/min, 1000/day. CLI auto-retries with backoff. Expect messages like "quota will reset after Xs".
  60. ### 4. Output Processing
  61. For JSON output (`-o json`), parse:
  62. ```json
  63. {
  64. "response": "actual content",
  65. "stats": {
  66. "models": { "tokens": {...} },
  67. "tools": { "byName": {...} }
  68. }
  69. }
  70. ```
  71. ## Quick Reference Commands
  72. ### Code Generation
  73. ```bash
  74. gemini "Create [description] with [features]. Output complete file content." --yolo -o text
  75. ```
  76. ### Code Review
  77. ```bash
  78. gemini "Review [file] for: 1) features, 2) bugs/security issues, 3) improvements" -o text
  79. ```
  80. ### Bug Fixing
  81. ```bash
  82. gemini "Fix these bugs in [file]: [list]. Apply fixes now." --yolo -o text
  83. ```
  84. ### Test Generation
  85. ```bash
  86. gemini "Generate [Jest/pytest] tests for [file]. Focus on [areas]." --yolo -o text
  87. ```
  88. ### Documentation
  89. ```bash
  90. gemini "Generate JSDoc for all functions in [file]. Output as markdown." --yolo -o text
  91. ```
  92. ### Architecture Analysis
  93. ```bash
  94. gemini "Use codebase_investigator to analyze this project" -o text
  95. ```
  96. ### Web Research
  97. ```bash
  98. gemini "What are the latest [topic]? Use Google Search." -o text
  99. ```
  100. ### Faster Model (Simple Tasks)
  101. ```bash
  102. gemini "[prompt]" -m gemini-2.5-flash -o text
  103. ```
  104. ## Error Handling
  105. ### Rate Limit Exceeded
  106. - CLI auto-retries with backoff
  107. - Use `-m gemini-2.5-flash` for lower priority tasks
  108. - Run in background for long operations
  109. ### Command Failures
  110. - Check JSON output for detailed error stats
  111. - Verify Gemini is authenticated: `gemini --version`
  112. - Check `~/.gemini/settings.json` for config issues
  113. ### Validation After Generation
  114. Always verify Gemini's output:
  115. - Check for security vulnerabilities (XSS, injection)
  116. - Test functionality matches requirements
  117. - Review code style consistency
  118. - Verify dependencies are appropriate
  119. ## Integration Workflow
  120. ### Standard Generate-Review-Fix Cycle
  121. ```bash
  122. # 1. Generate
  123. gemini "Create [code]" --yolo -o text
  124. # 2. Review (Gemini reviews its own work)
  125. gemini "Review [file] for bugs and security issues" -o text
  126. # 3. Fix identified issues
  127. gemini "Fix [issues] in [file]. Apply now." --yolo -o text
  128. ```
  129. ### Background Execution
  130. For long tasks, run in background and monitor:
  131. ```bash
  132. gemini "[long task]" --yolo -o text 2>&1 &
  133. # Monitor with BashOutput tool
  134. ```
  135. ## Gemini's Unique Capabilities
  136. These tools are available only through Gemini:
  137. 1. **google_web_search** - Real-time internet search via Google
  138. 2. **codebase_investigator** - Deep architectural analysis
  139. 3. **save_memory** - Cross-session persistent memory
  140. ## Configuration
  141. ### Project Context (Optional)
  142. Create `.gemini/GEMINI.md` in project root for persistent context that Gemini will automatically read.
  143. ### Session Management
  144. List sessions: `gemini --list-sessions`
  145. Resume session: `echo "follow-up" | gemini -r [index] -o text`
  146. ## See Also
  147. - `reference.md` - Complete command and flag reference
  148. - `templates.md` - Prompt templates for common operations
  149. - `patterns.md` - Advanced integration patterns
  150. - `tools.md` - Gemini's built-in tools documentation
README.md · README · 117 lines · 1 finding marked

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # Gemini CLI Skill for Claude Code
  2. A Claude Code skill that enables effective use of Google's Gemini CLI as a powerful auxiliary tool.
  3. ## What This Skill Does
  4. This skill teaches Claude Code how to wield Gemini CLI for:
  5. - **Code Generation** - Create apps, components, and modules
  6. - **Code Review** - Security audits, bug detection, improvements
  7. - **Test Generation** - Unit tests, integration tests
  8. - **Documentation** - JSDoc, README, API docs
  9. - **Web Research** - Current information via Google Search
  10. - **Architecture Analysis** - Codebase investigation and mapping
  11. ## Installation
  12. Copy the skill directory to your Claude Code skills folder:
  13. ```bash
  14. # Clone the repo
  15. git clone https://github.com/forayconsulting/gemini_cli_skill.git
  16. # Copy to Claude Code skills directory
  17. cp -r gemini_cli_skill ~/.claude/skills/gemini-cli
  18. ```
  19. Or manually create `~/.claude/skills/gemini-cli/` and copy the files.
  20. ## Prerequisites
  21. - [Gemini CLI](https://github.com/google-gemini/gemini-cli) installed
  22. - Gemini API key or OAuth authentication configured
  23. ```bash
  24. # Install Gemini CLI
  25. npm install -g @google/gemini-cli
  26. # Authenticate
  27. gemini # First run prompts for auth
  28. ```
  29. ## Files
  30. | File | Purpose |
  31. |------|---------|
  32. | `SKILL.md` | Main skill definition - when to use, core instructions |
  33. | `reference.md` | Complete CLI command and flag reference |
  34. | `templates.md` | Reusable prompt templates for common tasks |
  35. | `patterns.md` | Integration patterns and workflows |
  36. | `tools.md` | Gemini's built-in tools documentation |
  37. ## Usage
  38. Once installed, Claude Code automatically uses this skill when appropriate. Just ask:
  39. ```
  40. "Use Gemini to review this code for security issues"
  41. "Have Gemini generate tests for this module"
  42. "Ask Gemini what's new in TypeScript 5.5"
  43. "Get Gemini to analyze this codebase architecture"
  44. ```
  45. ## Key Features
  46. ### Prompt Templates
  47. Ready-to-use templates for:
  48. - Code generation (single-file, multi-file, components)
  49. - Code review (comprehensive, security, performance)
  50. - Test generation (unit, integration)
  51. - Documentation (JSDoc, README, API)
  52. ### Integration Patterns
  53. - **Generate-Review-Fix** - Quality assurance cycle
  54. - **Background Execution** - Parallel task processing
  55. - **Model Selection** - Pro vs Flash decision tree
  56. - **Rate Limit Handling** - Strategies for free tier limits
  57. ### Gemini's Unique Tools
  58. - `google_web_search` - Real-time internet search
  59. - `codebase_investigator` - Deep architecture analysis
  60. - `save_memory` - Cross-session persistence
  61. ## Quick Reference
  62. ```bash
  63. # Basic generation
  64. gemini "Create [description]" --yolo -o text
  65. # Code review
  66. gemini "Review [file] for bugs and security issues" -o text
  67. # Web research
  68. gemini "What's new in [topic]? Use Google Search." -o text
  69. # Architecture analysis
  70. gemini "Use codebase_investigator to analyze this project" -o text
  71. # Faster model for simple tasks
  72. gemini "[prompt]" -m gemini-2.5-flash -o text
  73. ```
  74. ## Why Use Gemini from Claude Code?
  75. | Use Case | Benefit |
  76. |----------|---------|
  77. | Second opinion | Different AI perspective on code |
  78. | Current info | Google Search grounding |
  79. | Architecture | codebase_investigator tool |
  80. | Parallel work | Offload tasks while continuing |
  81. ## License
  82. MIT

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.