Skip to main content
skill Claude Code CX Codex Cursor GitHub Copilot official · Google

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.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add googleworkspace/cli --skill gws-events-subscribe -a claude-code
Open on GitHub

What 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-code

2Manually: put the files in place

~/.claude/skills/gws-events-subscribe/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/gws-events-subscribe/

From the same set95

The whole set →
gws-gmail official googleworkspace This skill hands your agent Gmail: send mail, read the inbox, reply in a thread. Useful when email work already runs through the gws CLI. Claude Code CX Codex Cursor +1 81,900installs gws-gmail-send official googleworkspace A skill that teaches your agent to send Gmail from the terminal: recipients, subject, body, attachments and drafts. Claude Code CX Codex Cursor +1 74,700installs gws-drive official googleworkspace This skill hands your agent Google Drive through the gws CLI: files, folders, shared drives, comments and access requests. Useful when docs move through code. Claude Code CX Codex Cursor +1 74,500installs gws-shared official googleworkspace This skill gives agents shared rules for gws CLI authentication, flags, and output formats. Use it when working with gws commands. Claude Code CX Codex Cursor +1 66,000installs gws-calendar official googleworkspace Manage Google Calendar events, access rules, and schedules through the gws CLI tool. Claude Code CX Codex Cursor +1 61,100installs gws-sheets official googleworkspace This skill lets an agent read and edit Google Sheets through the CLI. Use it when a coding workflow needs spreadsheet data or table updates. Claude Code CX Codex Cursor +1 58,800installs gws-docs official googleworkspace This skill lets an agent read and update Google Docs through gws. Use it when document changes should happen from an agent chat. Claude Code CX Codex Cursor +1 58,300installs gws-sheets-read official googleworkspace Reads cell values and sheets from Google Spreadsheets via CLI. Useful when an agent needs spreadsheet data without risk of altering it. Claude Code CX Codex Cursor +1 50,600installs

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

See also

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor