← 返回 Skills 市场
bigbubbaagent-bot

Gemini CLI

作者 bigbubbaagent-bot · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
506
总下载
0
收藏
1
当前安装
1
版本数
在 OpenClaw 中安装
/install gemini-cli
功能描述
Gemini CLI tool for building, debugging & deploying with AI. Use when querying codebases, generating apps from images/PDFs, automating workflows, or performi...
使用说明 (SKILL.md)

Gemini CLI Skill

A comprehensive guide for using the Gemini CLI tool to build, debug & deploy with AI directly from the command line.

What It Does

Gemini CLI enables command-line access to Google's Gemini models for:

  • Query Codebases — Analyze and understand large codebases
  • Generate from Images — Create code, docs, or apps from screenshot/images
  • Generate from PDFs — Extract and build from PDF documents
  • Automate Workflows — Chain AI tasks for complex automation
  • Interactive Shell — Chat with Gemini about your project
  • Debugging — Get AI-powered debugging and code review

Perfect for developers who want to leverage AI without leaving the terminal.

⚠️ Trust Model & Security Declaration

Metadata Declaration:

  • Type: AI CLI tool (Google-managed, official)
  • External Binary: gemini (official Google package)
  • Manages Credentials: No (credentials stored locally as env var)
  • Credential Storage: Environment variable (GEMINI_API_KEY)
  • Capabilities: Code analysis, generation, automation
  • Limitations: Requires internet, API quota limits apply

Authentication Model:

This tool uses your Gemini API Key passed as an environment variable:

GEMINI_API_KEY=\x3Cyour-key> gemini \x3Ccommand>

Key Points:

  • ✅ Official Google tool (not third-party)
  • ✅ Credentials stored as environment variable (not in tool)
  • ✅ You control scope: set env var only when needed
  • ✅ No persistent credential storage in ~/.gemini/ directory
  • ✅ Direct calls to Gemini API endpoints (googleapis.com)

What This Skill Does:

  • ✅ Queries your codebase and documents with Gemini models
  • ✅ Generates code/apps from images and PDFs
  • ✅ Runs automated workflows using AI
  • ✅ Provides interactive debugging and code review
  • ❌ Does NOT store credentials
  • ❌ Does NOT cache sensitive data
  • ❌ Does NOT modify your system beyond running commands

Requirements

Binaries (required):

  • gemini — Gemini CLI tool (installed via npm)
  • node — Node.js 20.0.0+ (usually pre-installed)

Credentials (environment variable):

  • GEMINI_API_KEY — Your Gemini API key from Google AI Studio or Google Cloud

System Requirements:

  • macOS 15+, Windows 11 24H2+, or Ubuntu 20.04+
  • 4GB+ RAM (casual usage), 16GB+ (power usage with large codebases)
  • Internet connection required

Optional:

  • bash, zsh, or PowerShell — Any modern shell

Installation & Setup

1. Check Installation

Gemini CLI is usually pre-installed:

gemini --version

If not installed:

npm install -g @google/gemini-cli
# OR
brew install gemini-cli

2. Set API Key (One-time per session)

export GEMINI_API_KEY="\x3Cyour-api-key>"

Or use it inline:

GEMINI_API_KEY="\x3Cyour-api-key>" gemini \x3Ccommand>

To find your API key:

3. Verify Installation

gemini --version
gemini --help

Quick Start

Interactive Shell (Ask Gemini Questions)

gemini chat

Then type your questions about code, architecture, debugging, etc.

Query a Codebase

gemini code --prompt "What does this function do?" \x3Cfile-or-directory>

Generate from Image

gemini create --from-image ./screenshot.png --prompt "Create a React component from this design"

Generate from PDF

gemini create --from-pdf ./document.pdf --prompt "Create an API spec based on this document"

Automate a Workflow

gemini workflow --steps "1) analyze code, 2) identify issues, 3) suggest fixes"

Get Help

gemini --help
gemini \x3Ccommand> --help

Common Commands

Interactive

gemini chat                    # Start interactive chat
gemini chat --context ./src    # Chat with codebase context

Code Analysis

gemini code --prompt "analyze" ./file.js
gemini code --explain ./function.ts
gemini code --review ./pull_request.patch

Code Generation

gemini create --from-image ./design.png
gemini create --from-pdf ./spec.pdf
gemini create --template react --prompt "counter app"

Batch Operations

gemini batch --input ./tasks.json --output ./results.json

Configuration

  • API Key: Set via GEMINI_API_KEY environment variable
  • Temp Storage: Uses system temp directory (auto-cleaned)
  • No persistent config: Unlike mirocli, Gemini CLI doesn't store auth locally

To persist API key across sessions (optional):

Add to your ~/.bashrc, ~/.zshrc, or equivalent:

export GEMINI_API_KEY="\x3Cyour-key>"

⚠️ Security warning: Only do this if your shell profile is secure and not synced to public repos.

Global Options

--version              # Show version
--help                # Show help
--verbose             # Verbose output
--api-key \x3Ckey>       # Pass API key directly (overrides env var)
--model \x3Cmodel>       # Specify Gemini model (default: gemini-2.5-pro)

Help & Documentation

gemini --help                  # Global help
gemini \x3Ccommand> --help        # Command-specific help

Official Docs: https://geminicli.com/docs

