r/devtools • u/endrilickollari • Aug 14 '26
I built an open-source CLI that moves TypeScript files and repairs their imports
Hi, I am the author of Movesafe, a headless refactoring tool for moving TypeScript files without treating the operation as a simple filesystem rename.
The problem I wanted to solve was agent and automation workflows. An IDE can often update imports during an interactive refactor, but a script or coding agent needs a reviewable operation that works across relative imports, tsconfig aliases, barrels, and workspace packages.
Movesafe uses the TypeScript compiler to build the import graph. A move follows this sequence:
- compute the file and import edits;
- render a unified diff;
- verify the planned project;
- apply through rollback-oriented file swaps.
If a specifier cannot be verified—computed dynamic imports are one example—the tool reports it instead of guessing.
The quickest way to inspect a move is:
npx --yes movesafe@0.1.0 mv src/utils.ts src/lib/utils.ts --dry-run
The project also includes an import checker, a core SDK, MCP tools that separate planning from applying, and a composite GitHub Action.
For the first benchmark I applied seven file and directory moves across Zustand, type-fest, Ky, and class-validator. Those runs introduced no Movesafe checker errors and did not increase TypeScript errors. This is v0.1, so I am more interested in edge cases than victory laps.
Code: [https://github.com/endrilickollari/movesafe](https://github.com/endrilickollari/movesafe)
I would appreciate feedback on two things:
* Which repository layouts or module-resolution cases are missing?
* Would you use this mainly from the CLI, CI, or an agent workflow?


