Google Workspace CLI for Claude Code — Calendar, Gmail, Drive with multi-account OAuth support
Project description
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
# In any Claude Code session:
/plugin marketplace add JFK/gw-cli
/plugin install gw-cli
# Setup (one-time):
gw auth login --credentials ./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
--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
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(thegw-cliname was already taken). The installed command is stillgw.
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
gw 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
Calendar
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_ID
Gmail
gw 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_ID
Drive
gw 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.com
Multi-account
gw 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 command
Config
gw config show
gw config set defaults.calendar.days 14
gw config set defaults.mail.limit 50
Output
All commands support --json for machine-readable output:
gw cal list --json
gw mail list --query "is:unread" --json
Human-readable output always shows the active account:
[fumikazu.kiyota@gmail.com]
evt1 | Team standup | 2026-04-17T10:00:00+09:00 | ...
Periodic Monitoring
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 storage
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
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file google_workspace_cli-0.1.0.tar.gz.
File metadata
- Download URL: google_workspace_cli-0.1.0.tar.gz
- Upload date:
- Size: 84.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
372baa7899bc3f519773fbc92bb3ce9044d789ef65bd1d57fed12197e013e4f4
|
|
| MD5 |
91669d86ae482b5d17e53c5e2843dd5a
|
|
| BLAKE2b-256 |
c8a613e068ec56dcdd7a4309e6ccffb1e1f03e698be3448c044942370af0901e
|
Provenance
The following attestation bundles were made for google_workspace_cli-0.1.0.tar.gz:
Publisher:
publish.yml on JFK/gw-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
google_workspace_cli-0.1.0.tar.gz -
Subject digest:
372baa7899bc3f519773fbc92bb3ce9044d789ef65bd1d57fed12197e013e4f4 - Sigstore transparency entry: 1822304301
- Sigstore integration time:
-
Permalink:
JFK/gw-cli@deeb3c80f216e0e7fdf3db7c8d927aa831f98269 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/JFK
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@deeb3c80f216e0e7fdf3db7c8d927aa831f98269 -
Trigger Event:
push
-
Statement type:
File details
Details for the file google_workspace_cli-0.1.0-py3-none-any.whl.
File metadata
- Download URL: google_workspace_cli-0.1.0-py3-none-any.whl
- Upload date:
- Size: 18.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a91f36642e74dafba041b7bba35ba31971c47b14227842e3daa1b4f3731dcb5c
|
|
| MD5 |
b4810726c987c6933010abd1a46a21b1
|
|
| BLAKE2b-256 |
9b6f78efef84b2eeb8a5a2e800dee80b5dd8421a677e6682d7dbb908d7e1fca0
|
Provenance
The following attestation bundles were made for google_workspace_cli-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on JFK/gw-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
google_workspace_cli-0.1.0-py3-none-any.whl -
Subject digest:
a91f36642e74dafba041b7bba35ba31971c47b14227842e3daa1b4f3731dcb5c - Sigstore transparency entry: 1822304339
- Sigstore integration time:
-
Permalink:
JFK/gw-cli@deeb3c80f216e0e7fdf3db7c8d927aa831f98269 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/JFK
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@deeb3c80f216e0e7fdf3db7c8d927aa831f98269 -
Trigger Event:
push
-
Statement type: