Back to Skills

gws-gmail-watch

Gmail: Watch for new emails and stream them as NDJSON.

24,602stars1,249forksUpdated 4/14/2026

Security Assessment

Safe(100/100)
Security Score100/100

About gws-gmail-watch

The `gws-gmail-watch` skill enables users to monitor incoming Gmail messages in real-time and stream them as NDJSON. This functionality addresses the challenge of efficiently tracking new emails without repeatedly polling the Gmail API manually, providing an automated solution for continuous email monitoring. By integrating with Google Cloud Pub/Sub, it allows for scalable and reliable message delivery, ensuring that email events can be captured and processed as they occur. Users can leverage this to build downstream workflows, notifications, or data pipelines that depend on timely email data.

Key features of the `gws-gmail-watch` skill include the ability to filter emails by Gmail label IDs, control the number of messages pulled per batch, set polling intervals, and select the format of the Gmail messages (full, metadata, minimal, raw). It supports both continuous watching and one-time pulls, giving flexibility for different use cases. Additionally, it provides options to manage Pub/Sub resources automatically, including cleanup on exit and writing individual messages to JSON files. These capabilities make it suitable for both simple monitoring tasks and more complex integrations with other systems.

The skill is ideal for developers, IT professionals, and productivity-focused users who need to automate email monitoring and processing. Typical use cases include triggering workflows based on incoming emails, integrating Gmail events into dashboards or logging systems, and automating notifications for specific types of messages. By providing structured and filtered email streams, `gws-gmail-watch` empowers users to build efficient and reliable email-driven automation without handling the low-level details of API polling and Pub/Sub management.

FAQ

How do I start watching Gmail messages with this skill?

Run `gws gmail +watch` in your terminal. You can specify flags like `--project`, `--label-ids`, or `--once` to customize behavior.

Can I filter emails by labels or folders?

Yes, use the `--label-ids` flag with a comma-separated list of Gmail label IDs, such as `INBOX,UNREAD`.

Do I need a Google Cloud project to use this skill?

Yes, a GCP project is required for Pub/Sub resources unless you provide an existing subscription or topic using the `--subscription` or `--topic` flags.

How long does a Gmail watch remain active?

Gmail watches expire after 7 days, so you need to re-run the skill to renew the watch.

What happens to Pub/Sub resources after stopping the watch?

By default, resources persist for reconnection. Use the `--cleanup` flag to delete them automatically on exit.

Install gws-gmail-watch

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill