首页龙虾技能列表 › Gemini CLI — Gemini工具

Gemini CLI — Gemini工具

v1.0.0

[AI辅助] Gemini CLI tool for building, debugging & deploying with AI. Use when querying codebases, generating apps from images/PDFs, automating workflows, or performi...

0· 379·0 当前·0 累计
下载技能包
License
MIT-0
最后更新
2026/4/12
安全扫描
VirusTotal
无害
查看报告
OpenClaw
可疑
medium confidence
The skill's behavior (installing an npm gemini CLI and requiring a GEMINI_API_KEY) matches its description, but metadata inconsistencies and an unknown/undocumented package origin raise concerns you should verify before installing.
评估建议
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 G...
详细分析 ▾
用途与能力
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.
指令范围
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.
安装机制
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.
凭证需求
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.
持久化与权限
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).
安全有层次,运行前请审查代码。

License

MIT-0

可自由使用、修改和再分发,无需署名。

运行时依赖

无特殊依赖

版本

latestv1.0.02026/3/15

Initial release: Comprehensive guide to Google's Gemini CLI for AI-powered code generation, analysis, and automation from the terminal

● 无害

安装命令 点击复制

官方npx clawhub@latest install gemini-cli
镜像加速npx clawhub@latest install gemini-cli --registry https://cn.clawhub-mirror.com

技能文档

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

什么 做

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

  • 查询 Codebases — Analyze 和 understand large codebases
  • Generate 从 Images — 创建 code, docs, 或 apps 从 screenshot/images
  • Generate 从 PDFs — Extract 和 build 从 PDF documents
  • Automate Workflows — Chain AI tasks 对于 complex automation
  • Interactive Shell — Chat 带有 Gemini 关于 project
  • Debugging — 获取 AI-powered debugging 和 code review

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

⚠️ Trust 模型 & Security Declaration

Metadata Declaration:

  • 类型: AI CLI tool (Google-managed, official)
  • External Binary: gemini (official Google 包)
  • Manages Credentials: 否 (credentials stored locally 作为 env var)
  • Credential Storage: Environment 变量 (GEMINI_API_KEY)
  • Capabilities: Code analysis, generation, automation
  • Limitations: Requires internet, API quota limits apply

Authentication 模型:

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

GEMINI_API_KEY= gemini 

键 Points:

  • ✅ Official Google tool (不 第三个-party)
  • ✅ Credentials stored 作为 environment 变量 (不 在...中 tool)
  • ✅ 您 control scope: 设置 env var 仅 当...时 needed
  • ✅ 否 persistent credential storage 在...中 ~/.gemini/ directory
  • ✅ Direct calls 到 Gemini API endpoints (googleapis.com)

什么 Skill 做:

  • ✅ Queries codebase 和 documents 带有 Gemini models
  • ✅ Generates code/apps 从 images 和 PDFs
  • ✅ Runs automated workflows 使用 AI
  • ✅ Provides interactive debugging 和 code review
  • ❌ 做 不 store credentials
  • ❌ 做 不 缓存 sensitive data
  • ❌ 做 不 修改 system beyond running commands

Requirements

Binaries (必填):

  • gemini — Gemini CLI tool (installed 通过 npm)
  • 节点 — 节点.js 20.0.0+ (usually pre-installed)

Credentials (environment 变量):

  • GEMINI_API_KEY — Gemini API 键 从 Google AI Studio 或 Google Cloud

System Requirements:

  • macOS 15+, Windows 11 24H2+, 或 Ubuntu 20.04+
  • 4GB+ RAM (casual usage), 16GB+ (power usage 带有 large codebases)
  • Internet 连接 必填

可选:

  • bash, zsh, 或 PowerShell — 任何 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. 设置 API 键 (One-时间 per 会话)

export GEMINI_API_KEY=""

Or use it inline:

GEMINI_API_KEY="" gemini 

To find your API key:

  • Go 到 https://aistudio.google.com/app/apikey
  • 创建 或 复制 API 键
  • Store securely (don't commit 到 git)

3. 验证 Installation

gemini --version
gemini --help

Quick 开始

Interactive Shell (Ask Gemini Questions)

gemini chat

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

查询 Codebase

gemini code --prompt "What does this function do?" 

Generate 从 Image

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

Generate 从 PDF

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

Automate Workflow

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

获取 Help

gemini --help
gemini  --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 键: 设置 通过 GEMINI_API_KEY environment 变量
  • Temp Storage: Uses system temp directory (auto-cleaned)
  • 否 persistent 配置: Unlike mirocli, Gemini CLI doesn't store auth locally

到 persist API 键 穿过 sessions (可选):

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

export GEMINI_API_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        # Pass API key directly (overrides env var)
--model        # Specify Gemini model (default: gemini-2.5-pro)

Help & Documentation

gemini --help                  # Global help
gemini  --help        # Command-specific help

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

Tips & Tricks

  • 使用 带有 codebase:
   cd /path/to/your/project
   gemini chat --context ./src
   
  • Chain commands:
   gemini code --review ./changes.patch | tee review.txt
   
  • Batch process files:
   for file in src/*.js; do
     gemini code --explain "$file" > "docs/${file}.md"
   done
   
  • Store prompts 在...中 files:
   cat prompt.txt | gemini chat
   

当...时 到 使用 Gemini CLI vs 其他 Tools

TaskGemini CLICursor/IDEWeb 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 & 下一个 Steps

✅ Installation: Pre-installed (v0.28.2)

✅ Configuration: 就绪 到 使用 带有 GEMINI_API_KEY environment 变量

✅ Authentication: 设置 env var 之前 使用 (否 interactive steps needed)

Testing: Run gemini --help 到 验证 installation

Usage: 设置 API 键 和 开始 使用:

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

Setup 日期: 2026-03-14 Status: 就绪 (否 authentication 必填 — env var based)

数据来源:ClawHub ↗ · 中文优化:龙虾技能库
OpenClaw 技能定制 / 插件定制 / 私有工作流定制

免费技能或插件可能存在安全风险,如需更匹配、更安全的方案,建议联系付费定制

了解定制服务