CLI commands

Operator commands shipped under the blamejs binary (bin/blamejs.js, dispatched through b.cli.main). Each subcommand is harvested directly from lib/cli.js so the page stays in lock-step with the dispatcher.

Commands harvested: 17. Run blamejs help <command> for the authoritative live usage. Generated 2026-08-08T16:39:16.007Z.

Command index

Database

Data lifecycle

Audit chain

Crypto & keys

Security tooling

Developer workflow

blamejs migrate

Manage database migrations (up / down / status)

Usage: blamejs migrate <subcommand> [flags]

Subcommands

SubcommandDescription
upApply all pending migrations
downRoll back the most-recent applied migration
statusPrint applied + pending migrations

Flags

FlagDescription
--db <path>Path to the SQLite database file (required)
--dir <path>Path to migrations directory (default ./migrations)
--steps <N>For down: number of migrations to revert (default 1)

Example

blamejs migrate up --db <path>

Source: lib/cli.js

blamejs seed

Apply seed-data fixtures by env (run / status)

Usage: blamejs seed <subcommand> [flags]

Subcommands

SubcommandDescription
runApply pending seeds for the given env
statusPrint applied + pending seeds for the given env

Flags

FlagDescription
--db <path>Path to the SQLite database file [required]
--env <name>Environment to seed (dev / test / prod / ...) [required]
--dir <path>Path to seeders directory (default ./seeders)
--only <name>Apply just one seed by filename (run subcommand only)
--forceRe-apply already-applied seeds (operator-explicit)

Example

blamejs seed run --db <path>

Source: lib/cli.js

blamejs backup

Inspect / verify / extract a backup bundle from disk

Usage: blamejs backup <subcommand> [flags]

Subcommands

SubcommandDescription
inspectRead a bundle's manifest without decrypting and
verifyDecrypt + verify the bundle in a temp directory,
extractDecrypt + verify into the target staging directory.

Flags

FlagDescription
--bundle <dir>Path to a bundle directory (must contain manifest.json)
--to <stagingDir>For extract — fresh directory to decrypt into (must not exist)
--passphrase <string>Backup passphrase (or env BLAMEJS_BACKUP_PASSPHRASE)

Example

blamejs backup inspect --bundle <dir>

Source: lib/cli.js

blamejs erase

Cryptographically erase a single row's sealed columns (GDPR Art. 17)

Cryptographic-erasure of a single row. The right tool for one-off GDPR Art. 17 / right-to-erasure flows that don't fit the periodic retention sweep. Replaces every sealed column + derived hash with NULL, sets __erasedAt, and writes the row back. Cleartext is unrecoverable even with the vault key.

Usage: blamejs erase --table <table> --row-id <id> [flags]

Flags

FlagDescription
--data-dir <path>Required
--table <name>Required — the table containing the row
--row-id <id>Required — the _id of the row to erase
--vault-mode <mode>plaintext | wrapped (default wrapped)
--reason <text>Reason recorded on the audit row (recommended)
--confirmRequired — confirms the erase is intentional

Example

blamejs erase --table <table> --row-id <id>

Source: lib/cli.js

blamejs restore

Live in-place restore from a bundle (list / inspect / apply / rollback / list-rollbacks)

Operator workflow on top of b.restore: list bundles in storage, inspect a specific one, do a live in-place restore (with rollback preservation), and roll back to a previous restore point. Wraps the restore primitive's run / inspect / list / rollback / list-rollbacks surface; uses b.backup.diskStorage as the storage adapter (the same adapter that wrote the bundles).

Usage: blamejs restore <subcommand> [flags]

Subcommands

SubcommandDescription
listList bundles available in storage
inspectRead a bundle manifest summary (no live changes)
applyLive in-place restore with rollback preserved
rollbackRevert the most-recent (or named) restore
list-rollbacksList preserved rollback points

Common flags

FlagDescription
--data-dir <path>Live data directory (apply / rollback / list-rollbacks)
--storage-root <path>Directory containing bundle subdirs (list)
--bundle <dir>Extracted bundle directory (inspect / apply)
--bundle-id <id>Alternative: pass id with --storage-root
--passphrase <string>Bundle passphrase (or env BLAMEJS_BACKUP_PASSPHRASE)

apply flags

FlagDescription
--no-auditSuppress audit emission (default ON)

rollback flags

FlagDescription
--rollback <pathOrId>Specific rollback point to restore (default: most recent)

Exit codes

Example

blamejs restore list --data-dir <path>

Source: lib/cli.js

