gws-events-subscribe
Original:🇺🇸 English
Translated
Google Workspace Events: Subscribe to Workspace events and stream them as NDJSON.
204installs
Sourcegoogleworkspace/cli
Added on
NPX Install
npx skill4agent add googleworkspace/cli gws-events-subscribeTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →events +subscribe
PREREQUISITE: Readfor auth, global flags, and security rules. If missing, run../gws-shared/SKILL.mdto create it.gws generate-skills
Subscribe to Workspace events and stream them as NDJSON
Usage
bash
gws events +subscribeFlags
| Flag | Required | Default | Description |
|---|---|---|---|
| — | — | Workspace resource URI (e.g., //chat.googleapis.com/spaces/SPACE_ID) |
| — | — | Comma-separated CloudEvents types to subscribe to |
| — | — | GCP project ID for Pub/Sub resources |
| — | — | Existing Pub/Sub subscription name (skip setup) |
| — | 10 | Max messages per pull batch (default: 10) |
| — | 5 | Seconds between pulls (default: 5) |
| — | — | Pull once and exit |
| — | — | Delete created Pub/Sub resources on exit |
| — | — | Don't auto-acknowledge messages |
| — | — | Write each event to a separate JSON file in this directory |
Examples
bash
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