googleworkspace avatar

Gws Events Subscribe

Streams Google Workspace events like new Chat messages or Drive file changes directly to your terminal as NDJSON, which is surprisingly useful for debugging webhooks or building real-time integrations. Sets up the entire Pub/Sub pipeline automatically, pulls events in configurable batches, and can optionally save each event as a separate JSON file for analysis. The cleanup flag is nice for experimentation since it tears down the Pub/Sub resources when you're done. Honestly, this fills a gap that Google's own tooling doesn't address well for developers who need to see what's actually happening in their Workspace in real-time.

skills.sh installs
31.4K
GitHub stars
32.2K
last updated
Aug 21, 2026

Install

$ npx -y skills add googleworkspace/cli --skill gws-events-subscribe --agent claude-code

Installs into .claude/skills of the current project.

Files

events +subscribe

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

Subscribe to Workspace events and stream them as NDJSON

Usage

gws events +subscribe

Flags

FlagRequiredDefaultDescription
--target——Workspace resource URI (e.g., //chat.googleapis.com/spaces/SPACE_ID)
--event-types——Comma-separated CloudEvents types to subscribe to
--project——GCP project ID for Pub/Sub resources
--subscription——Existing Pub/Sub subscription name (skip setup)
--max-messages—10Max messages per pull batch (default: 10)
--poll-interval—5Seconds between pulls (default: 5)
--once——Pull once and exit
--cleanup——Delete created Pub/Sub resources on exit
--no-ack——Don't auto-acknowledge messages
--output-dir——Write each event 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
1googleworkspace avatarrecipe-create-doc-from-templategoogleworkspace/cliCopy a Google Docs template, fill in content, and share with collaborators.31.4Kskills.sh installs
2googleworkspace avatarrecipe-label-and-archive-emailsgoogleworkspace/cliApply Gmail labels to matching messages and archive them to keep your inbox clean.31.1Kskills.sh installs
3googleworkspace avatarrecipe-save-email-to-docgoogleworkspace/cliSave a Gmail message body into a Google Doc for archival or reference.31.1Kskills.sh installs
4googleworkspace avatarpersona-team-leadgoogleworkspace/cliLead a team — run standups, coordinate tasks, and communicate.31Kskills.sh installs
5googleworkspace avatarrecipe-create-task-listgoogleworkspace/cliSet up a new Google Tasks list with initial tasks.30.9Kskills.sh installs
6googleworkspace avatarrecipe-schedule-recurring-eventgoogleworkspace/cliCreate a recurring Google Calendar event with attendees.30.9Kskills.sh installs