⚠️ All versions have MacOS binaries only: If you want to use nats-cli on other systems, you should to build the binaries manually
- Publishing
- Subscribing
- Templates this is a useful tool for saving your NATS settings, and reuse them with other commands.
Usage:
nats-cli [command]
Available Commands:
help Help about any command
publish Publish to subject
subscribe Subscribe to subject
template Manage templates
Flags:
--config string config file (default is $HOME/.nats-cli.yaml)
-h, --help help for nats-cli
-t, --toggle Help message for toggle
Use "nats-cli [command] --help" for more information about a command.
nats-cli sub -a your-nats-server -c nats-cluster-id -s subject -d 24h
nats-cli pub -a your-nats-server -c nats-cluster-id -s subject -m '{"json":"here"}'
nats-cli template list
nats-cli template create -a your-nats-server -c nats-cluster-id -s subject -n template-name
nats-cli tpl remove -n template-name
nats-cli sub tpl -n your-template-name -d 2h
nats-cli pub tpl -n your-template-name -m '{"json":"here"}'