Google Workspace CLI: One Tool That Turns Drive, Gmail, and Calendar Into Agent Skills
Watch on TikTok
Google open-sourced a single command-line tool — gws — that gives AI agents complete, structured access to the entire Google Workspace: Drive, Gmail, Calendar, Sheets, Docs, and Chat. It's built AI-first: every command returns structured JSON, ships with 40+ pre-built agent skills, and plugs into Claude Code or Gemini CLI as an MCP server.
The Repo in One Glance

The tagline is literal: one CLI for all of Google Workspace. It's Apache 2.0 licensed, built on top of Google's Discovery Service so it generates its command surface dynamically from Google's live API specs. When a Workspace API adds an endpoint or method, gws picks it up automatically — no static release needed.
Install:
npm install -g @googleworkspace/cli
Why It's Interesting for AI Agents

Two audiences, one tool:
| For humans | For AI agents |
|---|---|
Stop writing curl calls against REST docs |
Every response is structured JSON |
| Tab-completion on every command | Pair with included agent skills |
--help on every resource |
Your LLM can manage Workspace without custom tooling |
--dry-run to preview requests |
40+ pre-built agent skills |
| Auto-pagination | Schema introspection per method |
The AI-agent angle is the sleeper. Most Workspace automation today is duct-taped through bespoke OAuth integrations. gws replaces all of that with a single structured surface. Hand Claude Code the CLI and it can list recent Drive files, draft a Gmail reply, create a sheet, or post a Chat message — no per-API integration code.
Sample commands pulled straight from the README:
# List the 10 most recent Drive files
gws drive files list --params '{"pageSize": 10}'
# Create a spreadsheet
gws sheets spreadsheets create --json '{"properties": {"title": "Q1 Budget"}}'
# Send a Chat message
gws chat spaces messages create \
--params '{"parent": "spaces/xyz"}' \
--json '{"text": "Deploy complete."}'
# Introspect any method's request/response schema
gws schema drive.files.list
# Stream paginated results as NDJSON
gws drive files list --params '{"pageSize": 100}' --page-all | jq -r '.fil...'
MCP Server Mode: The Real Unlock
The feature that matters for agent builders: gws spins up instantly as an MCP server. Point Claude Code or Gemini CLI at it, and the agent suddenly has read/write access to the entire Google Workspace surface as tools. Zero custom integrations, zero glue code.
That's the difference between "I could build a Workspace integration" and "my agent can already read my inbox." The friction drops to near-zero.
Authentication
Three auth paths, covering laptop/CI/server:
- Interactive (local desktop) — credentials stored in OS keyring
- Manual OAuth (Google Cloud Console) — when you need explicit control
- Service account — for headless/server use
Setup is two commands: gws auth setup (one-time Cloud project + API enablement) and gws auth login (subsequent logins).
Why This Is a Shift
Every ambitious AI agent eventually wants to touch email, calendars, and files. Historically that meant writing a Gmail-specific integration, a Drive-specific integration, a Calendar-specific integration — each with its own OAuth flow, its own SDK, its own error handling. gws collapses all of that into a single CLI with consistent semantics and a single MCP endpoint.
For agent builders, this is one of those "suddenly you can" moments. Google quietly shipped the missing primitive.
Key Takeaways
gwsis Google's open-source CLI covering Drive, Gmail, Calendar, Sheets, Docs, and Chat through a single unified surface- Commands are generated dynamically from Google's Discovery Service, so new APIs appear automatically
- Every response is structured JSON; 40+ pre-built agent skills ship in the box
- Launches as an MCP server for Claude Code / Gemini CLI, turning Workspace into first-class agent tools
- Eliminates the need for per-API custom integrations when building Workspace-aware AI agents
Resources
- googleworkspace/cli on GitHub — Source code, README, and install instructions
- Google Workspace API Overview — Underlying APIs the CLI wraps
- Model Context Protocol (MCP) — The agent tool protocol
gwsexposes
Published April 16, 2026. Writeup generated from a favorited TikTok.