Enterprise-grade project renaming tool with 98% test coverage, framework agnostic design, and smart case preservation
# One command to rename your entire project across ALL languages & frameworks
refacto --from "OldProject" --to "AwesomeProject"
β Renames in JavaScript, Python, Java, Go, Ruby, PHP, Rust, and more...
β Updates configs, Docker files, CI/CD, documentation...
β Preserves your code style (camelCase, snake_case, kebab-case, etc.)
β Safe with dry-run mode and 98% test coverageA powerful, safe, and intelligent tool for renaming projects across your entire codebase. Works with ANY programming language and ANY framework. Battle-tested with 79 comprehensive tests achieving 98% code coverage.
- Works with ANY language: JavaScript, TypeScript, Python, Java, Go, Rust, C++, Ruby, PHP, and more
- Works with ANY framework: React, Vue, Angular, Django, Rails, Spring, Express, and more
- Works with ANY file type: Source code, configs, docs, CI/CD, Docker, K8s manifests
- Cross-platform: Windows, macOS, Linux
- 98% Code Coverage: 79 comprehensive tests covering all edge cases
- 100% TypeScript: Full type safety and IntelliSense support
- Production Ready: Battle-tested on real projects
- Minimal Dependencies: Only 3 runtime dependencies for maximum security
- Smart Case Detection: Preserves your code style across 7 different case formats
- Dry-Run Mode: Preview all changes before committing
- Binary Safe: Automatically skips binary files, images, and compiled code
- Git Aware: Updates git remote URLs automatically
-
Smart Case Preservation: Automatically detects and preserves case styles
myProjectβnewProject(camelCase preserved)MyProjectβNewProject(PascalCase preserved)my-projectβnew-project(kebab-case preserved)my_projectβnew_project(snake_case preserved)MY_PROJECTβNEW_PROJECT(UPPERCASE preserved)@myorg/projectβ@myorg/newname(package scope preserved)
-
Comprehensive Renaming:
- File contents (code, markdown, json, etc.)
- File names
- Directory names
- Package names
- Git repository references
-
Safety Features:
- Dry-run mode to preview changes
- Confirmation prompt before actual changes
- Detailed change analysis
- Skips binary files and common build directories
The tool intelligently renames across all programming languages in your project:
// Before
export class DataProcessor { ... }
const dataProcessorConfig = { ... };
// After
export class DataAnalyzer { ... }
const dataAnalyzerConfig = { ... };# Before
from analytics_sdk import AnalyticsAPI
ANALYTICS_KEY = os.getenv('ANALYTICS_KEY')
# After
from metrics_sdk import MetricsAPI
METRICS_KEY = os.getenv('METRICS_KEY')// Before
public class PaymentService extends PaymentBase {
private static final String PAYMENT_API_URL = "...";
}
// After
public class BillingService extends BillingBase {
private static final String BILLING_API_URL = "...";
}// Before
package userauth
type UserAuthConfig struct { ... }
// After
package authentication
type AuthenticationConfig struct { ... }// Before
export default class TodoApp extends Component { ... }
// ios/TodoApp.xcodeproj
// android/app/src/main/java/com/todoapp/
// After
export default class TaskManager extends Component { ... }
// ios/TaskManager.xcodeproj
// android/app/src/main/java/com/taskmanager/Works with Ruby, PHP, Rust, C/C++, Swift, Dart, Shell scripts, Docker files, YAML configs, and any text-based file!
Not a JavaScript developer? See our Installation Guide for Java, Python, Go, Ruby, PHP, C++ developers!
# Global installation (recommended)
npm install -g refacto
# Or use npx (no installation required)
npx refacto --help
# Or install locally
npm install refacto --save-dev# Preview changes (dry-run)
refacto --from "OldName" --to "NewName" --dry-run
# Apply changes
refacto --from "OldName" --to "NewName"
# Interactive mode
refacto --interactive# Verbose output with detailed logging
refacto --from "OldApp" --to "NewApp" --verbose
# Custom ignore patterns
refacto --from "Company" --to "NewCorp" --ignore "docs/**" "legacy/**"
# Skip git configuration updates
refacto --from "OldName" --to "NewName" --skip-git
# Force mode (skip confirmation - use with caution)
refacto --from "Test" --to "Demo" --force--from <name>- Current project name (required)--to <name>- New project name (required)--dry-run- Show what would be changed without making changes--verbose, -v- Show detailed output--skip-git- Skip git repository updates--help, -h- Show help message
# Real-world example: Rebranding a React app
refacto --from "MyReactApp" --to "AwesomeReactApp" --dry-run --verbose
# Enterprise example: Company name change
refacto --from "OldCorp" --to "NewCorp" --ignore "node_modules/**" ".git/**"
# Framework migration prep
refacto --from "legacy-app" --to "modern-app" --verboseUse as a library in your Node.js projects:
import { ProjectRenamer } from 'refacto';
const renamer = new ProjectRenamer({
from: 'oldName',
to: 'newName',
dryRun: true,
verbose: false
});
// Analyze impact
const analysis = await renamer.analyze();
console.log(`Will modify ${analysis.contentChanges} files`);
// Perform rename
await renamer.rename();
// Get list of changes made
const changes = renamer.getChanges();interface RenameOptions {
from: string; // Source name to replace
to: string; // Target name to replace with
dryRun?: boolean; // Preview mode (default: false)
verbose?: boolean; // Detailed logging (default: false)
skipGit?: boolean; // Skip git config updates (default: false)
ignore?: string[]; // Custom ignore patterns
force?: boolean; // Skip confirmations (default: false)
}analyze(): Returns impact analysis without making changesrename(): Performs the actual renaming operationgetChanges(): Returns array of changes madesmartReplace(text): Apply smart case-preserving replacement to text
-
Analysis Phase:
- Scans the entire project to find all occurrences
- Counts files, directories, and text replacements
- Shows preview of changes to be made
-
Confirmation Phase (non-dry-run only):
- Shows summary of changes
- Displays example transformations
- Asks for user confirmation
-
Execution Phase:
- Renames file contents first
- Then renames files (deepest first)
- Finally renames directories (deepest first)
- Shows progress and summary
The tool is designed to be safe:
-
Ignored Paths: Automatically skips:
node_modules/.git/dist/build/coverage/- Log files (
*.log) - Lock files (
*.lock) - The rename tool itself
-
Binary Files: Automatically detects and skips binary files
-
Order of Operations: Renames in the correct order to avoid conflicts
- 98% overall coverage
- 79 comprehensive tests
- Full core logic coverage
- Cross-platform CI/CD
- 100% TypeScript with strict mode
- ESLint + Prettier enforced
- Automated dependency updates
- Semantic versioning
The tool is case-sensitive. Make sure to provide the exact current name:
# Wrong
--from "myproject" # If actual name is "MyProject"
# Correct
--from "MyProject"If you encounter permission errors:
# Use with sudo if needed (not recommended)
sudo refacto --from "OldName" --to "NewName"
# Or fix npm permissions (recommended)
npm config set prefix ~/.npm-global
export PATH=~/.npm-global/bin:$PATHFor very large projects (10,000+ files):
# Use verbose mode to see progress
refacto --from "OldName" --to "NewName" --verboseWe welcome contributions! This project follows enterprise-grade standards:
- 100% test coverage for new features
- TypeScript with strict mode
- ESLint compliance (no warnings)
- Comprehensive documentation
- Cross-platform compatibility
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Write tests FIRST (TDD approach)
- Implement your feature
- Ensure 100% test coverage (
npm run test:coverage) - Commit your changes (
git commit -m 'feat: add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
# Before submitting PR
npm run lint # Must pass with no errors
npm run test # Must pass all tests
npm run build # Must build successfully
npm run test:coverage # Must maintain >95% coverageMIT - See LICENSE
See CHANGELOG.md for version history.
Built by Mule-ME