walwarden-cli
v0.0.1
Published
Customer-side Postgres restore CLI for Walwarden.
Downloads
118
Readme
@walwarden/cli
Customer-side Postgres restore CLI for Walwarden.
What it does
Restores a Postgres database from a backup managed by Walwarden. The CLI receives a one-liner from the Walwarden dashboard and drives the restore against a target database you control. Progress and audit events are reported back to Walwarden in real time.
Usage
The Walwarden dashboard generates the exact command. General form:
WALWARDEN_TOKEN=<token> npx @walwarden/cli restore \
--manifest <sha256> \
--target postgres://user:pass@host:5432/dbname \
--mode new_databaseFor an in-place restore (overwrites the target):
WALWARDEN_TOKEN=<token> npx @walwarden/cli restore \
--manifest <sha256> \
--target postgres://user:pass@host:5432/dbname \
--mode in_place \
--confirm-destructiveFlags
| Flag | Required | Description |
|---|---|---|
| --manifest <sha256> | yes | SHA-256 of the backup manifest (64 hex chars) |
| --target <dsn> | yes | Target Postgres DSN |
| --mode new_database\|in_place | yes | Restore into a fresh database or overwrite existing |
| --confirm-destructive | if in_place | Explicit acknowledgement for destructive restore |
| --json | no | Emit JSONL progress to stdout (auto-enabled when not a TTY) |
| --no-color | no | Disable ANSI color output |
Environment
| Variable | Required | Description |
|---|---|---|
| WALWARDEN_TOKEN | yes | Short-lived restore token from the dashboard |
| WALWARDEN_API_URL | no | Override API base URL (default: https://app.walwarden.com) |
| PGPASSWORD | no | If set and target DSN has no password, merged automatically |
Requirements
Node.js >= 20.
