This repository provides sample scripts and configurations to integrate Google Apps Script (GAS) as remote subagents within the Gemini CLI using the Agent-to-Agent (A2A) protocol.
By connecting Gemini CLI to GAS-based A2A servers, you can:
- Automate Google Workspace: Leverage 160+ skills across Gmail, Drive, Sheets, Docs, and more.
- Overcome Tool Space Interference (TSI): Delegate massive toolsets to remote subagents to preserve the main agent's reasoning stability.
- Low-Code Deployment: Deploy powerful AI agents as lightweight Web Apps without managing complex server infrastructure.
For a detailed walkthrough, please refer to the technical article: Integrating Remote Subagents Built by Google Apps Script with Gemini CLI
You can directly copy the Google Apps Script projects to your Google Drive using the following links:
A basic implementation featuring currency exchange and weather tools. Use this to test the initial connection.
A high-performance agent with 160+ skills for comprehensive Google Workspace orchestration.
- Open the copied script project.
- Click Deploy > New deployment.
- Select Web App.
- Set Execute as to "Me" and Who has access to "Anyone".
- Copy the Web App URL.
- In
code.gsoragent.gs, update theurl(orwebAppsUrl) with your deployment URL and redeploy.
Since GAS Web Apps require specific authorization for dynamic metadata retrieval, Gemini CLI integrates them by defining the Agent Card locally.
- Create a directory:
.gemini/agents/in your working directory. - Run the
getAgentCard()function in the Google Apps Script console to get the JSON. - Create a Markdown file (e.g.,
google-workspace-orchestrator.md) in the folder and paste the following structure:
---
kind: remote
name: google-workspace-orchestrator
agent_card_json: |
{
"name": "Google Workspace Orchestrator",
... (Paste your JSON here)
}
---Launch the Gemini CLI. The application will detect the new subagent.
# List available agents
/agents
# Use the specific subagent
@google-workspace-orchestrator Create a roadmap for my project in a new Spreadsheet.- v1.0.0 (April 13, 2026)
- Initial release.