بِسْمِ ٱللَّهِ ٱلرَّحْمَـٰنِ ٱلرَّحِيمِ
AI refac
Move files and folders and rename symbols with every reference updated. A language-aware CLI for TypeScript, Kotlin, Python, Go, Rust, Dart, and Markdown.
Pre-alpha
refac is built for personal use and is not finished. Commands, output, and behavior change whenever the author needs them to, and there is no guarantee that the project keeps being worked on.
refac moves files and folders, renames symbols, and updates every reference that points at them: imports, module declarations, package lines, Android XML, and Markdown links. After a change your project should inshallah build the way it did before.
It is built for scripted and agent-driven workflows where no IDE is in the loop. A language server is started for one command and stopped when the command ends, so nothing stays running and no memory is held afterwards. These pages will inshallah show you how to use it, language by language.
Languages
TypeScript / JavaScript
Files and folders, with your tsconfig deciding which files are callers. Symbol rename through the TypeScript 7 native language server.
Kotlin / Android
Files and folders to another package, rename with Java callers, and the manifest, layouts, and navigation graphs kept in step. Uses the JetBrains Kotlin language server.
Python
Moves with Rope (Pyrefly as fallback). Rename with basedpyright, overrides included.
Go
gopls. A moved file takes its whole package with it and every importer follows. Symbol rename.
Rust
rust-analyzer. Same-folder file renames, semantic module moves with move-module, and symbol rename.
Dart
The Dart SDK analysis server. Relative and package: imports, and symbol rename.
Markdown
Built in, nothing to install. Files, images, and folders, plus the links to code that other languages moved.
How it stays safe
- Plan first. Nothing is written until the whole change is planned. A rename is also proven in memory: the server is shown the renamed text and must find exactly the same places again, so a name that clashes with or shadows something is refused.
- Undo log. Every write goes through a journal, so a failed step inshallah won't leave half a refactor behind. Every file is put back and the message says so.
- Loud failures. A missing server, an unsupported layout, or an ambiguous symbol stops the command with the reason and the fix. refac does not guess.
- Preview.
--dry-runshows the paths that would move and the edits per file, and changes nothing. The real command will inshallah do what the preview showed.
Where to go next
These pages get you moving.
Installation
Build refac and check which language servers are ready on your machine.
Usage
Move, rename, preview, and do many changes in one call.
Capabilities and limits
What each language supports and where it stops.
Use it with an AI agent
Get the refac skill from GitHub and put it where your agent looks.
About the author
I am Javed Arshad Butt. I built refac while setting up my own development infrastructure, the kind of tool you write because nothing existing fits the workflow you actually have. These docs are everything you need to use it. If you would like to know more about me, javedab.com is the place.