/nsc

Tool for creating nkey/jwt based configurations

Primary LanguageGoApache License 2.0Apache-2.0

NSC

License Apache 2 ReportCard Build Status GoDoc Coverage Status

A tool for creating NATS account and user access configurations

Install

With Python:

curl -L https://raw.githubusercontent.com/nats-io/nsc/main/install.py | python

Without Python and with a more cautious mindset:

curl -LO https://raw.githubusercontent.com/nats-io/nsc/main/install.sh
less install.sh
sh ./install.sh

With Homebrew:

brew tap nats-io/nats-tools
brew install nats-io/nats-tools/nsc

# to uninstall:
brew uninstall nats-io/nats-tools/nsc
brew untap nats-io/nats-tools

Direct Download:

Download your platform binary from here.

Updates are easy

nsc update will download and install the latest version. If you installed using Homebrew, brew update will update.

Documentation

Documentation is here.

Building

NSC uses go modules. If your project source is in $GOPATH, you must define set the environment variable GO111MODULE to on.

Running with Docker

The NATS team maintains a lightweight Docker image with many of the NATS utilities called nats-box where nsc is included. You can mount a local volume to get nsc accounts, nkeys, and other config back on the host using Docker as follows:

docker run --rm -it -v $(pwd)/nsc:/nsc natsio/nats-box:latest

# In case NSC not initialized already:
nats-box:~# nsc init
nats-box:~# chown -R 1000:1000 /nsc
$ tree -L 2 nsc/
nsc/
 ├── accounts
 │   ├── nats
 │   └── nsc.json
 └── nkeys
    ├── creds
    └── keys

5 directories, 1 file