Set up and use Google Workspace CLI (gws) for organizational Google accounts. Trigger when: user mentions Google Workspace, gws, organizational Gmail, company Google account, Google admin, Google Workspace setup, or needs to connect work Google services (Gmail, Drive, Calendar, Sheets, Docs, Chat, Tasks). Also trigger when user says "connect my work email", "set up Google for my organization", "gws setup", or references gws commands. Trigger for any @company.com or non-gmail.com Google account setup. Do NOT use for personal/consumer Google account connections via @gmail.com (use google-personal — Workspace is for managed organizational accounts with admin-level service configuration and gws CLI, not personal Gmail consumer accounts), accessing Google Workspace APIs after the integration is set up (use email-triage, document skills, and other workflow skills — they use the gws connection automatically once established; the connector is for setup and reconnect flows only), or connecting non-Google enterprise tools (use the appropriate connector for Slack, Microsoft 365, or other providers). Do NOT use when user wants a guided multi-connector setup via the /connect wizard (which offers Google Workspace as one option). google-workspace skill is for direct gws CLI setup specifically.
From tandemnpx claudepluginhub binatrixai/tandem-marketplace --plugin tandemThis skill is limited to using the following tools:
evals/evals.jsonreferences/gws-commands.mdExecutes pre-written implementation plans: critically reviews, follows bite-sized steps exactly, runs verifications, tracks progress with checkpoints, uses git worktrees, stops on blockers.
Guides idea refinement into designs: explores context, asks questions one-by-one, proposes approaches, presents sections for approval, writes/review specs before coding.
Dispatches parallel agents to independently tackle 2+ tasks like separate test failures or subsystems without shared state or dependencies.
Detect from Personal Preferences. Respond in EN/HE/RU. AskUserQuestion if unknown.
Google Workspace CLI (gws) — a unified command-line tool for Google Workspace
(organizational) accounts. Provides CLI + MCP server for Gmail, Drive, Calendar,
Sheets, Docs, Chat, Tasks, and 30+ more Google services. Built for humans and
AI agents alike.
Key features:
+) for common operations like
sending email, checking agenda, uploading files.GitHub: https://github.com/googleworkspace/cli
| Skill | Use When |
|---|---|
google-workspace (this skill) | Company/org Google accounts (@company.com, @org.edu, etc.) |
google-personal | Personal Gmail accounts (@gmail.com) |
If unsure which the user needs:
AskUserQuestion:
- "Work/organizational Google account (@company.com)"
- "Personal Gmail (@gmail.com)"
brew install googleworkspace-cli
npm install -g @googleworkspace/cli
cargo install --git https://github.com/googleworkspace/cli --lockednix run github:googleworkspace/cligws --version
Requires gcloud CLI installed. This is the fastest path.
gws auth setup # Interactive: creates Cloud project, enables APIs, handles login
gws auth login # Select scopes for the services you need
AskUserQuestion after each command:
- "Done, continue"
- "I need help with this step"
- "Skip — I'll do this later"
Use this if gcloud is not installed or if the organization restricts gcloud.
Step 1: Go to https://console.cloud.google.com/apis/credentials
AskUserQuestion: ["Done, continue" / "I need help with this step" / "Skip — I'll do this later"]
Step 2: Create or select a Google Cloud project.
AskUserQuestion: ["Done, continue" / "I need help with this step" / "Skip — I'll do this later"]
Step 3: Enable the APIs you need. Go to API Library and enable each:
AskUserQuestion: ["Done, continue" / "I need help with this step" / "Skip — I'll do this later"]
Step 4: Create OAuth 2.0 Client ID:
AskUserQuestion: ["Done, continue" / "I need help with this step" / "Skip — I'll do this later"]
Step 5: Place the credentials file:
mkdir -p ~/.config/gws
mv ~/Downloads/client_secret_*.json ~/.config/gws/client_secret.json
AskUserQuestion: ["Done, continue" / "I need help with this step" / "Skip — I'll do this later"]
Step 6: Authenticate:
gws auth login
Follow the browser prompt to authorize. Select all scopes you need.
AskUserQuestion: ["Done, continue" / "I need help with this step" / "Skip — I'll do this later"]
For servers, containers, or CI pipelines where no browser is available:
export GOOGLE_WORKSPACE_CLI_CREDENTIALS_FILE=/path/to/credentials.json
Use a service account JSON key or pre-authorized refresh token.
Run these commands to confirm authentication is working:
gws gmail.users.messages.list --userId me --maxResults 3
gws calendar.events.list --calendarId primary --maxResults 3
If both return data, the connection is active and working.
gws has a built-in MCP server. This is the best integration for Claude Cowork — all Google Workspace services become available as MCP tools automatically. No manual tool definitions needed.
gws mcp
Add to .mcp.json in the project root, or via Claude Settings > MCP Servers:
{
"mcpServers": {
"google-workspace": {
"command": "gws",
"args": ["mcp"]
}
}
}
After adding the MCP configuration, restart Claude. All Google Workspace APIs are now available as tools — Gmail, Calendar, Drive, Sheets, Docs, Tasks, and every other enabled API.
The MCP server dynamically exposes all API methods. When Google adds new endpoints,
they appear automatically after a gws update.
If the user prefers CLI over MCP, or MCP is not available, gws commands can be called directly via Bash:
# List unread emails from today
gws --json gmail.users.messages.list --userId me --q "is:unread newer_than:1d"
# Send an email
gws +send --to user@example.com --subject "Hello" --body "Message content"
# Check calendar for next 3 days
gws +agenda --days 3
Shortcuts prefixed with + for the most common operations:
| Command | Description |
|---|---|
gws +send | Send email |
gws +reply | Reply to email |
gws +triage | Email triage |
gws +agenda | Calendar agenda |
gws +insert | Create calendar event |
gws +upload | Upload to Drive |
gws +append | Append rows to Sheets |
gws +read | Read Sheets data |
gws +write | Write to Docs |
Use gws +COMMAND --help for full options on any helper command.
Not sure what parameters a method takes? Query its schema:
gws schema gmail.users.messages.list # See parameters for any method
gws schema calendar.events.insert # Calendar event creation params
gws schema drive.files.list # Drive file listing params
This works for every Google API method — even ones not covered by helper commands.
After gws is set up and connected, existing Tandem workflow skills work automatically through MCP or CLI:
| Tandem Skill | Google Integration |
|---|---|
| email-triage, email-draft, email-followup | Gmail MCP tools or gws +triage, gws +send |
| daily-briefing | gws +agenda or Calendar MCP |
| task-manager | Tasks MCP tools |
| budget-wizard | Export to Sheets via gws +append |
| presentation | Create in Slides via gws slides.presentations.create |
After successful setup, update ~/Tandem/CLAUDE.md Tools & Connectors section:
- Google Workspace (gws): Connected — Gmail, Calendar, Drive, Sheets, Docs, Tasks [MCP mode]
| Error | Cause | Fix |
|---|---|---|
401 Unauthorized | Token expired or revoked | gws auth login to re-authenticate |
403 Forbidden | Insufficient scopes | gws auth login and select additional scopes |
API not enabled | API not turned on in Cloud Console | Enable the specific API at console.cloud.google.com/apis |
| MCP not connecting | gws not in PATH | Install globally or use full path in MCP config |
redirect_uri_mismatch | Wrong OAuth client type | Recreate as Desktop application type |
access_denied | Admin policy blocks app | Contact Google Workspace admin to allow the app |
quota_exceeded | API rate limit hit | Wait and retry, or request quota increase in Cloud Console |
Re-authenticate with all scopes:
gws auth login --scopes gmail,calendar,drive,sheets,docs,tasks
Check current auth status:
gws auth status
Reset credentials and start fresh:
rm -rf ~/.config/gws/tokens
gws auth login
~/.config/gws/gws auth revoke or via https://myaccount.google.com/permissionsSee references/gws-commands.md for the complete command reference organized by
service, with exact syntax and common usage patterns.