Agent skill

Gemini CLI

by secondsky in secondsky/claude-skills

Google Gemini CLI for second opinions, architectural advice, code reviews, security audits.

MITAuto-check passedDevelopment

Install Gemini CLI

skills CLI
$ npx skills add secondsky/claude-skills --skill gemini-cli -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install secondsky/claude-skills gemini-cli --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/secondsky/claude-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/gemini-cli/skills/gemini-cli .claude/skills/gemini-cli && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
gemini-cli
GitHub stars
227
Used in
1 other repo
Token cost
~2.8k tokens
SKILL.md length
721 words
Files
8 (incl. scripts, references)
Skills in repo
169
Repo updated
First seen
Licence
MIT

At a glance

Google Gemini CLI for second opinions, architectural advice, code reviews, security audits.

  • Works in 12 steps: Install Gemini CLI → Authenticate → Verify Installation → …
  • Tasks that involve Security review
  • SKILL.md covers Table of Contents, Quick Start, When to Use Gemini Consultation and Installation, plus 6 more sections
  • Runs Shell scripts from its folder; calls gemini, bun and claude

What it does

Gemini CLI is an agent skill from secondsky/claude-skills. Google Gemini CLI for second opinions, architectural advice, code reviews, security audits. Leverage 1M+ context for comprehensive codebase analysis via command-line tool.

Its SKILL.md is about 2.8k tokens, which your agent loads only when the skill is triggered. The skill folder holds 9 other files, including scripts and reference files (for example `references/gemini-experiments.md`, `references/helper-functions.md` and `references/models-guide.md`).

It sits in Development, covering Security review, Code review and Codebase onboarding. It works with Google Gemini. The repository describes itself as: Production-ready skills for Claude Code CLI - Cloudflare, React, Tailwind v4, and AI integrations. The licence is MIT.

When your agent uses it

  • Tasks that involve Security review
  • Tasks that involve Code review
  • Tasks that involve Codebase onboarding

Example prompts

  • “/gemini-cli”

Requirements

  • A Bash shell

Workflow steps

12 steps, taken from the step headings in SKILL.md.

  1. Install Gemini CLI
  2. Authenticate
  3. Verify Installation
  4. Security Audit
  5. Architecture Decision
  6. Debugging Root Cause
  7. Always Use -p for Automation
  8. Select Model Based on Criticality
  9. Provide Context in Prompts
  10. Pipe File Content for Reviews
  11. Synthesize, Don't Just Forward
  12. Handle Errors Gracefully

What it can do on your machine

Read from SKILL.md and the folder at commit 8837836. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 3 files in scripts/ (Shell), which the agent can run.

    Shell commands in SKILL.md call:

    • gemini
    • bun
    • claude

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Gemini CLI loads about 2.8k tokens when it runs, and up to ~7.8k if it reads all its reference files. Until then it costs about 46 tokens; SKILL.md has 721 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~46
When it runs · the whole SKILL.md, loaded when a task matches
~2.8k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~7.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from secondsky/claude-skills at commit 8837836, republished under its MIT licence (© secondsky). 721 words, ~2,820 tokens.

Download SKILL.mdSave it as .claude/skills/gemini-cli/SKILL.md (or your agent's skills folder). This skill also uses 7 other files; get the full folder from GitHub.
name
gemini-cli
description
Google Gemini CLI for second opinions, architectural advice, code reviews, security audits. Leverage 1M+ context for comprehensive codebase analysis via command-line tool.
license
MIT
metadata.version
2.1.0
metadata.production_tested
true
metadata.gemini_cli_version
0.13.0+
metadata.last_verified
2025-11-13
metadata.token_savings
~60-70%
metadata.errors_prevented
6+
metadata.keywords
gemini-cli, google gemini, gemini command line, second opinion, model comparison, gemini-2.5-flash, gemini-2.5-pro, architectural decisions, debugging…

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. Model Selection: Flash vs Pro
  5. Top 3 Use Cases
  6. Integration Example
  7. Top 3 Errors & Solutions
  8. When to Load References
  9. Production Rules

Quick Start

Prerequisites:

  • Gemini CLI installed (bun add -g @google/gemini-cli)
  • Authenticated with Google account (run gemini once to authenticate)

Core Command Patterns:

bash
# 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:

  1. 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]"
  2. 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"
  3. 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
  4. Large Refactors (5+ Files)

    • Core architecture changes, database schema migrations
    • Pattern: gemini --all-files -m gemini-2.5-pro -p "Review this refactoring plan"
  5. 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
  1. Unfamiliar Technology - Using library/framework for first time
  2. Code Reviews - Before committing major changes

