movesafeMove the file. Keep the graph intact.
A headless TypeScript refactoring tool that plans every edit, repairs imports, verifies the result, and only then writes to disk.
A headless TypeScript refactoring tool that plans every edit, repairs imports, verifies the result, and only then writes to disk.
Movesafe requires Node.js 22.13 or newer. You can run the published CLI without adding it to your project:
# See the exact move and import edits. Nothing is written.
npx --yes movesafe@0.1.0 mv src/utils.ts src/lib/utils.ts --dry-run
# Apply the same move.
npx --yes movesafe@0.1.0 mv src/utils.ts src/lib/utils.ts
# Validate the project afterwards.
npx --yes movesafe@0.1.0 check .Movesafe finds the nearest tsconfig.json, builds the project import graph, and resolves specifiers with the TypeScript compiler. Install the target project's dependencies first so package imports can be resolved.
Start with the diff
Use --dry-run in a clean working tree. Review the destination path and every rewritten specifier, then rerun the command without the flag.
| You need to… | Use |
|---|---|
| Preview or apply a file or directory move | movesafe mv |
| Find broken imports and barrel exports | movesafe check |
| Move across workspace packages | Monorepo guide |
| Let an agent plan, review, and apply | MCP guide |
The planner tracks static imports, type imports, re-exports, require() calls, and literal dynamic imports. It handles relative specifiers, tsconfig path aliases, barrels, project references, and workspace package imports.
Computed import specifiers are reported as diagnostics and are never guessed.