blamejs retention

Run / preview an ad-hoc b.retention rule

Run / preview an ad-hoc retention rule from the CLI. Operators supply the rule shape on the command line — table + ageField + ttlMs + action — for one-off cleanups outside the scheduler- driven sweep wired in lib code.

Usage: blamejs retention <subcommand> [flags]

Subcommands

SubcommandDescription
previewDry-run: report what WOULD be processed without acting
runRun the rule once (acts on the rows it finds)

Example

blamejs retention preview

Source: lib/cli.js

blamejs audit

Operator tooling on top of the audit chain (archive / export / verify / purge)

Operator tooling on top of the audit chain. Programmatic API is at b.auditTools — the CLI is a thin wrapper that's easier to script against from operator runbooks (cron, retention pipelines, etc.).

Usage: blamejs audit <subcommand> [flags]

Subcommands

SubcommandDescription
archiveBundle audit rows older than --before into a verified archive
exportAuditor evidence bundle for a date range
verify-bundleRound-trip integrity check on an archive or export bundle
verify-chainWalk the live audit chain end-to-end; reports tampering
purgeDelete live rows already captured in a verified archive

Common flags

FlagDescription
--out <path>Output bundle directory (must NOT exist)
--in <path>Input bundle directory (verify-bundle, purge)
--passphrase <string>Bundle passphrase (or env BLAMEJS_AUDIT_PASSPHRASE)

archive flags

FlagDescription
--before <date>Archive rows with recordedAt < this date (ISO-8601 or epoch ms)

export flags

FlagDescription
--from <date>Earliest recordedAt (inclusive)
--to <date>Latest recordedAt (inclusive)
--action <name>Restrict to a single audit action

verify-chain flags

FlagDescription
--db <path>SQLite database path (required)
--table <name>Audit table name (default audit_log)
--max-rows <N>Stop after walking N rows (default: walk all)

purge flags

FlagDescription
--confirmREQUIRED — operator acknowledgement of destructive op

Exit codes

Example

blamejs audit archive --before <date>

Source: lib/cli.js

blamejs api-key

Issue / revoke / list / rotate / verify API keys for a namespace

Usage: blamejs api-key <subcommand> [flags]

Subcommands

SubcommandDescription
issueIssue a new API key under a namespace. Prints the
revokeRevoke an issued key by its composite id (namespace:idHex).
listList active keys for a given owner under a namespace.
rotateIssue a new secret for an existing id while leaving the
verifyVerify a token string and print the resolved metadata.

Example

blamejs api-key issue

Source: lib/cli.js

blamejs mtls

Inspect or generate the in-box mTLS CA + leaf certs (status / show-cert / init / issue / issue-p12)

Usage: blamejs mtls <subcommand> [flags]

Subcommands

SubcommandDescription
statusPrint CA state — exists / generation / sealed-mode.
show-certPrint the CA certificate PEM to stdout. Operators
initGenerate a fresh CA keypair + self-signed cert and
issueIssue a leaf client certificate signed by the CA.
issue-p12Issue + package as PKCS#12 with --password. Useful for

Flags

FlagDescription
--data-dir <path>Path to the app's data dir (required)
--vault-mode <mode>plaintext | wrapped (default wrapped). When wrapped,
--sealed-mode <mode>auto | required | disabled (default auto). 'required'

Example

blamejs mtls status --data-dir <path>

Source: lib/cli.js

blamejs password

Test b.auth.password.policy against a candidate plaintext

Test b.auth.password.policy from the CLI without rebooting the app. Useful for ops dashboards that want to surface "your policy requires X" or for CI checks of operator-supplied passwords.

Usage: blamejs password check [flags]

Flags

FlagDescription
--plaintext <s>REQUIRED — the plaintext to test (or use stdin)
--stdinRead the plaintext from stdin (newline-trimmed)
--profile <name>Named profile: nist-aal2 | pci-4.0 | hipaa-aal2
--min-length <n>Override the profile minLength
--max-length <n>Override the profile maxLength
--breach-checkEnable HaveIBeenPwned k-anonymity check (NETWORK)
--fail-closedWith --breach-check: HIBP outage → fail (default ok)
--email <addr>Context for the deny-context-substrings check
--username <name>Context for the deny-context-substrings check
--jsonPrint machine-readable JSON

Example

blamejs password check

Source: lib/cli.js

blamejs vault

Seal / unseal / rotate the on-disk vault keypair (plaintext ↔ wrapped)

Usage: blamejs vault <subcommand> [flags]

