Index of every page on this site: llms.txt
All skills
googleworkspace avatar

/gws-events-subscribe

@cd3697e
by Google Workspacegoogleworkspace/cli32k stars
1,997
Run it yourself

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

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

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈26 tokens for metadata: the name and description. ≈448 when used: this file.

Description uses 1.3% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈104 characters, or 1.3%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

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

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

1 warning2mo5 checks · Risk SAFE
  • Gen Agent Trust Hub2mo

    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.

  • Socket2mo

    No alerts

  • Snyk2mo

    Risk: MEDIUM · 1 issue

  • Runlayer8mo

    1/1 file flagged

  • ZeroLeaks7mo

    Score: 93/100 · 2 sections analyzed

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

Last checked against GitHub 3 weeks ago.

Activeupdated 8 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.