gws-gmail-watch

Watch Gmail for new messages and stream them as NDJSON.

8|1|Updated Mar 5, 2026
One-click install
npx skills add https://github.com/niclasmartinsson-sys/google-workspace-cli --skill gws-gmail-watch-niclasmartinsson-sys
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gws-gmail-watch
Source: https://github.com/niclasmartinsson-sys/google-workspace-cli/tree/main/skills/gws-gmail-watch
Command: npx skills add https://github.com/niclasmartinsson-sys/google-workspace-cli --skill gws-gmail-watch-niclasmartinsson-sys

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Gmail users need real-time visibility into incoming messages without manual polling or constantly checking the inbox.

Core Features & Use Cases

  • Real-time watch: Monitor Gmail for new emails and stream them as NDJSON for pipelines and automation.
  • NDJSON output: Produce newline-delimited JSON suitable for ingestion by data tools and AI agents.
  • Use Case: Integrate with data pipelines or automation to react to new messages as they arrive.

Quick Start

Start streaming new Gmail messages as NDJSON with gws gmail +watch.

Frequently Asked Questions about gws-gmail-watch

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I stream Gmail messages into a data pipeline as NDJSON?

You can stream Gmail messages into a data pipeline as NDJSON by watching for new emails and outputting newline-delimited JSON. This provides real-time message events suitable for ingestion by data tools and AI agents.

What is the best way to monitor Gmail for new emails in real-time?

Monitoring Gmail for new emails in real-time is achieved by watching the inbox and streaming incoming messages as NDJSON. This approach feeds new message events directly into automation tasks without manual polling.

Do I need OAuth credentials to watch Gmail and stream messages?

Yes, you need proper OAuth credentials and the gws CLI to watch Gmail and stream messages. These credentials authorize Google Workspace monitoring and enable Pub/Sub integration for the data pipeline.

Can I filter which Gmail messages are streamed to my automation tasks?

Yes, you can filter which Gmail messages are streamed to your automation tasks. The monitoring process supports label-based filtering to ensure only specific real-time message events are output as NDJSON.

Does Gmail monitoring with NDJSON output work with Pub/Sub integration?

Yes, Gmail monitoring with NDJSON output works with Pub/Sub integration. This setup relies on the gws CLI and proper OAuth credentials to feed real-time message events into downstream data pipelines.

When do I need NDJSON output for Gmail monitoring?

You need NDJSON output for Gmail monitoring when feeding real-time message events into data pipelines or automation tasks. Newline-delimited JSON is specifically formatted for easy ingestion by data tools and AI agents.