Token导航 LogoToken导航TokenDH.com
研究检索敏感数据github未标认证来源可访问clear审计提醒

gemini-cliGemini CLI

Agent Skill

gemini-cli 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

451

周安装

19

GitHub Stars

9

下载量

158
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:gemini-cli(Gemini CLI)
来源仓库:https://github.com/adaptationio/skrillz
仓库路径:skills/gemini-cli
安装命令:
npx skills add https://github.com/adaptationio/skrillz --skill gemini-cli
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/adaptationio/skrillz --skill gemini-cli

简介

gemini-cli 将 Google Gemini CLI 集成到 Claude Code,扩展 AI 协作能力。

  • 适用于需要利用 Gemini 模型进行代码分析、生成或 ReAct 架构推理的任务。
  • 支持 Web 搜索、MCP 服务器集成及多模态输入(文本加图像)。
  • 可通过 npm 全局安装或直接使用 npx 调用,需完成 Google OAuth 认证。
  • 使用前请确认 Node.js 版本不低于 18,并检查网络连通性与 API 配额。

SKILL.md

Gemini CLI Integration

Integrates Google's Gemini CLI into Claude Code, enabling seamless AI collaboration between Claude and Gemini for enhanced capabilities.

When to Use

  • Working with Google AI/Gemini models
  • Need multimodal capabilities (text + images)
  • Complex reasoning with ReAct architecture
  • Web search and fetching capabilities
  • MCP server integration
  • Code analysis and generation with Gemini
  • Comparing AI model outputs

Quick Start

1. Install Gemini CLI

# Check Node.js version (requires 18+, recommend 20+)
node --version

# Install globally via NPM
npm install -g @google/gemini-cli

# Or use without installation
npx @google/gemini-cli

2. Setup Authentication

Option A: Google OAuth (Recommended - Free)

# Start Gemini and follow OAuth flow
gemini
# Will open browser for Google authentication

Option B: API Key

# Get key from https://aistudio.google.com/
export GEMINI_API_KEY="your-api-key-here"

# Or create ~/.gemini/.env file
echo 'GEMINI_API_KEY="your-api-key-here"' > ~/.gemini/.env

3. Basic Usage

# Quick prompt (manual approval required)
gemini -p "Explain this code: $(cat main.py)"

# YOLO mode (auto-approve all actions - RECOMMENDED for automation)
gemini --yolo -p "Analyze and optimize this codebase"

# Interactive session
gemini -i "Let's analyze my project"

# Include specific directories with YOLO
gemini --include-directories ./src,./tests --yolo -p "Review and improve this codebase"

# Use specific model with auto-execution
gemini -m gemini-2.5-flash --yolo -p "Generate tests for all functions"

YOLO Mode - Use with Caution

--yolo automatically approves all actions. USE SPARINGLY - it's powerful but risky.

✅ Safe YOLO Operations

# Read-only analysis (safe)
gemini --yolo -p "Analyze code quality in @./src and generate report"

# Documentation generation (low risk)
gemini --yolo -p "Add JSDoc comments to all functions in ./src"

# Small, atomic operations (verifiable)
gemini --yolo -p "Fix ESLint errors in @./utils.js"

# Idempotent operations (safe to retry)
gemini --yolo -p "Format all JavaScript files with Prettier"

⚠️ Use YOLO with Safeguards

# Always create backups first
git stash push -m "pre-yolo-backup"
gemini --yolo -p "Refactor authentication module"

# Use checkpointing for rollback
gemini --checkpointing --yolo -p "Major code modernization"

# Combine with dry-run preview
gemini --dry-run -p "Database migration"  # Review first
gemini --yolo -p "Execute reviewed migration"  # Then automate

❌ NEVER Use YOLO For

  • Complex, multi-step workflows - Break into sequential steps instead
  • Production system modifications - Always manual review
  • Database operations - Require human verification
  • Security configurations - Too critical for automation
  • File deletions - Risk of data loss
  • Unknown/untested operations - Test manually first

Better Alternative: Iterative Workflows

Instead of large YOLO tasks, use Claude-orchestrated loops:

# ❌ RISKY: One giant YOLO task
gemini --yolo -p "Complete Express.js to Fastify migration"

