Safety Features
Renamify is built with safety as a core principle. Multiple layers of protection ensure your code remains intact during renaming operations.
Plan/Apply Workflow
Section titled “Plan/Apply Workflow”Two-Step Process
Section titled “Two-Step Process”- Plan: Generate a detailed preview of all changes without modifying anything
- Apply: Execute the plan atomically after review
# Step 1: Create and review the planrenamify plan old_name new_name --preview table
# Step 2: Apply when satisfiedrenamify apply
Fast Path for Simple Changes
Section titled “Fast Path for Simple Changes”The rename
command combines planning and applying with confirmation:
renamify rename old_name new_name --preview table# Shows preview → asks for confirmation → applies atomically
Atomic Operations
Section titled “Atomic Operations”All file modifications are atomic by default:
How It Works
Section titled “How It Works”- Temporary files: Changes are written to temporary files first
- Atomic rename: Files are atomically renamed into place
- Directory sync: Parent directories are synced (on Unix systems)
- Rollback on failure: If any operation fails, all changes are rolled back
Benefits
Section titled “Benefits”- No partial states: Your codebase never exists in a half-modified state
- Interruption safety: Safe to interrupt (Ctrl+C) during operations
- Consistency: All changes succeed together or none at all
Backup and History System
Section titled “Backup and History System”Automatic Backups
Section titled “Automatic Backups”Before applying changes, Renamify creates backups of all affected files:
.renamify/├── backups/│ └── abc123-20241201-143022/│ ├── src/│ │ └── auth.js│ └── components/│ └── UserProfile.tsx└── history.json
Integrity Verification
Section titled “Integrity Verification”- Each backup includes SHA-256 checksums
- Checksums are verified during restore operations
- Corrupted backups are detected and reported
Unlimited Undo/Redo
Section titled “Unlimited Undo/Redo”# See all operationsrenamify history
# Undo any operation by IDrenamify undo abc123
# Redo if you change your mindrenamify redo abc123
Conflict Detection
Section titled “Conflict Detection”Renamify detects various types of conflicts before making changes:
File Rename Conflicts
Section titled “File Rename Conflicts”Multiple-to-One: When multiple files would rename to the same destination
❌ Conflict detected: Multiple files would be renamed to 'utils.js': - old_utils.js - oldUtils.js
Use --exclude or --include patterns to resolve this conflict.
Case-Insensitive Filesystems: On macOS/Windows
⚠️ Case-insensitive rename detected: 'OldName.js' → 'oldName.js'This will be handled with a two-step rename process.
Windows Reserved Names: Prevents creating invalid files
❌ Cannot create 'CON.js' - reserved filename on Windows
Content Conflicts
Section titled “Content Conflicts”- Overlapping matches: When the same text would be replaced multiple times
- Boundary violations: When matches don’t respect word boundaries (with warnings)
Lock File Protection
Section titled “Lock File Protection”Renamify prevents concurrent operations that could corrupt your workspace:
Lock Mechanism
Section titled “Lock Mechanism”- Lock file created at
.renamify/renamify.lock
during operations - Contains process ID and timestamp for tracking
- Automatically cleaned up when operations complete
Stale Lock Handling
Section titled “Stale Lock Handling”- Stale locks (older than 5 minutes) are automatically removed
- Manual cleanup if needed:
rm .renamify/renamify.lock
# If you see this error:❌ Another renamify operation is in progress (PID: 12345)
# Check if the process is actually running:ps 12345
# If not, remove the stale lock:rm .renamify/renamify.lock
Git Integration
Section titled “Git Integration”Status Checking
Section titled “Status Checking”Renamify can check git status before operations:
# Apply with automatic git commitrenamify apply --commit
Best Practices
Section titled “Best Practices”- Commit before large rename operations: Makes git-based rollback possible
- Clean working directory: Start with committed changes when possible
- Branch for experiments: Use git branches for exploratory renaming
Dry Run Mode
Section titled “Dry Run Mode”Preview changes without creating plan files:
# See what would change without any file creationrenamify dry-run old_name new_name --preview table
Perfect for:
- Exploring potential changes
- Testing include/exclude patterns
- Understanding scope before committing to a plan
Error Handling
Section titled “Error Handling”Graceful Degradation
Section titled “Graceful Degradation”- Permission errors: Clear reporting with suggested fixes
- Disk space: Checks available space before large operations
- Filesystem errors: Detailed error messages with context
Recovery Guidance
Section titled “Recovery Guidance”When operations fail, Renamify provides:
- Clear error messages: What went wrong and why
- Recovery steps: How to fix the issue
- Safe cleanup: How to return to a clean state
Example Error Handling
Section titled “Example Error Handling”❌ Error: Permission denied writing to 'src/readonly.js'
Suggestions:1. Check file permissions: ls -la src/readonly.js2. Make writable: chmod +w src/readonly.js3. Or exclude from renaming: --exclude "src/readonly.js"
Force Options (Use with Caution)
Section titled “Force Options (Use with Caution)”For advanced users who understand the risks:
# Apply even if conflicts are detectedrenamify apply --force-with-conflicts
# Confirm case-insensitive or collision renamesrenamify rename old new --confirm-collisions
⚠️ Warning: Force options bypass safety checks. Use only when you understand the implications and have backups.