Skip to content
Development
Skill

/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.

From plugin
claude-skills
241183 skills42 agents62 commands2 MCP

Claude Code

$ npx -y skills add secondsky/claude-skills --skill gemini-cli --agent claude-code

SKILL.md

gemini-cli.SKILL.md
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
  production_tested: true
  gemini_cli_version: 0.13.0+
  last_verified: 2025-11-13
  token_savings: ~60-70%
  errors_prevented: 6+
  keywords:
    - gemini-cli
    - google gemini
    - gemini command line
    - second opinion
    - model comparison
    - gemini-2.5-flash
    - gemini-2.5-pro
    - 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

**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](#quick-start) 2. [When to Use Gemini Consultation](#when-to-use-gemini-consultation) 3. [Installation](#installation) 4. [Model Selection: Flash vs Pro](#model-selection-flash-vs-pro) 5. [Top 3 Use Cases](#top-3-use-cases) 6. [Integration Example](#integration-example) 7. [Top 3 Errors & Solutions](#top-3-errors--solutions) 8. [When to Load References](#when-to-load-references) 9. [Production Rules](#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**:

# 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

6. **Unfamiliar Technology** - Using library/framework for first time 7. **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
Read more
@secondsky
Ships withclaude-skills

145 production-ready skills for Claude Code CLI 🔌 Platform / Harness Support These plugins ship as Claude Code marketplace plugins (.claude-plugin/ manifests) and Codex CLI plugins (.codex-plugin/ manifests).

241183 skills42 agents2 MCP
Get the whole plugin

Stars on GitHub

Momentum

stars in total
241
Star history of secondsky/claude-skills on GitHub, a chart by star-history.com

Other skills on claude-skills.

aceternity-ui

aceternity-ui

100+ animated React components (Aceternity UI) for Next.js with Tailwind. Use for hero sections, parallax, 3D effects, or…

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills13d309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc2w293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react4d252k
@facebook@facebookInstall Skill

Questions about gemini-cli.

Which coding agents can use gemini-cli?
gemini-cli installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.