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/doctorshow facts fast.- Windows service support avoids venv breakage (fixed path option).
- Bootstrap mode: auto-generate config from
--clusterorbootstrap.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
- File passed by
--config nats-config.jsonin the working directory~/.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
- CLI
--nats-server-path - Config
nats_server_path - Env
NATS_SERVER_PATH(compat:NATS_SERVER_BIN) nats-server-bin(extras:server)nats-serverin 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) --seedcan behostonly; it uses--cluster-port(default 6222)- Optional:
--cluster-port,--client-port,--http-port,--listen(hostorhost: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_envstores only the environment variable name, not the secret value.--bootstrap-configcannot be combined with--nats-configor 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
Release files for nats-bootstrap 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| nats_bootstrap-0.1.0.tar.gz | 21.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| nats_bootstrap-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 40.9 kB
Release files / nats_bootstrap-0.1.0.tar.gz
| Download URL | nats_bootstrap-0.1.0.tar.gz |
|---|---|
| Size | 21.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d934be52c9fa73157f34d6577304cbb89ffe6fa79bb7d4244efed31ab95f71b2
|
|
BLAKE2b-256 checksum How to use checksums |
9ab5f81d2f9da46f2f8915783616ce6b1b587b19a998c2c63e22a44c3caec55d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.5
|
Release files / nats_bootstrap-0.1.0-py3-none-any.whl
| Download URL | nats_bootstrap-0.1.0-py3-none-any.whl |
|---|---|
| Size | 19.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1432222c80e2d50785d5ae7a6332d604971235220809170a697a878107ef16a0
|
|
BLAKE2b-256 checksum How to use checksums |
b373d6b09ffef86412c539532faacb2e687e182b75b37e88c7d47c38611adcf5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.5
|