The vault. Must allow writes.
from and to are vault-relative paths (with or without
.md). dry_run defaults to false — when true, returns the plan
without writing. overwrite defaults to false — when true, allows
replacing an existing destination.
A RenameNoteResult with per-file rewrites and totals.
Atomic note rename with cross-vault backlink rewrite.
Closes the longstanding "renaming breaks all backlinks" pain point. Walks every note, finds wikilinks / embeds whose
findBestMatchresolves to the source file, rewrites only those literals (preserving|alias,#section,^block, and the user's path-qualification convention), then atomically moves the file.dry_runreturns the same plan without touching disk.Self-references inside the renamed file are also rewritten in the same pass — the file ships with no broken self-links. v3.7.13 M1 — write order is recoverable: (1) rewrite source content at OLD path → (2)
fs.renameOLD → NEW (atomic, runs FIRST so a failure here doesn't leave updated backlinks pointing at a phantom target) → (3) rewrite backlink-bearing files (destination already exists on disk). Every failure mode is recoverable by re-running the same call (each step is idempotent on re-input). Pre-v3.7.13 the order was (backlinks → source → rename), which left backlinks rewritten to the NEW name pointing at a phantom destination when the rename step failed. WRITE TOOL — only registered when--enable-writeis passed.