
Gws Events Subscribe
- 24.7k installs
- 30k repo stars
- Updated July 22, 2026
- googleworkspace/cli
gws-events-subscribe is a Google Workspace CLI skill that subscribes to real-time Workspace events and streams them as NDJSON.
About
This skill subscribes to Google Workspace events (Chat, Docs, Drive, etc.) and streams them as NDJSON through Google Cloud Pub/Sub. It provides event filtering, batch polling, and optional file output for event logging. Developers use it to build real-time integrations and data pipelines that react to Workspace changes.
- Subscribes to real-time Google Workspace events via Pub/Sub
- Streams events as NDJSON for processing in pipelines
- Supports event filtering by type and resource with graceful backpressure
Gws Events Subscribe by the numbers
- 24,709 all-time installs (skills.sh)
- +817 installs in the week ending Jul 28, 2026 (Skillselion tracking)
- Ranked #29 of 2,742 Automation & Workflows skills by installs in the Skillselion catalog
- Security screen: LOW risk (skills.sh audit)
- Data as of Jul 28, 2026 (Skillselion catalog sync)
gws-events-subscribe capabilities & compatibility
- Works with
- gcp
npx skills add https://github.com/googleworkspace/cli --skill gws-events-subscribeAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 24.7k |
|---|---|
| repo stars | ★ 30k |
| Security audit | 3 / 3 scanners passed |
| Last updated | July 22, 2026 |
| Repository | googleworkspace/cli ↗ |
How do you stream Google Workspace events as NDJSON?
Stream real-time Google Workspace events to build integrations and reactive pipelines.
Who is it for?
Developers building event-driven automations who need real-time Google Chat or Workspace event streams through the gws CLI.
Skip if: Renewing expired subscriptions or one-off REST polling—pair with gws-events-renew for subscription lifecycle management.
When should I use this skill?
A developer asks to subscribe to Google Workspace or Chat events and process them as a real-time NDJSON stream.
What you get
Live NDJSON event stream from a Workspace resource subscription via gws events +subscribe
- NDJSON event stream from Workspace subscription
By the numbers
- Streams Workspace events as NDJSON via gws events +subscribe
- Ships with gws CLI metadata version 0.22.5
Files
events +subscribe
PREREQUISITE: Read../gws-shared/SKILL.mdfor auth, global flags, and security rules. If missing, rungws generate-skillsto create it.
Subscribe to Workspace events and stream them as NDJSON
Usage
gws events +subscribeFlags
| Flag | Required | Default | Description |
|---|---|---|---|
--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 | — | 10 | Max messages per pull batch (default: 10) |
--poll-interval | — | 5 | Seconds 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
gws events +subscribe --target '//chat.googleapis.com/spaces/SPACE' --event-types 'google.workspace.chat.message.v1.created' --project my-project
gws events +subscribe --subscription projects/p/subscriptions/my-sub --once
gws events +subscribe ... --cleanup --output-dir ./eventsTips
- Without --cleanup, Pub/Sub resources persist for reconnection.
- Press Ctrl-C to stop gracefully.
[!CAUTION]
This is a write command — confirm with the user before executing.
See Also
- gws-shared — Global flags and auth
- gws-events — All subscribe to google workspace events commands
Related skills
How it compares
Use gws-events-subscribe to open a live stream; use gws-events-renew when an existing subscription nears expiration.
FAQ
What output format does gws-events-subscribe produce?
gws-events-subscribe streams Google Workspace events as NDJSON—one JSON object per line on stdout—so scripts, jq filters, or agents can process messages incrementally without buffering entire payloads.
Which flag scopes the subscription target?
gws-events-subscribe uses gws events +subscribe with the --target flag set to a Workspace resource URI, limiting which Chat or Workspace events enter the NDJSON stream.
How do subscriptions stay active long term?
gws-events-subscribe creates the listener; gws-events-renew runs gws events +renew to reactivate subscriptions/SUB_* resources before Workspace Events TTLs expire.
Is Gws Events Subscribe safe to install?
skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.