Commands Cheat Sheet

Evaluating engineering tools? Get the comparison in Google Sheets

(Perfect for making buy/build decisions or internal reviews.)

Most-used commands
Your email is safe thing.

Thankyou for your submission

We have sent the cheatsheet on your email!
Oops! Something went wrong while submitting the form.

Connection

nats sub 'subject'
Subscribe to a subject

nats pub 'subject' 'message'
Publish a message to a subject

nats req 'subject' 'message'
Send a request on a subject and wait for reply

nats connect --server='nats://server:port'
Connect to a NATS server

Streaming

nats str sub 'channel'
Subscribe to a streaming channel

nats str pub 'channel' 'message'
Publish to a streaming channel

nats str info
Get information about the NATS Streaming server

Server Administration

nats server info
Get information about the NATS server

nats server report
Generate server report

nats server ping
Ping the NATS server

nats server start
Start a NATS server (with nats-server binary)

Monitoring

nats account info
View account information

nats account report
Generate account report

nats server route
Display route information

nats server connections
Display connection information

JetStream

nats js publish 'stream.subject' 'message'
Publish to a JetStream stream

nats js subscribe 'stream.subject'
Subscribe to a JetStream stream

nats js stream ls
List all streams

nats js stream info 'stream'
Get information about a stream

nats js stream add 'stream'
Add a new stream

nats js consumer ls 'stream'
List consumers for a stream

nats js consumer info 'stream' 'consumer'
Get info about a consumer