Cli gws-events-subscribe
Google Workspace Events: Subscribe to Workspace events and stream them as NDJSON.
install
source · Clone the upstream repo
git clone https://github.com/googleworkspace/cli
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/googleworkspace/cli "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/gws-events-subscribe" ~/.claude/skills/googleworkspace-cli-gws-events-subscribe && rm -rf "$T"
manifest:
skills/gws-events-subscribe/SKILL.mdsource content
events +subscribe
PREREQUISITE: Read
for 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
gws events +subscribe
Flags
| 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
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