← 返回 Skills 市场
tedo0626

Gemini Sub-Agent

作者 tedo0626 · GitHub ↗ · v1.0.0
cross-platform ⚠ suspicious
462
总下载
0
收藏
1
当前安装
1
版本数
在 OpenClaw 中安装
/install gemini-sub-agent
功能描述
Use Google Gemini as a free sub-agent via a Google One / Gemini Advanced subscription (no API key or API credits needed). Use when: (1) delegating tasks that...
使用说明 (SKILL.md)

gemini-sub-agent

Use Google Gemini (via subscription, $0 API cost) as a sub-agent inside OpenClaw workflows.

Setup

Run once on a fresh machine:

bash skills/gemini-sub-agent/scripts/setup.sh

Then authenticate (headless VPS flow):

  1. On VPS: gcloud auth application-default login --no-browser → copy the --remote-bootstrap URL
  2. On laptop: gcloud auth application-default login --remote-bootstrap="\x3CURL>" → copy the localhost:8085 output
  3. Paste localhost:8085 output back into VPS prompt
  4. Complete Gemini CLI OAuth: GOOGLE_GENAI_USE_GCA=true gemini -p "hello" → paste auth code

Credentials are cached indefinitely and auto-refresh.

Available Models

Model Use for
gemini-3.1-pro-preview Default — latest flagship, best reasoning
gemini-2.5-pro Stable coding tasks, multi-file edits
gemini-3-flash-preview Fast summaries, quick Q&A
gemini-3-pro-preview Previous gen Pro, reliable fallback
gemini-2.5-flash Lightweight fallback

Usage Patterns

1. Simple text task (exec)

ask-gemini "your prompt here"
ask-gemini -m gemini-2.5-pro "your prompt"

2. Pipe large content (long-context)

cat large_file.txt | ask-gemini "summarize this in 5 bullets"
cat report.md | ask-gemini "extract all action items"

3. Agentic coding (replaces Swift/Sonnet for 30-200 line tasks)

cd /path/to/project
GOOGLE_GENAI_USE_GCA=true gemini -m gemini-2.5-pro -y -p "write a script that..."

-y = yolo mode (auto-approves all file writes and shell commands). Gemini reads/writes files autonomously.

4. Pipe files directly into agentic session

cat existing_script.py | GOOGLE_GENAI_USE_GCA=true gemini -m gemini-2.5-pro -y -p "refactor this to add error handling"

Routing Rules (when to use Gemini vs others)

Task Use
Text, analysis, summarization ask-gemini
Medium coding (30–200 lines) Gemini agentic (-y) instead of Swift/Sonnet
Large file / long-context ask-gemini (1M token window)
Web search / research Research agent (Grok) — Gemini has no web access
Multi-agent orchestration OpenClaw native (sessions_spawn)
Complex architecture / debugging Codex (Opus) — escalate if Gemini fails twice

Escalation

If Gemini returns wrong output twice on the same task → escalate to Swift (Sonnet) or Codex (Opus). Log the failure in failures/hot_antipatterns.md with the task type.

Scripts

  • scripts/setup.sh — Full install: gemini-cli + gcloud + ask-gemini wrapper
  • scripts/ask-gemini — The wrapper script itself (copy to /usr/local/bin/)
安全使用建议
Before installing: (1) Expect to need Node.js 18+ and root privileges — the manifest does not declare these but setup.sh requires them. (2) The script adds Google's apt repo and globally installs the gemini CLI via npm and writes /usr/local/bin/ask-gemini — run it only on a throwaway VM or container, not on a production server. (3) The authentication flow creates long-lived ADC tokens at $HOME/.config/gcloud/application_default_credentials.json; consider using a dedicated Google account with minimal scopes, and inspect the scopes granted during the OAuth flow. (4) Be cautious with agentic usage: gemini -y auto-approves file writes and commands — this can modify arbitrary files. If you need the capability, prefer sandboxing (container/VM), review the wrapper script, and do not run it where secrets or sensitive data reside. (5) If uncertain, ask the skill author for: an updated manifest declaring required binaries/privileges, the exact OAuth scopes used, and guidance for least-privilege installation (containerized option).
功能分析
Type: OpenClaw Skill Name: gemini-sub-agent Version: 1.0.0 The skill bundle is classified as suspicious due to instructions in `SKILL.md` that direct the OpenClaw agent to use the Google Gemini sub-agent in 'yolo mode' (`-y`). This mode explicitly 'auto-approves all file writes and shell commands,' granting the Gemini sub-agent autonomous and unconstrained execution capabilities on the host system. While the skill bundle itself does not contain malicious code, this design choice introduces a critical remote code execution (RCE) vulnerability. If the Gemini sub-agent is subsequently given a malicious prompt, it could lead to arbitrary command execution or file manipulation, making the system highly susceptible to prompt injection attacks against the sub-agent. The `scripts/setup.sh` file performs standard installations and creates a benign wrapper script, but the core issue lies in the delegated, unconstrained execution instruction.
能力评估
Purpose & Capability
The skill's description matches its behavior (wrapping Gemini CLI as a sub-agent). However the declared metadata lists no required binaries or env vars while the included setup.sh requires Node.js 18+, the gemini CLI (npm @google/gemini-cli) and gcloud — a clear mismatch between claimed requirements and actual needs.
Instruction Scope
SKILL.md explicitly instructs installing system-level packages and performing OAuth flows that create long-lived ADC credentials. It also recommends agentic coding with gemini -y (auto-approves file writes and shell commands), which grants the CLI permission to read/write arbitrary files — this is coherent with 'agentic coding' but expands the skill's authority to the host filesystem and can be unsafe if run on sensitive systems.
Install Mechanism
Installation is via the provided scripts: global npm install of @google/gemini-cli and adding Google's APT repo + apt-get install google-cloud-cli. Sources used (npm package and packages.cloud.google.com) are official, not arbitrary URLs, but the script writes to system paths (/usr/local/bin, /etc/apt/...) and will require elevated privileges to succeed. The manifest had no separate install spec despite shipping a setup script.
Credentials
No unrelated credentials are requested in metadata. The skill relies on Google Application Default Credentials (ADC) created by gcloud auth flows; credentials are stored in $HOME/.config/gcloud/application_default_credentials.json and are described as 'cached indefinitely'. This is expected for using a Google-subscribed CLI but is high-impact: those tokens may grant broad access to the authenticated Google account/project if scopes are not limited.
Persistence & Privilege
always is false and the skill is user-invocable (normal). The setup script installs a wrapper to /usr/local/bin and configures system apt sources; it therefore requests system-level persistence and requires root to install globally. It does not modify other skills' configs. The combination of global install + long-lived credentials increases blast radius if run on shared/production hosts.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install gemini-sub-agent
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /gemini-sub-agent 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
First release — use Gemini 3.1 Pro via Google subscription as a free OpenClaw sub-agent. Zero API cost, 1M context, agentic coding support.
元数据
Slug gemini-sub-agent
版本 1.0.0
许可证
累计安装 1
当前安装数 1
历史版本数 1
常见问题

Gemini Sub-Agent 是什么?

Use Google Gemini as a free sub-agent via a Google One / Gemini Advanced subscription (no API key or API credits needed). Use when: (1) delegating tasks that... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 462 次。

如何安装 Gemini Sub-Agent?

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

Gemini Sub-Agent 是免费的吗?

是的,Gemini Sub-Agent 完全免费(开源免费),可自由下载、安装和使用。

Gemini Sub-Agent 支持哪些平台?

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

谁开发了 Gemini Sub-Agent?

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

💬 留言讨论