Token导航 LogoToken导航

Agent Skill · 研究检索

gemini-cli(Gemini CLI)

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

gemini-cli 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为接触敏感数据;许可证为 MIT,第三方扫描有提醒项,按安装量在研究检索类的 73,675 个 Skill 里排第 56,419。

总安装 451周安装 19GitHub Stars 9下载 158核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT

安装方式

通过对话安装

复制提示词发给支持本地命令或 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

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

gemini-cli 将 Google Gemini CLI 集成到 Claude Code,扩展 AI 协作能力。适用于需要利用 Gemini 模型进行代码分析、生成或 ReAct 架构推理的任务。支持 Web 搜索、MCP 服务器集成及多模态输入(文本加图像)。

可通过 npm 全局安装或直接使用 npx 调用,需完成 Google OAuth 认证。使用前请确认 Node.js 版本不低于 18,并检查网络连通性与 API 配额。

来源仓库内路径:skills/gemini-cli

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/adaptationio/skrillz --skill gemini-cli;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要接触敏感数据,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

gemini-cli 怎么安装?

在终端执行 npx skills add https://github.com/adaptationio/skrillz --skill gemini-cli。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

gemini-cli 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

gemini-cli 需要什么权限?

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

gemini-cli 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

gemini-cli 用的人多吗?

公开数据是累计安装 451 次,近一周安装 19 次,下载 158 次,GitHub 9 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

gemini-cli 安全吗?

第三方扫描有提醒项,说明存在需要人工确认的行为。安装前请打开源码看清它读了什么、联网到哪里。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 3 个目录同时收录,说明这个 Skill 流传比较广。
  • 许可证明确为 MIT,商用和分发边界好判断。

先想清楚的地方

  • 需要接触敏感数据,装到常用环境前要先评估影响面。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 环境里有大量密钥、凭证,不方便给第三方 Skill 读取的人。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
gemini-cli

Gemini CLI · 本页

4519接触敏感数据MIT有提醒

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

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

平台分布

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、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。

继续浏览同类 Skills