Tooluck logoTooluck
SKILL.md

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)

skills/gws-events-subscribe/SKILL.md

Apache-2.0Full file
1# events +subscribe
2
3> **PREREQUISITE:** Read `../gws-shared/SKILL.md` for auth, global flags, and security rules. If missing, run `gws generate-skills` to create it.
4
5Subscribe to Workspace events and stream them as NDJSON
6
7## Usage
8
9```bash
10gws events +subscribe
11```
12
13## Flags
14
15| 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 |
27
28## Examples
29
30```bash
31gws events +subscribe --target '//chat.googleapis.com/spaces/SPACE' --event-types 'google.workspace.chat.message.v1.created' --project my-project
32gws events +subscribe --subscription projects/p/subscriptions/my-sub --once
33gws events +subscribe ... --cleanup --output-dir ./events
34```
35
36## Tips
37
38- 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.

More skills in cli

Newsletter

Join the Community

Subscribe to our newsletter for the latest news and updates