gws-events-subscribe — Claude skill: stream Workspace events
The skill subscribes to Google Workspace events and streams them as NDJSON. Useful when an agent has to watch chats or other resources.
npx skills add googleworkspace/cli --skill gws-events-subscribe -a claude-codeWhat gws-events-subscribe does
This skill wraps the gws events +subscribe command. It subscribes to Workspace events through CloudEvents and pulls them from Pub/Sub in batches, emitting NDJSON.
The target goes in --target, for example a Google Chat space URI. Event types are listed comma-separated in --event-types. Use --project for Pub/Sub resources, or --subscription to skip setup when a subscription already exists. The default batch is 10 messages with a 5 second poll interval, and --once pulls a single batch then exits. --output-dir writes each event to its own JSON file.
You need the gws binary and the ../gws-shared/SKILL.md file with auth and global flags. If it is missing, the skill points you to gws generate-skills. Note that this is a write command, so confirm with the user before running it. Without --cleanup, Pub/Sub resources stay around and you can reconnect later. Worth installing if you build automation on top of Workspace events; for a one-off check, --once is enough.
What it helps with
- subscribe to Google Chat events and receive them as a stream
- dump Workspace events into separate JSON files
- reuse an existing Pub/Sub subscription
- pull one batch of events and exit
- delete created Pub/Sub resources on exit
Example prompts for the agent
- Subscribe to events from `//chat.googleapis.com/spaces/SPACE` and show the stream
- Run `gws events +subscribe --subscription projects/p/subscriptions/my-sub --once`
- Collect events into `./events` and clean up Pub/Sub resources on exit
How to install gws-events-subscribe
1Skills CLI (Vercel)
npx skills add googleworkspace/cli --skill gws-events-subscribe -a claude-code2Manually: put the files in place
~/.claude/skills/gws-events-subscribe/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/gws-events-subscribe/
1Skills CLI (Vercel)
npx skills add googleworkspace/cli --skill gws-events-subscribe -a codex2Manually: put the files in place
.agents/skills/gws-events-subscribe/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add googleworkspace/cli --skill gws-events-subscribe -a cursor2Manually: put the files in place
.cursor/skills/gws-events-subscribe/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install googleworkspace/cli gws-events-subscribe2Manually: put the files in place
.github/skills/gws-events-subscribe/SKILL.md1Skills CLI (Vercel)
npx skills add googleworkspace/cli --skill gws-events-subscribe -a gemini-cli2Platform CLI
gemini skills install https://github.com/googleworkspace/cli --path skills/gws-events-subscribeManually: put the files in place
.devin/skills/gws-events-subscribe/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add googleworkspace/cli --skill gws-events-subscribe -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
From the same set95
The whole set →Similar
Questions about gws-events-subscribe
How to install gws-events-subscribe in Claude?
Run npx skills add googleworkspace/cli --skill gws-events-subscribe -a claude-code. The skill file lands at ~/.claude/skills/gws-events-subscribe/SKILL.md.
What does gws-events-subscribe do?
It subscribes to Google Workspace events and streams them as NDJSON. Under the hood it runs gws events +subscribe with flags for the target, event types and Pub/Sub resources.
What do I need for the skill to work?
The gws binary and the ../gws-shared/SKILL.md file with auth rules. If it is missing, create it with gws generate-skills.
Source text
SKILL.md · Apache-2.0
---
name: gws-events-subscribe
description: "Google Workspace Events: Subscribe to Workspace events and stream them as NDJSON."
metadata:
version: 0.22.5
openclaw:
category: "productivity"
requires:
bins:
- gws
cliHelp: "gws events +subscribe --help"
---
# events +subscribe
> **PREREQUISITE:** Read `../gws-shared/SKILL.md` for auth, global flags, and security rules. If missing, run `gws generate-skills` to create it.
Subscribe to Workspace events and stream them as NDJSON
## Usage
```bash
gws events +subscribe
```
## Flags
| Flag | Required | Default | Description |
|------|----------|---------|-------------|
| `--target` | — | — | Workspace resource URI (e.g., //chat.googleapis.com/spaces/SPACE_ID) |
| `--event-types` | — | — | Comma-separated CloudEvents types to subscribe to |
| `--project` | — | — | GCP project ID for Pub/Sub resources |
| `--subscription` | — | — | Existing Pub/Sub subscription name (skip setup) |
| `--max-messages` | — | 10 | Max messages per pull batch (default: 10) |
| `--poll-interval` | — | 5 | Seconds between pulls (default: 5) |
| `--once` | — | — | Pull once and exit |
| `--cleanup` | — | — | Delete created Pub/Sub resources on exit |
| `--no-ack` | — | — | Don't auto-acknowledge messages |
| `--output-dir` | — | — | 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 ./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](../gws-shared/SKILL.md) — Global flags and auth
- [gws-events](../gws-events/SKILL.md) — All subscribe to google workspace events commands
© googleworkspace · Apache-2.0 · googleworkspace/cli