NATS / NATS streaming command line utility for publishing and subscribing to messages.
go get -u github.com/anjmao/cnats
Download release binary from https://github.com/anjmao/cnat/releases and add to PATH.
Initialize with cluser, client and url.
cnats init -cluster test-cluster -client cnat-client -url nats://localhost:4222
Initialize with default values.
cnats init
Subscribe to nats streaming subjects.
cnats ssub topic1 topic2
Subscribe to all known subjects. Internally sub command calls stan monitoring api to get all known subjects.
cnats ssub
Subscribe at given time.
cnats ssub topic1 -at_time="2020-08-20T11:20:22.9832464Z"
Subscribe at given sequence.
cnats ssub topic1 -at_seq=0
Subscribe to nats subjects.
cnats sub topic1 topic2
Publish to nats streaming.
cnats spub topic1 '{"name": "cnat"}'
Publish to nats.
cnats pub topic1 '{"name": "cnat"}'
Before running make release
make sure you have these tools installed.
GO111MODULE=off go get github.com/c4milo/github-release
GO111MODULE=off go get github.com/mitchellh/gox