Looking for automated tools to intelligently rename files in TypeScript codebase

I’m working on a large TypeScript project and need to rename multiple files while keeping all references updated automatically. Instead of manually going through each file or asking AI to handle everything at once, I want to use a dedicated npm package or command line utility that can do this properly.

I’m thinking something similar to how VS Code handles renaming - where it updates imports, exports, and references across the entire project. Does anyone know of reliable tools or packages that can handle this kind of smart file renaming? I want something that feels solid and won’t break my project structure.

Any recommendations would be helpful. I prefer using specialized tools rather than having AI process tons of files directly.

The TypeScript compiler has some refactoring built-in with tsc --build, but for file renaming specifically, I’d go with ts-rename. It’s made for exactly this and automatically updates all your cross-references. I’ve used it on several medium projects - worked perfectly, no broken imports. You could also try @typescript-eslint/parser with custom scripts, but that’s more manual work. If you’re in VS Code already, there are community extensions that batch rename files using the same language service - way easier than doing it by hand.

honestly, vs code’s rename feature is the easiest way. just right-click and choose ‘rename’ or hit F2, itll update the imports. if u need cli, check out ts-refactor – it’s good for bulk renaming without messing things up.

I use TypeScript Language Server for this all the time. VS Code works great like you said, but you can also do it through command line tools. The typescript-language-server package plus ts-morph gives you programmatic access to the same refactoring features. I’ve written simple Node.js scripts with ts-morph to batch rename files - it keeps all the import/export relationships intact since it uses the actual TypeScript compiler API. Another option is jscodeshift with TypeScript transforms, though that needs more setup. Both work reliably on huge codebases without breaking anything.