Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Subscribe to Google Workspace events via Pub/Sub and stream them as NDJSON using the gws CLI.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
SKILL.md
1---2name: gws-events-subscribe3description: "Google Workspace Events: Subscribe to Workspace events and stream them as NDJSON."4metadata:5version: 0.22.56openclaw:7category: "productivity"8requires:9bins:10- gws11cliHelp: "gws events +subscribe --help"12---1314# events +subscribe1516> **PREREQUISITE:** Read `../gws-shared/SKILL.md` for auth, global flags, and security rules. If missing, run `gws generate-skills` to create it.1718Subscribe to Workspace events and stream them as NDJSON1920## Usage2122```bash23gws events +subscribe24```2526## Flags2728| Flag | Required | Default | Description |29|------|----------|---------|-------------|30| `--target` | — | — | Workspace resource URI (e.g., //chat.googleapis.com/spaces/SPACE_ID) |31| `--event-types` | — | — | Comma-separated CloudEvents types to subscribe to |32| `--project` | — | — | GCP project ID for Pub/Sub resources |33| `--subscription` | — | — | Existing Pub/Sub subscription name (skip setup) |34| `--max-messages` | — | 10 | Max messages per pull batch (default: 10) |35| `--poll-interval` | — | 5 | Seconds between pulls (default: 5) |36| `--once` | — | — | Pull once and exit |37| `--cleanup` | — | — | Delete created Pub/Sub resources on exit |38| `--no-ack` | — | — | Don't auto-acknowledge messages |39| `--output-dir` | — | — | Write each event to a separate JSON file in this directory |4041## Examples4243```bash44gws events +subscribe --target '//chat.googleapis.com/spaces/SPACE' --event-types 'google.workspace.chat.message.v1.created' --project my-project45gws events +subscribe --subscription projects/p/subscriptions/my-sub --once46gws events +subscribe ... --cleanup --output-dir ./events47```4849## Tips5051- Without --cleanup, Pub/Sub resources persist for reconnection.52- Press Ctrl-C to stop gracefully.5354> [!CAUTION]55> This is a **write** command — confirm with the user before executing.5657## See Also5859- [gws-shared](../gws-shared/SKILL.md) — Global flags and auth60- [gws-events](../gws-events/SKILL.md) — All subscribe to google workspace events commands61