← Pub/Sub220 / 640
hardgcloud

Publish a message string to a Pub/Sub topic from the command line

command

gcloud pubsub topics publish TOPIC_NAME --message MESSAGE

also accepted

gcloud pubsub topics publish

Command breakdown

Part of the Google Cloud CLI (gcloud) — Pub/Sub category.

gcloudpubsubtopicspublishTOPIC_NAME--messageMESSAGE
FlagPurpose
--messageBoolean flag

Test your recall — not just your reading.

Practice with interactive quiz →