# Dry run — preview changes without writing
node src/cli.js /path/to/your/project --dry-run
# Apply changes
node src/cli.js /path/to/your/project
# Current directory
node src/cli.js
Output
The CLI:
✅ Lists every file it changes
⚠️ Prints all items needing manual/AI attention with links to docs
Tells you to run npm install after finishing
Running tests
bash
node tests/index.test.js
36 tests, all passing. Coverage includes:
Every hook rename
All connector transforms
Config API changes
Package.json upgrades
False positive prevention (hooks from non-wagmi libraries are never touched)
Full pipeline integration tests
Design principles
Zero false positives. The codemod tracks which hooks are actually imported from wagmi before touching any usage sites. A hook named useContractRead imported from some-other-lib is never renamed.
Detect, don't mangle. For patterns that require understanding control flow or object structure (TanStack Query options, mutation args), we detect and flag them with actionable error messages rather than risk producing incorrect code.
One transform per concern. Each transform file handles exactly one class of change, making them independently testable and easy to audit.
After running
Run npm install to install upgraded dependencies
Address all MANUAL: warnings in the output (these are the ~20% requiring human judgment)
Run your build and test suite
Key manual items:
Replace createClient + configureChains with createConfig + transports
Move TanStack Query options into query: {} on read hooks
Move mutation args from hook call to the returned function call