gws-events-subscribe
Agent skill fromgoogleworkspace/cli
Google Workspace Events: Subscribe to Workspace events and stream them as NDJSON.
How to install gws-events-subscribe
install gws-events-subscribe
# install the cli pack with the skills CLI
npx skills add googleworkspace/cli# or add only this skill to Claude Code: copy the folder
skills/gws-events-subscribe/
# into
~/.claude/skills/gws-events-subscribe/ (all projects)
.claude/skills/gws-events-subscribe/ (one project)
1# events +subscribe23> **PREREQUISITE:** Read `../gws-shared/SKILL.md` for auth, global flags, and security rules. If missing, run `gws generate-skills` to create it.45Subscribe to Workspace events and stream them as NDJSON67## Usage89```bash10gws events +subscribe11```1213## Flags1415| Flag | Required | Default | Description |16|------|----------|---------|-------------|17| `--target` | — | — | Workspace resource URI (e.g., //chat.googleapis.com/spaces/SPACE_ID) |18| `--event-types` | — | — | Comma-separated CloudEvents types to subscribe to |19| `--project` | — | — | GCP project ID for Pub/Sub resources |20| `--subscription` | — | — | Existing Pub/Sub subscription name (skip setup) |21| `--max-messages` | — | 10 | Max messages per pull batch (default: 10) |22| `--poll-interval` | — | 5 | Seconds between pulls (default: 5) |23| `--once` | — | — | Pull once and exit |24| `--cleanup` | — | — | Delete created Pub/Sub resources on exit |25| `--no-ack` | — | — | Don't auto-acknowledge messages |26| `--output-dir` | — | — | Write each event to a separate JSON file in this directory |2728## Examples2930```bash31gws events +subscribe --target '//chat.googleapis.com/spaces/SPACE' --event-types 'google.workspace.chat.message.v1.created' --project my-project32gws events +subscribe --subscription projects/p/subscriptions/my-sub --once33gws events +subscribe ... --cleanup --output-dir ./events34```3536## Tips3738- Without --cleanup, Pub/Sub resources persist for reconnection.39- Press Ctrl-C to stop gracefully.40…
Excerpt shown under the repository's Apache-2.0 license.
