Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Watch for new Gmail messages and stream them as NDJSON via Google Pub/Sub integration using the gws CLI.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
SKILL.md
1---2name: gws-gmail-watch3description: "Gmail: Watch for new emails and stream them as NDJSON."4metadata:5version: 0.22.56openclaw:7category: "productivity"8requires:9bins:10- gws11cliHelp: "gws gmail +watch --help"12---1314# gmail +watch1516> **PREREQUISITE:** Read `../gws-shared/SKILL.md` for auth, global flags, and security rules. If missing, run `gws generate-skills` to create it.1718Watch for new emails and stream them as NDJSON1920## Usage2122```bash23gws gmail +watch24```2526## Flags2728| Flag | Required | Default | Description |29|------|----------|---------|-------------|30| `--project` | — | — | GCP project ID for Pub/Sub resources |31| `--subscription` | — | — | Existing Pub/Sub subscription name (skip setup) |32| `--topic` | — | — | Existing Pub/Sub topic with Gmail push permission already granted |33| `--label-ids` | — | — | Comma-separated Gmail label IDs to filter (e.g., INBOX,UNREAD) |34| `--max-messages` | — | 10 | Max messages per pull batch |35| `--poll-interval` | — | 5 | Seconds between pulls |36| `--msg-format` | — | full | Gmail message format: full, metadata, minimal, raw |37| `--once` | — | — | Pull once and exit |38| `--cleanup` | — | — | Delete created Pub/Sub resources on exit |39| `--output-dir` | — | — | Write each message to a separate JSON file in this directory |4041## Examples4243```bash44gws gmail +watch --project my-gcp-project45gws gmail +watch --project my-project --label-ids INBOX --once46gws gmail +watch --subscription projects/p/subscriptions/my-sub47gws gmail +watch --project my-project --cleanup --output-dir ./emails48```4950## Tips5152- Gmail watch expires after 7 days — re-run to renew.53- Without --cleanup, Pub/Sub resources persist for reconnection.54- Press Ctrl-C to stop gracefully.5556## See Also5758- [gws-shared](../gws-shared/SKILL.md) — Global flags and auth59- [gws-gmail](../gws-gmail/SKILL.md) — All send, read, and manage email commands60