walwarden-cli
Advanced tools
+7
-2
| { | ||
| "name": "walwarden-cli", | ||
| "version": "0.0.2", | ||
| "version": "0.1.0", | ||
| "type": "module", | ||
@@ -14,4 +14,9 @@ "main": "dist/index.js", | ||
| "scripts": { | ||
| "build": "node esbuild.config.mjs" | ||
| "build": "node esbuild.config.mjs", | ||
| "prepack": "npm run build", | ||
| "verify:pack": "npm pack --dry-run" | ||
| }, | ||
| "dependencies": { | ||
| "@walwarden/sdk": "0.1.0" | ||
| }, | ||
| "devDependencies": { | ||
@@ -18,0 +23,0 @@ "@walwarden/core": "*" |
+64
-9
@@ -1,18 +0,71 @@ | ||
| # @walwarden/cli | ||
| # walwarden-cli | ||
| Customer-side Postgres restore CLI for Walwarden. | ||
| Customer-side CLI for Walwarden. Published on npm as `walwarden-cli`; the | ||
| installed binary is `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. | ||
| The CLI has two isolated command surfaces: | ||
| - Public SDK-backed commands for API-key automation, CI, and agents. | ||
| - Legacy restore-token commands generated by the Walwarden dashboard for | ||
| customer-side restore execution. | ||
| ## Usage | ||
| ### Public SDK-backed commands | ||
| Public commands call `@walwarden/sdk` and require an API base URL plus API key. | ||
| Configuration precedence: | ||
| 1. Flags: `--api-url`, `--api-key`, `--profile`, `--config` | ||
| 2. Environment: `WALWARDEN_BASE_URL`, `WALWARDEN_API_KEY` | ||
| 3. Legacy environment alias: `WALWARDEN_API_URL` | ||
| 4. Profile config: `~/.config/walwarden/config.json` | ||
| Examples: | ||
| ``` | ||
| walwarden --json --api-url https://api.example.com --api-key wal_... profile validate | ||
| walwarden --json database list --limit 25 | ||
| walwarden --json database get <databaseId> | ||
| walwarden --json backup list --database <databaseId> --limit 25 | ||
| walwarden --json backup trigger --database <databaseId> --wait | ||
| walwarden --json backup status <backupJobId> | ||
| walwarden --json evidence list --database <databaseId> --limit 25 | ||
| walwarden --json evidence get <backupJobId> | ||
| walwarden --json restore status <restoreJobId> | ||
| walwarden --json explain-error --from-json ./error.json | ||
| ``` | ||
| Supported alpha public commands: | ||
| | Command | Description | | ||
| |---|---| | ||
| | `profile validate` | Validates local config/API-key wiring against the SDK compatibility profile | | ||
| | `database list [--limit 1..100] [--cursor <opaque>]` | Emits one protected-database page | | ||
| | `database get <databaseId>` | Reads one protected database | | ||
| | `backup list --database <databaseId> [--limit 1..100] [--cursor <opaque>]` | Emits one backup-job page | | ||
| | `backup trigger --database <databaseId> [--wait]` | Triggers an ad hoc backup and optionally polls status | | ||
| | `backup status <backupJobId>` | Reads backup job status | | ||
| | `evidence list [--database <databaseId>] [--limit 1..100] [--cursor <opaque>]` | Emits one evidence page | | ||
| | `evidence get <backupJobId>` | Reads public evidence detail for one backup job | | ||
| | `restore status <restoreJobId>` | Reads restore job status | | ||
| | `explain-error --from-json <file>` | Explains a structured API/CLI error object | | ||
| Current non-goals for the public command surface: destination commands, restore | ||
| creation/wait, login/whoami, and offline evidence bundle verification. | ||
| List commands never auto-drain. Their JSON result includes `pageInfo`; pass its | ||
| opaque `nextCursor` back with `--cursor` to request the next page. This is an | ||
| additive alpha wire change, but older CLI versions silently consume only page | ||
| one and should be upgraded. | ||
| ### Legacy restore-token command | ||
| The Walwarden dashboard generates the exact command. General form: | ||
| ``` | ||
| WALWARDEN_TOKEN=<token> npx @walwarden/cli restore \ | ||
| WALWARDEN_TOKEN=<token> npx --yes walwarden-cli restore \ | ||
| --manifest <sha256> \ | ||
@@ -26,3 +79,3 @@ --target postgres://user:pass@host:5432/dbname \ | ||
| ``` | ||
| WALWARDEN_TOKEN=<token> npx @walwarden/cli restore \ | ||
| WALWARDEN_TOKEN=<token> npx --yes walwarden-cli restore \ | ||
| --manifest <sha256> \ | ||
@@ -45,2 +98,4 @@ --target postgres://user:pass@host:5432/dbname \ | ||
| `walwarden --version` (or `-v`) prints the installed CLI version and exits. | ||
| ## Environment | ||
@@ -51,3 +106,3 @@ | ||
| | `WALWARDEN_TOKEN` | yes | Short-lived restore token from the dashboard | | ||
| | `WALWARDEN_API_URL` | yes | API base URL for the deployed Walwarden environment | | ||
| | `WALWARDEN_API_URL` | no | Override API base URL (default `https://api.walwarden.com`) | | ||
| | `PGPASSWORD` | no | If set and target DSN has no password, merged automatically | | ||
@@ -54,0 +109,0 @@ |
Sorry, the diff of this file is too big to display
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 2 instances
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
651294
1781.65%17288
1691.5%110
100%1
Infinity%9
200%8
60%+ Added
+ Added