
Gws Gmail Watch
Streams incoming Gmail messages as NDJSON using Google Cloud Pub/Sub, which is useful for building email automation workflows or monitoring specific inboxes. Sets up the necessary Pub/Sub topic and subscription automatically, handles Gmail's push notifications, and lets you filter by label IDs like INBOX or UNREAD. The watch expires after 7 days so you'll need to re-run it periodically. Works well for feeding email data into scripts or dashboards, though you'll need a GCP project with billing enabled since it creates Pub/Sub resources.
- skills.sh installs
- 38.1K
- GitHub stars
- 32.2K
- last updated
- Aug 21, 2026
Install
$ npx -y skills add googleworkspace/cli --skill gws-gmail-watch --agent claude-codeInstalls into .claude/skills of the current project.
Files
gmail +watch
PREREQUISITE: Read
../gws-shared/SKILL.mdfor auth, global flags, and security rules. If missing, rungws generate-skillsto create it.
Watch for new emails and stream them as NDJSON
Usage
gws gmail +watch
Flags
| Flag | Required | Default | Description |
|---|---|---|---|
--project | — | — | GCP project ID for Pub/Sub resources |
--subscription | — | — | Existing Pub/Sub subscription name (skip setup) |
--topic | — | — | Existing Pub/Sub topic with Gmail push permission already granted |
--label-ids | — | — | Comma-separated Gmail label IDs to filter (e.g., INBOX,UNREAD) |
--max-messages | — | 10 | Max messages per pull batch |
--poll-interval | — | 5 | Seconds between pulls |
--msg-format | — | full | Gmail message format: full, metadata, minimal, raw |
--once | — | — | Pull once and exit |
--cleanup | — | — | Delete created Pub/Sub resources on exit |
--output-dir | — | — | Write each message to a separate JSON file in this directory |
Examples
Sponsors
Details
- Repository
- github.com/googleworkspace/cli
- Categories
- CLI & Terminal, Office & Documents
More from googleworkspace/cli
All 113- Gws Gmail Reply36K
- Gws Gmail Forward34.5K
- Gws Workflow34.3K
- Gws Chat33.9K
- Gws People33.8K
- Gws Gmail Reply All33.8K
- Gws Workflow Email To Task33.2K
- Recipe Create Presentation33.1K
- Gws Chat Send32.7K
- Gws Workflow Meeting Prep32.6K
- Gws Workflow Weekly Digest32.3K
- Gws Workflow Standup Report32.3K
- Recipe Draft Email From Doc32.3K
- Persona Project Manager32.2K
- Recipe Email Drive Link32.1K
- Gws Events32.1K
- Persona Researcher32K
- Recipe Create Gmail Filter32K
- Recipe Save Email Attachments31.8K
- Recipe Backup Sheet As Csv31.7K
- Recipe Organize Drive Folder31.7K
- Persona Exec Assistant31.6K
- Recipe Find Free Time31.5K
- Gws Workflow File Announce31.5K