Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
googleworkspace avatar

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)
At a glance

gws-events-subscribe capabilities & compatibility

Works with
gcp
npx skills add https://github.com/googleworkspace/cli --skill gws-events-subscribe

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs24.7k
repo stars30k
Security audit3 / 3 scanners passed
Last updatedJuly 22, 2026
Repositorygoogleworkspace/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

SKILL.mdMarkdownGitHub ↗

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
--targetWorkspace resource URI (e.g., //chat.googleapis.com/spaces/SPACE_ID)
--event-typesComma-separated CloudEvents types to subscribe to
--projectGCP project ID for Pub/Sub resources
--subscriptionExisting Pub/Sub subscription name (skip setup)
--max-messages10Max messages per pull batch (default: 10)
--poll-interval5Seconds between pulls (default: 5)
--oncePull once and exit
--cleanupDelete created Pub/Sub resources on exit
--no-ackDon't auto-acknowledge messages
--output-dirWrite 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 ./events

Tips

  • 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.

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.