google-pubsub-cli
v2.0.0
Published
Publish to Google Cloud Pub/Sub topics and read from subscriptions.
Downloads
7
Maintainers
Readme
google-pubsub-cli
Publish to Google Cloud Pub/Sub topics and read from subscriptions. Like gcloud pubsub topics publish
& gcloud pubsub subscriptions pull
, but
- works with the Pub/Sub emulator via the
PUBSUB_EMULATOR_HOST
environment variable, - supports taking messages line-wise via
stdin
.
Installing
npm install -g google-pubsub-cli
Or use npx
. ✨
Usage
Usage:
echo 'a new message' | publish-to-pubsub-topic <topic>
Options:
--project -p The Google Cloud Project ID.
--encoding -e Encoding to encode the message payload with. Default: utf-8
Usage:
read-from-pubsub-subscription <subscription>
Options:
--format -f How to format the messages. json, raw, inspect (default)
--ack -a Acknowledge the messages received.
--encoding -e Encoding to decode the message payload with. Default: utf-8
--metadata -m Print the message payload along its metadata.
Usage:
create-pubsub-topic <topic>
Usage:
create-pubsub-subscription <topic> <subscription>
Contributing
If you have a question or have difficulties using google-pubsub-cli
, please double-check your code and setup first. If you think you have found a bug or want to propose a feature, refer to the issues page.