Skip to content
cccskills
FreePublished on GitHub

gws-gmail-watch

Watch for new Gmail messages and stream them as NDJSON, a format with one JSON record per line. Filter messages by label, adjust retrieval settings, or save each message to a separate JSON file.

OriginalShow the original description

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

Works withGmail
See how to install

Good for

  • Monitor new messages arriving in the inbox
  • Filter monitored emails by Gmail label
  • Save each incoming message as a JSON file
  • Retrieve available messages once and exit

Files included (1)

  • SKILL.md1.9 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

gmail +watch

PREREQUISITE: Read ../gws-shared/SKILL.md for auth, global flags, and security rules. If missing, run gws generate-skills to create it.

Watch for new emails and stream them as NDJSON

Usage

gws gmail +watch

Flags

FlagRequiredDefaultDescription
--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—10Max messages per pull batch
--poll-interval—5Seconds between pulls
--msg-format—fullGmail 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

gws gmail +watch --project my-gcp-project
gws gmail +watch --project my-project --label-ids INBOX --once
gws gmail +watch --subscription projects/p/subscriptions/my-sub
gws gmail +watch --project my-project --cleanup --output-dir ./emails

Tips

  • Gmail watch expires after 7 days — re-run to renew.
  • Without --cleanup, Pub/Sub resources persist for reconnection.
  • Press Ctrl-C to stop gracefully.

See Also

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Retrieve Google Workspace audit logs, which record account activity, and usage reports through gws. Review activity in applications such as the Admin console and Google Drive, or inspect statistics for the organization, users, and entities.

  • Reviewing Admin console and Google Drive activity
  • Checking organization usage statistics
  • Retrieving usage reports for users
googleworkspace/cli31.7KUpdated Oct 7, 2026

gws-calendar

FreeSummary

Manage Google Calendar events and calendars, including creating, updating, and deleting events. View upcoming events across calendars, check availability, and manage the permissions that control who can access a calendar.

  • Creating, updating, or deleting calendar events
  • Viewing upcoming events across multiple calendars
  • Checking availability across calendars
googleworkspace/cli31.7KUpdated Oct 7, 2026

View upcoming Google Calendar events across all calendars in one agenda. Check today, tomorrow, this week, or a chosen number of days, with options to filter calendars and change the display time zone.

  • Checking today's events across multiple calendars
  • Reviewing tomorrow's or this week's schedule
  • Listing the next three days on a work calendar
googleworkspace/cli31.7KUpdated Oct 7, 2026

Create a Google Calendar event with a title and start and end times. You can also choose a calendar, add a location and description, invite attendees, and include a Google Meet link.

  • Adding a meeting with a specified start and end time
  • Creating an event with attendees
  • Scheduling an online meeting with a Google Meet link
googleworkspace/cli31.7KUpdated Oct 7, 2026

gws-chat

FreeSummary

Manage Google Chat spaces, the places where conversations happen, and their messages through the gws command-line tool. Create or update spaces, add members, send messages, and upload or download attachments.

  • Create a Google Chat space with initial members
  • List spaces and update their details
  • Send messages to a space
googleworkspace/cli31.7KUpdated Oct 7, 2026

gws-chat-send

FreeSummary

Send plain text messages to a specified Google Chat space using the gws command line tool. Use it for team updates and announcements, with guidance on finding space identifiers and confirming messages before sending.

  • Sending a team announcement
  • Sharing a progress update in a space
  • Finding the destination space before sending
googleworkspace/cli31.7KUpdated Oct 7, 2026

See all skills by googleworkspace

Report a problem with this skill