CLICommands
pubsub
snug pubsub <COMMAND>Pub/Sub operations.
Subcommands
| Command | What it does |
|---|---|
publish | Publish a message to a channel |
publish-batch | Publish one message to many channels in a single call |
channels | List channels that currently have active subscribers |
info | Show subscriber count for a channel (Redis PUBSUB NUMSUB total) |
stats | Show the Redis vs WebSocket subscriber breakdown for a channel |
debug | Show a pub/sub system-state snapshot (Redis + WebSocket connections) |
listen | Listen to messages on a channel until interrupted |
token | Mint a short-lived pub/sub capability token for the current principal |
grant | Grant a capability on a resource to another principal |
grants | List capability grants you have issued or received |
revoke | Revoke a single grant by id |
revoke-all | Revoke every grant you have made to a grantee |
claim-room | Claim a shared room (room.{name}) first-come for the current principal |
Run snug pubsub <command> --help for that command's own options.
The global options apply everywhere.
Examples
snug pubsub publish -c alerts.system -p '{"severity":"warning","msg":"High CPU"}'
snug pubsub publish -c alerts.system -p '{"msg":"hi"}' -t trace-12345
snug pubsub publish-batch -c alerts.system -c audit.log -p '{"event":"deploy"}'
snug pubsub channels
snug pubsub info alerts.system
snug pubsub stats alerts.system
snug pubsub debug
snug pubsub listen --channel alerts.system
snug pubsub listen --channel alerts.system --raw | jq .payload
snug pubsub token
snug pubsub claim-room lobby
snug pubsub grant -r room.lobby -g bob -o subscribe -o publish
snug pubsub grants --direction received
snug pubsub revoke <grant_id>
snug pubsub revoke-all --grantee bobNext
- pubsub guide - what the service does and when to reach for it.
- API reference - every endpoint these commands call.
- CLI reference - global options, output modes, and exit codes.