All skills
googleworkspace avatar

/gws-events-subscribe

@705fb0e
by Google Workspacegoogleworkspace/cli31k stars
1,856

Google Workspace Events: Subscribe to Workspace events and stream them as NDJSON.

Use this Skill: https://skilld.dev/gh/googleworkspace/cli/gws-events-subscribe

This session only. Nothing lands on disk.

SKILL.md

β‰ˆ26 tokens always: the name and description. β‰ˆ448 when used: this file.

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

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

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

Source: SKILL.md on GitHub

1 warning16d5 checks Β· Risk SAFE
  • Gen Agent Trust Hub16d

    This skill provides a secure interface for subscribing to Google Workspace events using the gws CLI tool. It follows security best practices by referencing centralized auth/security rules and including safety warnings for state-changing commands.

  • Socket16d

    No alerts

  • Snyk16d

    Risk: MEDIUM Β· 1 issue

  • Runlayer6mo

    1/1 file flagged

  • ZeroLeaks5mo

    Score: 93/100 Β· 2 sections analyzed

Signed by skilld at 705fb0e. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 months ago.

Activeupdated 6 months ago
Other metadata
metadata
{
  "version": "0.22.5",
  "openclaw": {
    "category": "productivity",
    "requires": {
      "bins": [
        "gws"
      ]
    },
    "cliHelp": "gws events +subscribe --help"
  }
}
  • CLI
  • google-workspace
  • events
  • pubsub
  • streaming
  • ndjson
  • chat
  • gcp

README badge

README badge for googleworkspace/cli/gws-events-subscribe

Subscribes to Google Workspace events via the Google Workspace CLI, streaming events as NDJSON through Pub/Sub. Targets Chat spaces, Drive resources, and other Workspace APIs with configurable polling and batch sizes.

Generated from the current SKILL.md.

What Google Workspace resources can I subscribe to?
You specify resources via the --target flag using Workspace resource URIs (e.g., //chat.googleapis.com/spaces/SPACE_ID). The skill supports any resource exposed through Google Workspace Events API.
Do I need to set up Pub/Sub manually?
No. The skill creates Pub/Sub topic and subscription automatically unless you provide an existing subscription name via --subscription. Use --cleanup to delete created resources on exit.
What authentication is required?
You must configure auth and credentials as documented in the gws-shared skill, which handles all global authentication and security rules for the gws CLI.
Can I save events to files instead of streaming them?
Yes. Use the --output-dir flag to write each event to a separate JSON file in the specified directory instead of streaming to stdout.
What happens if I don't use --cleanup?
Pub/Sub resources persist after the command exits, allowing you to reconnect without recreating infrastructure. You must manually clean them up if no longer needed.

Generated from the current SKILL.md. These answers refresh after source changes.