# ✅ SAFE: Claude-guided sequential steps
gemini -p "Step 1: Analyze Express dependencies"  # Review
gemini --yolo -p "Step 2: Install Fastify packages"  # Safe
gemini -p "Step 3: Convert first route"  # Review
gemini --yolo -p "Step 4: Run tests"  # Safe
# Continue iteratively...

Claude + Gemini Collaboration Patterns

AI-to-AI Integration: Claude and Gemini work best together with structured, iterative workflows.

The Think-Act-Observe Loop

Claude orchestrates, Gemini executes - the most powerful pattern for AI collaboration:

# 1. Claude THINKS: Analyze the goal
# "I need to refactor the auth module. First, understand the structure."

# 2. Claude directs Gemini to ACT:
gemini -p "List all functions and their signatures in @./src/auth.js" > auth_analysis.txt

# 3. Claude OBSERVES the results
cat auth_analysis.txt
# Claude reviews and decides next step

# 4. Claude directs specific, atomic action:
gemini --yolo -p "Add try-catch error handling to the 'login' function in @./src/auth.js"

# 5. Claude verifies:
gemini --yolo -p "Run tests in tests/auth.test.js and report results"

# 6. Claude iterates based on test results

Structured Output for AI Parsing

Use --output-format json for machine-readable results:

# Get structured data Claude can parse
gemini --output-format json -p "List all Python files in ./src" > files.json

# Claude can now reliably process the JSON
cat files.json | jq '.files[]'

# Structured analysis
gemini --output-format json -p "Analyze security issues in @./src/auth.js" > security_report.json

# Claude parses specific fields
jq '.vulnerabilities[] | .severity' security_report.json

Safe Automation with Dry-Run

Preview operations before execution:

# Claude previews the plan first
gemini --dry-run -p "Refactor the authentication system"
# Output shows planned tool calls without executing

# After Claude reviews and approves:
gemini --yolo -p "Execute the reviewed refactoring plan"

Sequential Task Decomposition

Break complex tasks into atomic, verifiable steps:

#!/bin/bash
# Claude-orchestrated workflow

# BAD: Too complex, unpredictable
# gemini --yolo -p "Create a complete Express.js API with authentication"

# GOOD: Sequential, verifiable steps
echo "Step 1: Initialize project"
gemini --yolo -p "Initialize Node.js project and create server.js"

echo "Step 2: Install dependencies"
gemini --yolo -p "Install express, cors, and body-parser"

echo "Step 3: Basic server"
gemini --yolo -p "Create basic Express server in server.js with hello world route"

echo "Step 4: Add authentication (review this step)"
gemini -p "Add JWT authentication middleware to server.js"
# Claude reviews before proceeding

echo "Step 5: Verify"
gemini --yolo -p "Run tests and report results"

Tool Discovery and Schema

Claude learns available tools:

# Discover what tools Gemini has
gemini tools list

# Get detailed tool schema
gemini tools describe fileSystem
gemini tools describe shell
gemini tools describe google_web_search

# Claude can then construct precise tool calls

Error Handling Patterns

Robust automation with proper error handling:

#!/bin/bash
set -e  # Exit on error

# Claude-managed error recovery
if ! gemini --yolo -p "Run test suite"; then
  echo "Tests failed. Analyzing..."
  gemini -p "Analyze test failures and suggest fixes" > fixes.txt
  cat fixes.txt
  # Claude decides whether to apply fixes
fi

Context Management

Efficient context for large projects:

# Let Claude select relevant context
gemini --include-directories ./src/auth,./tests/auth \
       -p "Focus only on authentication module"

# Use @ syntax for precise file references
gemini -p "Compare @./src/auth-old.js with @./src/auth-new.js"

# Web context
gemini -p "Compare my implementation @./src/api.js with @https://example.com/best-practices"

Checkpoint and Restore

Safe experimentation with rollback:

# Claude creates checkpoint before risky operations
gemini --checkpointing --yolo -p "Major refactoring of core module"

# If something goes wrong:
gemini checkpoint list
gemini checkpoint restore <checkpoint-id>

Core Workflows

Code Analysis Workflow

# Analyze entire project (auto-execute)
gemini --include-directories . \
       --exclude-directories node_modules,.git \
       --yolo -p "Analyze this codebase and suggest improvements"

