A tool for creating NATS account and user access configurations
With Python:
curl -L https://raw.githubusercontent.com/nats-io/nsc/main/install.py | pythonWithout Python and with a more cautious mindset:
curl -LO https://raw.githubusercontent.com/nats-io/nsc/main/install.sh
less install.sh
sh ./install.shWith 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-toolsDirect Download:
Download your platform binary from here.
nsc update will download and install the latest version. If you installed
using Homebrew, brew update will update.
NSC uses go modules. If your project source is in $GOPATH, you must define set
the environment variable GO111MODULE to on.
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 synadia/nats-box:latest
# In case NSC not initialized already:
nats-box:~# nsc init
nats-box:~# chmod -R 1000:1000 /nsc
$ tree -L 2 nsc/
nsc/
├── accounts
│ ├── nats
│ └── nsc.json
└── nkeys
├── creds
└── keys
5 directories, 1 file