Skip to main content

Super simple CLI to bootstrap and manage NATS clusters.

Project description

nats-bootstrap 🌟

Bootstraps NATS clusters with almost zero config.
Start one node, add others with --seed, and use the same commands on every machine.

A CLI/library to run NATS (JetStream/KV) clusters with the same commands everywhere. The real value is Day‑2 ops (join/leave/backup/restore/service) made safe and repeatable.

日本語 README: README_ja.md


What is it?

  • Same commands on any machine; no per-node differences.
  • status / doctor show facts fast.
  • Windows service support avoids venv breakage (fixed path option).
  • Bootstrap mode: auto-generate config from --cluster or bootstrap.yaml.

Install

uv pip install nats-bootstrap

Include nats-server binary:

uv pip install "nats-bootstrap[server]"

Note: nats CLI is required for backup/restore. Install guide: docs/nats_cli_install.md Note: nats.exe (CLI) is not the server. The server binary is nats-server.exe.

Config types

File / option Read by Purpose
nats-config.json / --config nats-bootstrap Tool config, such as nats_server_path
bootstrap.yaml / --bootstrap-config nats-bootstrap Input used to generate NATS config
<datafolder>\nats-bootstrap.conf nats-server Auto-generated raw NATS config
--nats-config <path> nats-server User-managed raw NATS config

nats-config.json and bootstrap.yaml are not raw NATS server config files.

nats-bootstrap config priority

  1. File passed by --config
  2. nats-config.json in the working directory
  3. ~/.nats-bootstrap/nats-config.json

Quick usage

nats-bootstrap status
nats-bootstrap doctor
nats-bootstrap up --cluster demo
nats-bootstrap join --cluster demo --seed pc-a:6222
nats-bootstrap up --bootstrap-config bootstrap.yaml

Binary resolution order

  1. CLI --nats-server-path
  2. Config nats_server_path
  3. Env NATS_SERVER_PATH (compat: NATS_SERVER_BIN)
  4. nats-server-bin (extras: server)
  5. nats-server in PATH

Bootstrap mode (no config file)

--cluster auto-generates a config file for you.

nats-bootstrap up --cluster demo --datafolder C:\nats\data
nats-bootstrap join --cluster demo --seed pc-a:6222 --datafolder C:\nats\data
  • Default --datafolder: .\nats-bootstrap-data
  • Generated config: <datafolder>\nats-bootstrap.conf
  • If you want to manage config yourself, use --nats-config (cannot be combined with --cluster)
  • --seed can be host only; it uses --cluster-port (default 6222)
  • Optional: --cluster-port, --client-port, --http-port, --listen (host or host:port)

Use bootstrap.yaml when you also want accounts and advertise settings:

cluster: demo
datafolder: /data/nats
client_port: 4222
http_port: 8222
cluster_port: 6222

system_account:
  name: SYS
  user: sys
  password_env: NATS_SYS_PASSWORD

app_account:
  name: APP
  user: app
  password_env: NATS_APP_PASSWORD

advertise:
  client: null
  cluster: null
nats-bootstrap up --bootstrap-config bootstrap.yaml
nats-bootstrap join --bootstrap-config bootstrap.yaml --seed pc-a:6222
  • password_env stores only the environment variable name, not the secret value.
  • --bootstrap-config cannot be combined with --nats-config or manual bootstrap options such as --cluster.

controller (MVP)

nats-bootstrap controller start --listen 127.0.0.1:8222 --nats-url nats://127.0.0.1:4222 --sys-creds C:\path\sys.creds
nats-bootstrap leave --controller http://127.0.0.1:8222 --server-name node-1 --nats-url nats://127.0.0.1:4222 --confirm

Windows service (MVP)

Default is no copy (use resolved nats-server.exe). Use --bin-dir to copy to a fixed path. Admin privileges are required.

nats-bootstrap service install --service-name nats-bootstrap
nats-bootstrap up --service --service-name nats-bootstrap
nats-bootstrap doctor --service-name nats-bootstrap
nats-bootstrap service uninstall --service-name nats-bootstrap

backup/restore (MVP)

Requires nats CLI in PATH or --nats-cli-path / NATS_CLI_PATH.

nats-bootstrap backup --stream ORDERS --output C:\nats\backup
nats-bootstrap restore --input C:\nats\backup --confirm

Tests

uv pip install pytest
pytest -q

Manuals

  • Japanese: manuals/manual_ja.md
  • English: manuals/manual_en.md

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nats_bootstrap-0.1.0.tar.gz (21.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nats_bootstrap-0.1.0-py3-none-any.whl (19.8 kB view details)

Uploaded Python 3

File details

Details for the file nats_bootstrap-0.1.0.tar.gz.

File metadata

  • Download URL: nats_bootstrap-0.1.0.tar.gz
  • Upload date:
  • Size: 21.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.5

File hashes

Hashes for nats_bootstrap-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d934be52c9fa73157f34d6577304cbb89ffe6fa79bb7d4244efed31ab95f71b2
MD5 59feacbfb76d4449c12dde5e4c414653
BLAKE2b-256 9ab5f81d2f9da46f2f8915783616ce6b1b587b19a998c2c63e22a44c3caec55d

See more details on using hashes here.

File details

Details for the file nats_bootstrap-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: nats_bootstrap-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 19.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.5

File hashes

Hashes for nats_bootstrap-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1432222c80e2d50785d5ae7a6332d604971235220809170a697a878107ef16a0
MD5 f9dc5901465d3c7bcc89d8c55880ac16
BLAKE2b-256 b373d6b09ffef86412c539532faacb2e687e182b75b37e88c7d47c38611adcf5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page