Gemini Sub-Agent for Openclaw

A cost-effective sub-agent that uses your Google Gemini subscription for high-context coding and text analysis within Openclaw Skills.

tedo0626
v1.0.0
Mar 1, 2026
0
1.2k
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install gemini-sub-agent

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install gemini-sub-agent using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Gemini Sub-Agent?

The gemini-sub-agent allows developers to leverage their existing Google Gemini subscription to power sub-agent tasks without incurring additional API costs. It is specifically designed to handle medium-complexity tasks, long-context analysis, and autonomous coding workflows, making it a powerful addition to the library of Openclaw Skills.

By utilizing the Gemini CLI and gcloud authentication, this skill provides a bridge for running agentic tasks that would otherwise consume expensive API credits. It excels at processing large documents up to 1 million tokens and can autonomously read and write files during development, serving as a reliable alternative to paid cloud models for specific use cases.

Gemini Sub-Agent Use Cases

  • Delegating medium-complexity coding tasks (30-200 lines) to save on Sonnet or Haiku credits.
  • Processing and summarizing massive documents or logs using the 1M token context window.
  • Running autonomous agentic coding sessions for refactoring or script generation with direct file access.
  • Performing bulk text analysis, Q&A, and action item extraction from large reports or piped content.

How Gemini Sub-Agent Works

  1. The user authenticates their Google Gemini subscription via the gcloud CLI and Gemini CLI OAuth to enable access without API keys.
  2. The user invokes the ask-gemini wrapper for simple text tasks or the Gemini CLI for agentic workflows.
  3. For long-context tasks, content is piped directly into the skill, utilizing the massive context window of the Gemini models.
  4. In agentic mode, the skill reads the local directory, executes shell commands, and writes files autonomously to complete coding assignments.
  5. The system follows pre-defined routing rules to decide when to use Gemini versus other models, with clear escalation paths if a task fails.

Gemini Sub-Agent Setup

To integrate this into your environment, run the initial setup script:

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

Next, authenticate using the gcloud application-default login. For headless VPS setups, use:

gcloud auth application-default login --no-browser

Follow the remote-bootstrap flow to sync with your local machine. Finally, complete the Gemini CLI OAuth verification with:

GOOGLE_GENAI_USE_GCA=true gemini -p \"hello\"

Gemini Sub-Agent Data Schema & Taxonomy

The skill manages its operations through cached credentials and specific logging files within Openclaw Skills.

Data Component Format / Path Description
Authentication gcloud / Gemini CLI Cache Credentials are cached indefinitely and auto-refresh.
Failure Tracking failures/hot_antipatterns.md Logs tasks where Gemini fails to provide correct output.
Wrapper Scripts /usr/local/bin/ask-gemini Provides a streamlined CLI interface for quick prompts.
Model Selection CLI Arguments (-m) Allows switching between flagship Pro and lightweight Flash models.

Gemini Sub-Agent Advanced Features

  • Yolo Mode (-y): Enables fully autonomous behavior by auto-approving file writes and shell commands during agentic coding.
  • 1M Token Context: Support for extremely large file analysis that exceeds the limits of standard API-based models.
  • High-Reasoning Fallback: Specific integration with the gemini-3.1-pro-preview model for complex reasoning tasks.
  • Headless VPS Optimization: Includes a specialized authentication flow for developers working on remote servers.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*