Google Workspace CLI for Claude Code — manage Calendar, Gmail, and Drive across multiple Google accounts.
gw-cli is a Claude Code plugin that brings Google Workspace into your terminal. Register multiple OAuth accounts, switch between them instantly, and let Claude Code operate your calendar, email, and files through natural language.
Before you start:
gw auth loginneeds an OAuthcredentials.jsonthat you create once in Google Cloud (Desktop-app OAuth client). It is not shipped with the package. New here? Run/gw-setupin Claude Code for a guided walkthrough, or follow Setup below. (Runninggw auth loginwithout it prints these same instructions.)
# In any Claude Code session:
/plugin marketplace add JFK/gw-cli
/plugin install gw-cli
# One-time setup — see "Setup" below to obtain credentials.json first:
gw auth login --credentials /path/to/credentials.json
# Then use naturally:
"Show me my unread emails"
"Schedule a meeting tomorrow at 10am with Meet"
"What's on my calendar this week?"
- Multi-account support — Register multiple Google accounts (personal, work, client projects) and switch between them instantly
- Calendar — List, create, update, delete events. Google Meet setup. Free/busy check across accounts
- Gmail — Search, read, send, reply. Label management. Mark read/unread. Attachment download and save to Drive
- Drive — List, search, upload, create Google Docs/Sheets/Slides. Share/unshare files
- Claude Code integration — All commands support
--jsonoutput for seamless skill parsing - Periodic monitoring — Use with
/loopfor unread email checks, calendar reminders - WSL2 compatible — Automatic fallback to manual OAuth flow when localhost callback is unreachable
| Tool | Required | Why |
|---|---|---|
| Python 3.10+ | yes | Runtime |
pip |
yes | Package installation |
gcloud CLI |
recommended | GCP project setup and API enablement |
| Claude Code | recommended | Plugin integration and natural language interface |
/plugin marketplace add JFK/gw-cli
/plugin install gw-cli
The plugin auto-installs the Python CLI and registers 7 skills:
| Skill | Description |
|---|---|
/gw-setup |
Guided first-time Google Cloud setup |
/gw-auth |
Account management (login, switch, list, remove) |
/gw-calendar |
Calendar operations |
/gw-mail |
Gmail operations |
/gw-drive |
Drive operations |
/gw-workflow |
Cross-service workflows (email attachment to Drive, etc.) |
/gw-loop |
Periodic monitoring setup |
pip install google-workspace-cliPublished on PyPI as
google-workspace-cli(thegw-cliname was already taken). The installed command is stillgw.
Latest from source:
pip install git+https://github.com/JFK/gw-cli.gitOr clone and install locally:
git clone https://github.com/JFK/gw-cli.git
cd gw-cli
pip install -e .gcloud projects create gw-cli-$(date +%Y%m%d) --name="gw-cli"
gcloud config set project gw-cli-YYYYMMDDgcloud services enable calendar-json.googleapis.com gmail.googleapis.com drive.googleapis.com --project=PROJECT_IDOpen in browser: https://console.cloud.google.com/apis/credentials/consent?project=PROJECT_ID
- User Type: External
- App name:
gw-cli - Add your email as a test user (required, otherwise login fails with 403)
Open in browser: https://console.cloud.google.com/apis/credentials/oauthclient?project=PROJECT_ID
- Application type: Desktop app
- Download the JSON file
gw auth login --credentials ./credentials.jsonOn WSL2/remote environments, the tool automatically falls back to manual URL paste mode when the localhost callback is unreachable.
gw auth status
gw cal list --days 3
gw mail list --query "is:unread" --limit 5gw auth login, list, status, switch, remove
gw cal list, get, create, update, delete, free
gw mail list, read, send, reply, labels, label, mark, attachments, download, to-drive
gw drive list, upload, create, share, unshare
gw config show, set
gw cal list --days 7
gw cal create --title "Meeting" --start "2026-04-17 10:00" --end "2026-04-17 11:00" --meet
gw cal create --title "1on1" --start "2026-04-18 14:00" --end "2026-04-18 14:30" --meet --attendee colleague@example.com
gw cal free --date 2026-04-17
gw cal delete EVENT_IDgw mail list --query "is:unread"
gw mail read MESSAGE_ID
gw mail send --to "user@example.com" --subject "Hello" --body "Hi there"
gw mail reply MESSAGE_ID --body "Thanks!"
gw mail mark MESSAGE_ID --read
gw mail attachments MESSAGE_ID
gw mail to-drive MESSAGE_ID --attachment-id ATT_ID --folder FOLDER_IDgw drive list
gw drive list --query "name contains 'report'"
gw drive upload ./file.pdf
gw drive create --type doc --title "New Document"
gw drive share FILE_ID --email user@example.com --role writer
gw drive unshare FILE_ID --email user@example.comgw auth login --credentials ./work-credentials.json # Add another account
gw auth list # Show all accounts
gw auth switch work@company.com # Switch active account
gw mail list # Uses active account
gw mail list --account personal@gmail.com # Override for one commandgw config show
gw config set defaults.calendar.days 14
gw config set defaults.mail.limit 50All commands support --json for machine-readable output:
gw cal list --json
gw mail list --query "is:unread" --jsonHuman-readable output always shows the active account:
[fumikazu.kiyota@gmail.com]
evt1 | Team standup | 2026-04-17T10:00:00+09:00 | ...
Use with the /loop skill for continuous monitoring:
/loop 5m gw mail list --query "is:unread" --json
/loop 30m gw cal list --days 1 --json
Config stored at ~/.config/google-workspace-cli/config.json.
Credentials and tokens are stored per account:
~/.config/google-workspace-cli/
├── config.json
├── credentials/
│ └── user@gmail.com.json
└── tokens/
└── user@gmail.com.json
MIT