Undo & History
Every xnpm run is recorded in a workspace journal under .xnpm/transactions/. If a run goes sideways, undo the exact local changes without guessing what got touched.
xnpm records every file it touches before making changes. Undo restores each file to its exact prior state — no guessing, no diffs to apply manually.
Works for: package.json edits, .gitignore / .npmignore updates, override cleanup, lockfile changes from installs.Every run gets a transaction ID and a readable manifest. You can answer "what did xnpm do?" in seconds — file-by-file diffs, command outputs, and a clear list of what can and cannot be reversed.
If you edited a file after the run, xnpm refuses to overwrite it. You opt in with --force — an explicit choice, not a silent default. Use --dry-run first to see every file that would be restored.
One transaction captures changes across all package roots in a single run: one ID, per-package file snapshots, and consistent undo order that restores packages in the correct reverse-dependency sequence.
Full CLI surface
xnpm historyList recent runs with outcome and undo statusxnpm history --jsonMachine-readable output for CI and scriptsxnpm history --limit NShow the last N runsxnpm show <txid>File-by-file changes and external effectsxnpm show <txid> --diffFull diff view of every changed filexnpm undoUndo the last runxnpm undo --lastExplicit last-run undoxnpm undo <txid>Undo a specific transaction by IDxnpm undo --dry-runPreview what would be restoredxnpm undo --forceOverride hash mismatch check (explicit foot-gun)xnpm install --txForce journaling on a single commandxnpm install --no-txDisable journaling (e.g. in CI)