Using the NATS CLI
The NATS CLI (nats) is the official NATS tool for managing your NATS resources. It allows you to simply create and manage your streams, consumers and more.
Check out the official NATS CLI documentation for installation instructions, examples and more.
This page shows you how to get started with some basic actions via the NATS CLI.
Before you start
To complete the actions presented below, you must have:
- A Scaleway account logged into the console
- Owner status or IAM permissions allowing you to perform actions in the intended Organization
- A Scaleway NATS account
- NATS credentials downloaded to your machine
Installing the NATS CLI
Follow instructions from the official NATS documentation. The installation process may differ depending on your operating system.
Define a context
To simplify your interactions with NATS hosted on Scaleway, we recommend that you use contexts. A context is a named configuration that stores the settings (such as credentials, URLs and certificates) required to connect to NATS. By creating a context, you will not need to specify your server and credentials with each new request.
Create a context
The example below creates a context named scaleway.
- Replace
{Scaleway NATS URL}with the URL of your NATS account (find this in the console on your NATS account Overview tab). - Replace
{path to your creds file}with the path to the location where you downloaded your.credsfile.
nats context save scaleway --server