Tips & Tricks

  1. Use with your codebase:

    cd /path/to/your/project
    gemini chat --context ./src
    
  2. Chain commands:

    gemini code --review ./changes.patch | tee review.txt
    
  3. Batch process files:

    for file in src/*.js; do
      gemini code --explain "$file" > "docs/${file}.md"
    done
    
  4. Store prompts in files:

    cat prompt.txt | gemini chat
    

When to Use Gemini CLI vs Other Tools

Task Gemini CLI Cursor/IDE Web UI
Quick code questions ✅ Fast ✅ Integrated ❌ Context switch
Large codebase analysis ✅ Better ✅ Native ❌ Limited
Generate from images ✅ Works ✅ Works ✅ Works
Batch automation ✅ Perfect ❌ Manual ❌ Manual
Interactive chat ✅ Terminal ✅ IDE ✅ Browser
Scripting workflows ✅ Yes ❌ No ❌ No

Status & Next Steps

✅ Installation: Pre-installed (v0.28.2)

✅ Configuration: Ready to use with GEMINI_API_KEY environment variable

✅ Authentication: Set env var before use (no interactive steps needed)

Testing: Run gemini --help to verify installation

Usage: Set API key and start using:

export GEMINI_API_KEY="your-key-here"
gemini chat

Setup Date: 2026-03-14
Status: Ready (no authentication required — env var based)

安全使用建议
Before installing or running this skill: 1) Verify the npm package owner and authenticity: check https://www.npmjs.com/package/@google/gemini-cli (publisher should be an official Google account) and confirm package versions and README. 2) Confirm a trustworthy homepage/documentation — the registry entry lists none; lack of an official homepage is suspicious. 3) Prefer to inspect the package (npm view, npm pack + unpack) or run via npx rather than global install until you trust it. 4) Keep your GEMINI_API_KEY scoped and ephemeral where possible; do not place it in global shell rc unless you accept the risk; consider using inline env or a short-lived key. 5) Ask the skill publisher to correct registry metadata (declare GEMINI_API_KEY as required, provide homepage and publisher identity). 6) If you have doubts about authenticity, do not install globally and avoid exposing high-privilege API keys; consider creating a dedicated, limited-scope API key and rotating it after testing.
功能分析
Type: OpenClaw Skill Name: gemini-cli Version: 1.0.0 The gemini-cli skill bundle provides a standard integration for Google's Gemini AI models via a command-line interface. The included bash scripts (batch-analyze.sh and generate-from-design.sh) are well-structured helper tools for automating code reviews and generation, featuring basic filename sanitization. The documentation and SKILL.md instructions are consistent with the stated purpose, and no evidence of data exfiltration, malicious execution, or prompt injection was found.
能力评估
Purpose & Capability
The SKILL.md, helper scripts, and references consistently describe a CLI wrapper around Google's Gemini models and require the gemini CLI, Node.js, and a GEMINI_API_KEY — which is coherent with the stated purpose. However, the registry metadata in the skill listing declares no required env vars/primary credential and the skill's published source/homepage are missing, which is inconsistent with the SKILL.md claiming a Google-managed official tool.
Instruction Scope
Runtime instructions and scripts only invoke the gemini CLI against local files and expect a GEMINI_API_KEY environment variable. The scripts check for GEMINI_API_KEY, find files, and call gemini commands; they do not reference unrelated system paths or external endpoints beyond the expected Gemini API. No instructions request arbitrary file exfiltration or secret harvesting beyond the API key.
Install Mechanism
Installation uses npm (@google/gemini-cli) and depends on Node.js (system). npm is an expected distribution mechanism for a JS CLI, but the package name and lack of an authoritative homepage/registry owner in the metadata mean you should verify the package authenticity (typosquatting or a non-official package is possible). No high-risk direct-download URLs or archive extraction are present.
Credentials
The skill requires a single API key (GEMINI_API_KEY) which is proportionate to the claimed functionality. However, the registry metadata incorrectly lists no required credentials while SKILL.md and the included scripts clearly require GEMINI_API_KEY; also the SKILL.md uses both 'gemini_api_key' and 'GEMINI_API_KEY' naming in different places. The mismatch between claims of 'Google-managed / official' and the lack of a homepage or known publisher in the registry is a credibility concern.
Persistence & Privilege
The skill does not request always:true, does not modify other skills or system-wide settings, and does not claim to persist credentials on disk. It only suggests optional shell rc edits to persist the API key (user action).
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install gemini-cli
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /gemini-cli 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release: Comprehensive guide to Google's Gemini CLI for AI-powered code generation, analysis, and automation from the terminal
元数据
Slug gemini-cli
版本 1.0.0
许可证 MIT-0
累计安装 1
当前安装数 1
历史版本数 1
常见问题

Gemini CLI 是什么?

Gemini CLI tool for building, debugging & deploying with AI. Use when querying codebases, generating apps from images/PDFs, automating workflows, or performi... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 506 次。

如何安装 Gemini CLI?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install gemini-cli」即可一键安装,无需额外配置。

Gemini CLI 是免费的吗?

是的,Gemini CLI 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Gemini CLI 支持哪些平台?

Gemini CLI 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Gemini CLI?

由 bigbubbaagent-bot(@bigbubbaagent-bot)开发并维护,当前版本 v1.0.0。

💬 留言讨论