# Code review with auto-fixes
gemini --yolo -p "Review and fix security issues: @./src/auth.js"

# Generate tests automatically
gemini --yolo -p "Generate comprehensive tests for: @./src/utils.js"

# Manual review (when unsure)
gemini -p "Explain the architecture of this complex module: @./src/core.js"

Documentation Generation

# Generate README (auto-create files)
gemini --include-directories . --yolo -p "Generate a comprehensive README.md for this project"

# API documentation (auto-generate)
gemini --yolo -p "Generate complete API documentation for: @./src/api/"

# Code comments (bulk operation)
gemini --yolo -p "Add detailed JSDoc comments to all functions in: @./src/"

# Manual review for complex docs
gemini -p "Explain the documentation strategy for: @./complex_algorithm.py"

Multimodal Analysis

# Analyze images (read-only, safe for YOLO)
gemini --yolo -p "Describe this architecture diagram: @./docs/architecture.png"

# Compare designs (analysis only)
gemini --yolo -p "Compare these UI designs and suggest improvements: @./design1.png @./design2.png"

# Extract and format text
gemini --yolo -p "Extract and format the text from: @./screenshot.png"

Web Research

# Research with web search (auto-execute)
gemini --yolo -p "Research best practices for React performance optimization and create summary"

# Fetch and analyze (read-only)
gemini --yolo -p "Analyze this documentation: @https://docs.example.com/api"

# Compare implementations (analysis)
gemini --yolo -p "Compare my implementation with: @https://github.com/example/repo and suggest improvements"

Advanced Features

Interactive Commands

# In interactive mode:
/help              # Show all commands
/tools             # List available tools
/mcp               # Show MCP servers
/compress          # Summarize conversation
/copy              # Copy last response
/clear             # Clear context
/checkpoint        # Save project state
/restore           # Restore checkpoint
/ide install       # Setup VS Code
/ide enable        # Connect to VS Code

Tool Execution

# Auto-approve tool calls (careful!)
gemini --yolo -p "Create a Python script that processes all CSV files"

# Sandbox mode (safer)
gemini --sandbox -p "Set up a new React project"

# Manual approval (default)
gemini -p "Organize my project files"

MCP Server Integration

# List MCP servers
gemini mcp list

# Add MCP server
gemini mcp add

# Remove MCP server
gemini mcp remove <name>

# Use with MCP tools
gemini -p "Use the database MCP server to query user data"

Checkpointing

# Enable checkpointing
gemini --checkpointing -p "Refactor this entire module"

# List checkpoints
gemini checkpoint list

# Restore checkpoint
gemini checkpoint restore <id>

Configuration

Settings File (~/.gemini/settings.json)

{
  "model": "gemini-2.5-pro",
  "defaultFlags": {
    "checkpointing": true,
    "includeDirectories": ["./src", "./tests"],
    "excludeDirectories": ["node_modules", ".git", "dist"]
  },
  "tools": {
    "shell": {
      "enabled": false,
      "requireConfirmation": true
    },
    "fileSystem": {
      "enabled": true,
      "allowedPaths": ["./"]
    },
    "web": {
      "enabled": true,
      "allowedDomains": ["github.com", "docs.google.com"]
    }
  }
}

Environment Variables

# Authentication
export GEMINI_API_KEY="your-key"

# Vertex AI (Enterprise)
export GOOGLE_CLOUD_PROJECT="your-project"
export GOOGLE_CLOUD_LOCATION="us-central1"
export GOOGLE_APPLICATION_CREDENTIALS="/path/to/service-account.json"

# Model selection
export GEMINI_MODEL="gemini-2.5-pro"

# Default directories
export GEMINI_INCLUDE_DIRS="./src,./lib"
export GEMINI_EXCLUDE_DIRS="node_modules,.git"

Integration Patterns

Claude + Gemini Collaboration

# Use Claude for planning, Gemini for execution
echo "Claude, create a plan for refactoring auth module"
# ... get plan from Claude ...

gemini -p "Execute this refactoring plan: [paste plan]"

Parallel Analysis

# Get different perspectives
echo "Analyze security of auth.js" | tee \
  >(claude-cli) \
  >(gemini -p -)

Model Comparison

