gws-gmail-watch
Agent skill fromgoogleworkspace/cli
Gmail: Watch for new emails and stream them as NDJSON.
How to install gws-gmail-watch
install gws-gmail-watch
# install the cli pack with the skills CLI
npx skills add googleworkspace/cli# or add only this skill to Claude Code: copy the folder
skills/gws-gmail-watch/
# into
~/.claude/skills/gws-gmail-watch/ (all projects)
.claude/skills/gws-gmail-watch/ (one project)
1# gmail +watch23> **PREREQUISITE:** Read `../gws-shared/SKILL.md` for auth, global flags, and security rules. If missing, run `gws generate-skills` to create it.45Watch for new emails and stream them as NDJSON67## Usage89```bash10gws gmail +watch11```1213## Flags1415| Flag | Required | Default | Description |16|------|----------|---------|-------------|17| `--project` | — | — | GCP project ID for Pub/Sub resources |18| `--subscription` | — | — | Existing Pub/Sub subscription name (skip setup) |19| `--topic` | — | — | Existing Pub/Sub topic with Gmail push permission already granted |20| `--label-ids` | — | — | Comma-separated Gmail label IDs to filter (e.g., INBOX,UNREAD) |21| `--max-messages` | — | 10 | Max messages per pull batch |22| `--poll-interval` | — | 5 | Seconds between pulls |23| `--msg-format` | — | full | Gmail message format: full, metadata, minimal, raw |24| `--once` | — | — | Pull once and exit |25| `--cleanup` | — | — | Delete created Pub/Sub resources on exit |26| `--output-dir` | — | — | Write each message to a separate JSON file in this directory |2728## Examples2930```bash31gws gmail +watch --project my-gcp-project32gws gmail +watch --project my-project --label-ids INBOX --once33gws gmail +watch --subscription projects/p/subscriptions/my-sub34gws gmail +watch --project my-project --cleanup --output-dir ./emails35```3637## Tips3839- Gmail watch expires after 7 days — re-run to renew.40- Without --cleanup, Pub/Sub resources persist for reconnection.41- Press Ctrl-C to stop gracefully.42…
Excerpt shown under the repository's Apache-2.0 license.
