gw-cli

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.
60-second quickstart
Before you start: gw auth login needs an OAuth credentials.json that you create once in Google Cloud (Desktop-app OAuth client). It is not shipped with the package. New here? Run /gw-setup in Claude Code for a guided walkthrough, or follow Setup below. (Running gw auth login without 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?"
Features
- 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
--json output for seamless skill parsing
- Periodic monitoring — Use with
/loop for unread email checks, calendar reminders
- WSL2 compatible — Automatic fallback to manual OAuth flow when localhost callback is unreachable
Required dependencies
| 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 |
Install
As a Claude Code plugin (recommended)
/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 |
Standalone CLI
pip install google-workspace-cli
Published on PyPI as google-workspace-cli (the gw-cli name was already taken). The installed command is still gw.
Latest from source:
pip install git+https://github.com/JFK/gw-cli.git
Or clone and install locally:
git clone https://github.com/JFK/gw-cli.git
cd gw-cli
pip install -e .
Setup
1. Create GCP Project
gcloud projects create gw-cli-$(date +%Y%m%d) --name="gw-cli"
gcloud config set project gw-cli-YYYYMMDD
2. Enable APIs
gcloud services enable calendar-json.googleapis.com gmail.googleapis.com drive.googleapis.com --project=PROJECT_ID
3. OAuth Consent Screen
Open 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)
4. Create OAuth Client
Open in browser: https://console.cloud.google.com/apis/credentials/oauthclient?project=PROJECT_ID
- Application type: Desktop app
- Download the JSON file
5. Login
gw auth login --credentials ./credentials.json
On WSL2/remote environments, the tool automatically falls back to manual URL paste mode when the localhost callback is unreachable.
6. Verify
gw auth status
gw cal list --days 3
gw mail list --query "is:unread" --limit 5
Usage
Available commands