# Compare outputs
PROMPT="Generate unit tests for utils.js"
echo "Claude:" && claude-cli "$PROMPT"
echo "Gemini:" && gemini -p "$PROMPT"

Best Practices

Security

  1. API Key Management

- Never commit API keys - Use environment variables - Rotate keys regularly

  1. Tool Execution

- Avoid --yolo for untrusted prompts - Use --sandbox for experiments - Review tool calls before approval

  1. MCP Server Trust

- Only trust known servers - Use include/exclude tool lists - Set appropriate timeouts

Performance

  1. Model Selection

- Use gemini-2.5-flash for quick tasks - Use gemini-2.5-pro for complex reasoning - Consider token limits (1M context window)

  1. Directory Management

- Exclude unnecessary directories - Use specific includes for large projects - Leverage checkpointing for long tasks

  1. Rate Limiting

- OAuth: 60 req/min, 1000 req/day - API Key: Varies by tier - Implement retry logic

Workflow Optimization

  1. Batch Operations # Process multiple files efficiently gemini -p "Analyze and improve: @./src/*.js"
  2. Context Preservation # Use interactive mode for related tasks gemini -i "Let's refactor the auth system"
  3. Output Formatting # Get JSON output for parsing gemini --json -p "List all functions in: @./utils.js"

Troubleshooting

Common Issues

  1. Authentication Failed # Clear cached credentials rm -rf ~/.gemini/auth # Re-authenticate gemini
  2. Rate Limiting # Check usage gemini usage # Switch to different auth method if needed
  3. Tool Execution Errors # Check tool availability gemini -i /tools # Verify permissions
  4. MCP Server Issues # Check server status gemini mcp status # Restart server gemini mcp restart <name>

Examples

Complete Project Analysis (Automated)

#!/bin/bash
# Comprehensive project analysis with auto-execution

gemini --include-directories . \
       --exclude-directories node_modules,.git,dist \
       --checkpointing --yolo \
       -p "Perform comprehensive analysis and create reports:
1. Code quality assessment with fixes
2. Security vulnerability scan and patches
3. Performance optimization suggestions
4. Generate missing tests
5. Create complete documentation
6. Update dependencies safely
7. Implement CI/CD pipeline"

Automated Documentation Suite

#!/bin/bash
# Generate complete documentation suite (fully automated)

gemini --yolo -p "Generate complete documentation ecosystem:
1. README.md with badges and quick start
2. API.md with OpenAPI specification
3. CONTRIBUTING.md with dev workflow
4. CHANGELOG.md with version history
5. JSDoc comments for all functions
6. Architecture diagrams in Mermaid
7. Test documentation and coverage reports
8. Deployment and operations guide"

Framework Migration (Auto-Pilot)

#!/bin/bash
# Automated framework migration

gemini --checkpointing --yolo \
       -p "Fully automated Express.js to Fastify migration:
1. Analyze current Express structure
2. Create detailed migration plan
3. Update package.json dependencies
4. Convert all routes and middleware
5. Update error handling patterns
6. Migrate and update all tests
7. Create docker configuration
8. Verify functionality with test suite
9. Generate migration report"

Daily Development Automation

#!/bin/bash
# Daily automated development tasks

gemini --yolo -p "Execute daily development workflow:
1. Pull latest changes safely
2. Update dependencies to latest stable
3. Run full test suite and fix failures
4. Update documentation for any changes
5. Optimize code performance
6. Run security audit and fix issues
7. Generate daily progress report
8. Commit and push changes with proper messages"

Related Skills

  • gemini-auth: Authentication management
  • gemini-chat: Interactive chat sessions
  • gemini-tools: Tool execution workflows
  • gemini-mcp: MCP server management
  • gemini-code: Code-specific operations

Updates

This skill tracks Gemini CLI updates. Check for new features:

# Update Gemini CLI
npm update -g @google/gemini-cli

# Check version
gemini --version

# View changelog
gemini changelog

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

github-copilot

27.52%
按下载量换算43

Claude Code

21.79%
按下载量换算34

mcpjam

18.12%
按下载量换算29

moltbot

11.71%
按下载量换算19

windsurf

8.63%
按下载量换算14

zencoder

3.34%
按下载量换算5

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。

来源信息

继续浏览同类 Skills