Installation

1. Install Gemini CLI
bash
bun add -g @google/gemini-cli
2. Authenticate
bash
gemini

Follow the authentication prompts to link your Google account.

3. Verify Installation
bash
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
bash
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
bash
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
bash
# 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
bash
# 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
"
3. Debugging Root Cause
bash
# Analyze error logs with context
tail -100 error.log | gemini -p "
These errors started after deploying auth changes. What's the likely root cause?

Context:
- Added JWT validation middleware
- Using @cloudflare/workers-jwt
- Errors only on /api/* routes
"

For more use cases: Load references/models-guide.md for performance optimization, refactoring plans, and code reviews.


Integration Example

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. Consider: read/write patterns, cost, performance, complexity."]

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]"

Key Pattern: Synthesize both perspectives, don't just forward Gemini's response.


Top 3 Errors & Solutions

Error 1: Not Authenticated

Error: Error: Not authenticated

Solution:

bash
gemini  # Follow authentication prompts
Show full SKILL.md (286 more words)Show less
Error 2: Model Not Found

Error: Error: Model not found: gemini-2.5-flash-lite

Cause: Model deprecated or renamed (flash-lite doesn't exist)

Solution: Use stable models only:

bash
gemini -m gemini-2.5-flash -p "Your question"
gemini -m gemini-2.5-pro -p "Your question"
Error 3: Command Hangs

Cause: Interactive mode when expecting non-interactive

Solution: Always use -p flag for non-interactive commands

bash
# ✅ Correct
gemini -p "Question"

# ❌ Wrong (will hang waiting for input)
gemini "Question"

For more troubleshooting: Load references/models-guide.md for rate limits, large file context issues, and performance tips.


When to Load References

Load reference files in these scenarios:

Load references/models-guide.md when:
  • User asks about Flash vs Pro differences
  • Models give conflicting recommendations
  • Need detailed performance comparison
  • Choosing model for specific task type
  • Want to understand why models disagree
Load references/prompting-strategies.md when:
  • Crafting complex prompts to Gemini
  • Need AI-to-AI prompting format template
  • Want to improve prompt quality
  • Comparing old vs new prompting approaches
Load references/gemini-experiments.md when:
  • Need historical context on testing
  • Investigating edge cases
  • Understanding design decisions
  • Troubleshooting unusual behavior

Note: helper-functions.md is obsolete (references old gemini-coach wrapper, not the official gemini CLI).


Production Rules

1. Always Use -p for Automation
bash
# ✅ Good for scripts
gemini -p "Question"

# ❌ Bad (interactive)
gemini
2. Select Model Based on Criticality
bash
# 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
bash
# ✅ Good: Context + Question + Considerations
gemini -p "Context: Building Cloudflare Worker. Question: Best auth pattern? Considerations: 1) Stateless, 2) JWT, 3) <100ms overhead"

# ❌ Bad: Vague
gemini -p "Best auth?"
4. Pipe File Content for Reviews
bash
# ✅ Efficient
cat src/auth.ts | gemini -p "Review for security"

# ❌ Less efficient
gemini -p "Review src/auth.ts"
5. Synthesize, Don't Just Forward

❌ BAD: Just paste Gemini's response

Claude: [runs gemini] "Gemini says: [paste]"

✅ GOOD: Synthesize both perspectives

Claude: "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]"
6. Handle Errors Gracefully
bash
if output=$(gemini -p "Question" 2>&1); then
  echo "Gemini says: $output"
else
  echo "Gemini consultation failed, proceeding with Claude's recommendation"
fi

Version History

2.1.0 (2025-12-15):

  • Optimized to <500 lines (Phase 12.5 → 13 condensation)
  • Extracted detailed content to references/
  • Added "When to Load References" section
  • Condensed to top 3 errors, top 3 use cases

2.0.0 (2025-11-13):

  • Complete rewrite for official Gemini CLI (removed gemini-coach wrapper)
  • Direct CLI integration patterns
  • Updated command examples for gemini CLI v0.13.0+

1.0.0 (2025-11-08):

  • Initial release with gemini-coach wrapper


License

MIT - See LICENSE


Support

© secondsky, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 7 other files (scripts, references) in plugins/gemini-cli/skills/gemini-cli of secondsky/claude-skills.

  • SKILL.md
  • references/gemini-experiments.md
  • references/helper-functions.md
  • references/models-guide.md
  • references/prompting-strategies.md
  • scripts/install-gemini-coach.sh
  • scripts/setup-slash-command.sh
  • scripts/test-connection.sh

Open the folder on GitHubat commit 8837836

Used in 1 other repository

We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in secondsky/claude-skills, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Gemini CLI next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Gemini CLI compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Gemini CLI this skillsecondsky/claude-skills2271 repos~2.8kAutomated safety check: PassMIT
Geminigiuseppe-trisciuoglio/developer-kit3551 repos~2.3kAutomated safety check: NotesMIT
Code Review Specialistluongnv89/claude-howto42k—~764Automated safety check: PassMIT
Verdaccio Code Reviewverdaccio/verdaccio18k—~853Automated safety check: PassMIT
Bug Huntercodexstar69/bug-hunter519—~5kAutomated safety check: PassMIT
Codebase Review SwarmZaxbyHub/opencode-swarm490—~2.8kAutomated safety check: PassMIT

Similar skills

  • Gemini

    giuseppe-trisciuoglio/developer-kit

    Provides Gemini CLI delegation workflows for large-context analysis and complex reasoning using Gemini 3.0 Flash and Gemini 3.0 Pro models, including English prompt formulation, execution flags, and…

    355 GitHub starsUsed in 1 repo~2.3k tokens
    DevelopmentAuto-check: notes
  • Code Review Specialist

    luongnv89/claude-howto

    Reviews code for security, performance, quality and maintainability, using a checklist, a finding template and two metrics scripts.

    42k GitHub stars~764 tokensUpdated 7 days ago
    DevelopmentAuto-check passed
  • Verdaccio Code Review

    verdaccio/verdaccio

    Reviews a verdaccio diff, branch or PR against the repository's review guide, verifies each finding in the code and reports only actionable issues.

    18k GitHub stars~853 tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Bug Hunter

    codexstar69/bug-hunter

    Precision-first adversarial bug hunting for runtime, logic, data, concurrency, and security defects.

    519 GitHub stars~5k tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Codebase Review Swarm

    ZaxbyHub/opencode-swarm

    Runs an evidence-gated, quote-grounded audit of a codebase for security, QA, accessibility, performance and more, and writes a verified report without changing source files.

    490 GitHub stars~2.8k tokensUpdated today
    DevelopmentAuto-check passed
  • Code Review And Security Audit

    hiroshiyui/GuilelessBopomofo

    Review code for quality, correctness, and security vulnerabilities.

    135 GitHub stars~1.6k tokensUpdated 10 days ago
    DevelopmentAuto-check passed

More from secondsky/claude-skills

All 169 skills in this repo
  • Tanstack AI

    secondsky/claude-skills

    TanStack AI (alpha) provider-agnostic type-safe chat with streaming for OpenAI, Anthropic, Gemini, Ollama.

    227 GitHub starsUsed in 1 repo~3.6k tokens
    Auto-check: notes
  • Auto Animate

    secondsky/claude-skills

    AutoAnimate (@formkit/auto-animate) zero-config animations for React.

    227 GitHub stars~2.9k tokensUpdated 9 days ago
    Auto-check passed
  • Base UI React

    secondsky/claude-skills

    MUI Base UI unstyled React components with Floating UI. An agent skill from secondsky/claude-skills.

    227 GitHub stars~1.9k tokensUpdated 9 days ago
    Auto-check passed
  • Cloudflare Images

    secondsky/claude-skills

    This skill should be used when the user asks to "upload images to Cloudflare", "implement direct creator upload", "configure image transformations", "optimize WebP/AVIF", "create image variants"…

    227 GitHub stars~3.6k tokensUpdated 9 days ago
    Auto-check: notes
  • Cloudflare Nextjs

    secondsky/claude-skills

    Deploy Next.js to Cloudflare Workers via the OpenNext adapter (@opennextjs/cloudflare).

    227 GitHub stars~5.3k tokensUpdated 9 days ago
    Auto-check: notes
  • Cloudflare Sandbox

    secondsky/claude-skills

    Cloudflare Sandboxes SDK for secure code execution in Linux containers at edge.

    227 GitHub stars~4.5k tokensUpdated 9 days ago
    Auto-check passed

Works with

Questions about Gemini CLI

What does Gemini CLI do?

Google Gemini CLI for second opinions, architectural advice, code reviews, security audits. Gemini CLI is an agent skill from secondsky/claude-skills. Google Gemini CLI for second opinions, architectural advice, code reviews, security audits.

When should I use Gemini CLI?

Gemini CLI fits situations like: tasks that involve Security review; tasks that involve Code review; tasks that involve Codebase onboarding.

How do I install Gemini CLI in Claude Code?

Run `npx skills add secondsky/claude-skills --skill gemini-cli -a claude-code`. Or copy the skill folder (plugins/gemini-cli/skills/gemini-cli in secondsky/claude-skills) into .claude/skills/gemini-cli in your project. Claude Code loads it when a task matches its description.

How do I install Gemini CLI in Codex?

Run `npx skills add secondsky/claude-skills --skill gemini-cli -a codex`. Or copy the skill folder (plugins/gemini-cli/skills/gemini-cli in secondsky/claude-skills) into .agents/skills/gemini-cli in your project. Codex loads it when a task matches its description.

Can I use Gemini CLI in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add secondsky/claude-skills --skill gemini-cli -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/gemini-cli, .gemini/skills/gemini-cli, .github/skills/gemini-cli and .opencode/skills/gemini-cli in your project.

What does Gemini CLI need to run?

Going by SKILL.md and its folder, Gemini CLI needs a shell for the scripts in its folder and the command-line tools its instructions call (gemini, bun and claude). Our summary lists: A Bash shell.

Does Gemini CLI access the network?

SKILL.md names 1 domain. As links in the text: github.com. This is read from the text; nothing was executed.

Is Gemini CLI safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Gemini CLI use?

Gemini CLI is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Gemini CLI use?

About 2.8k tokens (SKILL.md is roughly 11k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 4.9k tokens, read only when the agent opens those files.

What are the alternatives to Gemini CLI?

Skills that share tags, products or a category with Gemini CLI: Gemini (giuseppe-trisciuoglio/developer-kit, 355 stars), Code Review Specialist (luongnv89/claude-howto, 42k stars), Verdaccio Code Review (verdaccio/verdaccio, 18k stars) and Bug Hunter (codexstar69/bug-hunter, 519 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Gemini CLI?

secondsky (a GitHub user) maintains it in secondsky/claude-skills, which has 227 GitHub stars. The repository holds 169 skills in this directory. The repository was last updated on September 28, 2026.

Source: secondsky/claude-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.