Subcommands

SubcommandDescription
statusReport whether vault.key (plaintext) and/or
sealWrap a plaintext vault.key into a passphrase-
unsealReverse — write a plaintext vault.key from a
rotateRe-wrap a sealed vault.key.sealed under a new

Flags

FlagDescription
--data-dir <path>Path to the app's data dir (default ./data)
--passphrase <string>Passphrase to wrap with (or env
--new-passphrase <s>Rotate-only — the NEW passphrase to re-wrap
--keep-plaintextFor `seal` — retain the plaintext vault.key

Example

blamejs vault status --data-dir <path>

Source: lib/cli.js

blamejs config-drift

Inspect / verify the b.configDrift signed sidecar

Inspect / verify the b.configDrift sidecar without rebooting. The sidecar is signed with the audit-signing key, so we boot the framework to access it. `inspect` prints the full snapshot; `verify` only reports the verified flag (exit 0 = signed + untampered, exit 1 = tampered or missing).

Usage: blamejs config-drift <subcommand> [flags]

Subcommands

SubcommandDescription
inspectPrint the sidecar's snapshot + capturedAt + verified flag
verifyVerify the sidecar's signature (exit code reflects status)

Flags

FlagDescription
--data-dir <path>Required (sidecar location)
--baseline <name>Multi-baseline name (default: "default")
--vault-mode <mode>plaintext | wrapped (default wrapped)
--jsoninspect: print machine-readable JSON

Example

blamejs config-drift inspect --data-dir <path>

Source: lib/cli.js

blamejs file-type

Magic-byte content classification (b.fileType.detect)

Pure utility — magic-byte content classification. No framework boot. Useful for upload debugging ("the user said this was a PDF but is it really?") and as a CI-side sanity check.

Usage: blamejs file-type detect <file> [flags]

Flags

FlagDescription
--jsonPrint machine-readable JSON
--allowlist <list>Comma-separated mime / category list — exits 1

Example

blamejs file-type detect <file>

Source: lib/cli.js

blamejs security

Run b.security.assertProduction against the live framework

Runs b.security.assertProduction against the live framework. Useful out-of-band: ops can re-check posture without rebooting the app. Boots the framework so resolvers see the actual vault / db / audit- signing modes; reports pass / fail with the failure-code list.

Usage: blamejs security <subcommand> [flags]

Subcommands

SubcommandDescription
assertRun b.security.assertProduction against the framework's

Flags

FlagDescription
--data-dir <path>Required for `assert` (the boot dir)
--vault-mode <mode>plaintext | wrapped (default wrapped)
--no-ntp-strictSkip the BLAMEJS_NTP_STRICT check
--require-env <KEY,KEY,...>Comma-separated env vars that MUST be set
--forbid-env <KEY,KEY,...>Comma-separated env vars that must NOT be set
--no-vaultSkip vault posture check
--no-db-at-restSkip dbAtRest posture check
--no-audit-signingSkip auditSigning posture check

Example

blamejs security assert --data-dir <path>

Source: lib/cli.js

blamejs api-snapshot

Capture / compare the public API surface (CI gate)

Usage: blamejs api-snapshot <subcommand> [flags]

Subcommands

SubcommandDescription
captureWalk the framework's public surface and write a snapshot
compareDiff the current surface against a saved snapshot

Flags

FlagDescription
--file <path>Snapshot file path (default ./api-snapshot.json)
--module <path>Module to inspect (default require('@blamejs/core'))

Exit codes

Example

blamejs api-snapshot capture --file <path>

Source: lib/cli.js

blamejs dev

Run an app with file-watch + auto-restart

Usage: blamejs dev --command <cmd> [args] [flags]

Flags

FlagDescription
--command <cmd>Program to spawn (e.g. node) [required]
--arg <value>Argument for the spawned program (repeatable)
--watch <dir>Directory to watch (repeatable; default '.')
--ignore <pattern>Glob/regex fragment to ignore (repeatable)
--grace-ms <N>Debounce window in ms (default 250)
--kill-signal <S>Signal to send on restart (default SIGTERM)

Example

blamejs dev --command <cmd> [args]

Source: lib/cli.js

blamejs version

Print framework version

Usage: blamejs version

Example

blamejs version

Source: lib/cli.js

Live help

This page is a build-time snapshot. The authoritative source is blamejs help <command> (or blamejs <command> --help) — both render the same USAGE constants this harvester reads.

Last updated 2026-08-08T16:39:49.652Z by seeder.