← 返回
开发者工具 中文

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...
通过 Google One / Gemini Advanced 订阅免费使用 Google Gemini 作为子代理(无需 API 密钥或额度)。适用场景:(1)委派……任务
tedo0626 tedo0626 来源
开发者工具 clawhub v1.0.0 1 版本 99876.8 Key: 无需
★ 0
Stars
📥 811
下载
💾 32
安装
1
版本
#latest

概述

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="" → 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

ModelUse for
------
gemini-3.1-pro-previewDefault — latest flagship, best reasoning
gemini-2.5-proStable coding tasks, multi-file edits
gemini-3-flash-previewFast summaries, quick Q&A
gemini-3-pro-previewPrevious gen Pro, reliable fallback
gemini-2.5-flashLightweight 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)

TaskUse
------
Text, analysis, summarizationask-gemini
Medium coding (30–200 lines)Gemini agentic (-y) instead of Swift/Sonnet
Large file / long-contextask-gemini (1M token window)
Web search / researchResearch agent (Grok) — Gemini has no web access
Multi-agent orchestrationOpenClaw native (sessions_spawn)
Complex architecture / debuggingCodex (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/)

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-30 01:52 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-agent

self-improving agent

pskoett
捕获经验教训、错误及修正内容,以实现持续改进。适用于以下场景:(1)命令或操作意外失败;(2)用户纠正Claude(如“不,那不对……”“实际上……”);(3)用户请求的功能不存在;(4)外部API或工具出现故障;(5)Claude发现自身
★ 4,082 📥 812,009
ai-agent

ontology

oswalpalash
类型化知识图谱,用于结构化智能体记忆与可组合技能。适用于以下场景:创建/查询实体(人物、项目、任务、事件、文档)、关联相关对象、强制执行约束、将多步操作规划为图谱变换,或当技能需要共享状态时。触发关键词包括"记住""我知道关于什么""将X链
★ 721 📥 244,955
ai-agent

Self-Improving + Proactive Agent

ivangdavila
自我反思+自我批评+自我学习+自组织记忆。智能体评估自身工作、发现错误并持续改进。
★ 1,380 📥 320,640