renamify plan
The plan
command generates a detailed plan of all changes that will be made without modifying any files. This is the first step in Renamify’s two-phase workflow.
renamify plan <OLD> <NEW> [PATHS]... [OPTIONS]
Arguments
Section titled “Arguments”<OLD>
- Old identifier to replace<NEW>
- New identifier to replace with[PATHS]...
- Search paths (files or directories)
Options
Section titled “Options”Output Control
Section titled “Output Control”--preview <FORMAT>
- Output format: table (default), diff, json--plan-out <PATH>
- Where to save the plan (default: .renamify/plan.json)--dry-run
- Only show preview, don’t write plan file
File Processing
Section titled “File Processing”--include <PATTERNS>
- Only process files matching these glob patterns--exclude <PATTERNS>
- Skip files matching these glob patterns--no-rename-files
- Don’t rename matching files--no-rename-dirs
- Don’t rename matching directories
Case Styles
Section titled “Case Styles”--exclude-styles <STYLES>
- Exclude specific case styles from the default set--include-styles <STYLES>
- Add additional case styles to the active set--only-styles <STYLES>
- Use only these case styles, ignoring defaults
Match Control
Section titled “Match Control”--exclude-match <PATTERNS>
- Skip specific matches (e.g., compound words to ignore)--exclude-matching-lines <REGEX>
- Skip matches on lines matching this regex pattern (e.g.,^//
for comments,(TODO|FIXME)
for todo markers)
Acronym Handling
Section titled “Acronym Handling”--no-acronyms
- Disable acronym detection and transformation--include-acronyms <ACRONYMS>
- Add custom acronyms to detect (e.g., “API,URL”)--exclude-acronyms <ACRONYMS>
- Exclude specific acronyms from detection--only-acronyms <ACRONYMS>
- Only use these acronyms, ignore defaults
Display Options
Section titled “Display Options”--fixed-table-width
- Use fixed column widths in table output for consistent formatting
Unrestricted Mode
Section titled “Unrestricted Mode”-u
- Disable .gitignore files-uu
- Disable all ignore files, include hidden files-uuu
- Disable all ignore files, include hidden files, process binary files
Output Formats
Section titled “Output Formats”Table Format (Default)
Section titled “Table Format (Default)”renamify plan getUserName fetchUserProfile
Shows a clear table view of all changes:
Files to modify: 12┌─────────────────────────────────────┬──────────┬────────────────────┬─────────────────────┐│ File │ Lines │ Old │ New │├─────────────────────────────────────┼──────────┼────────────────────┼─────────────────────┤│ src/auth.js │ 23, 45 │ getUserName │ fetchUserProfile ││ src/types.ts │ 8 │ GetUserName │ FetchUserProfile ││ utils/helpers.py │ 156 │ get_user_name │ fetch_user_profile │└─────────────────────────────────────┴──────────┴────────────────────┴─────────────────────┘
Files to rename: 3┌─────────────────────────────────────┬─────────────────────────────────────┐│ Current Path │ New Path │├─────────────────────────────────────┼─────────────────────────────────────┤│ src/getUserName.js │ src/fetchUserProfile.js ││ components/GetUserName.tsx │ components/FetchUserProfile.tsx ││ tests/get_user_name.test.py │ tests/fetch_user_profile.test.py │└─────────────────────────────────────┴─────────────────────────────────────┘
Diff Format
Section titled “Diff Format”renamify plan getUserName fetchUserProfile --preview diff
Shows changes in diff format:
--- src/auth.js+++ src/auth.js@@ -20,7 +20,7 @@ function authenticateUser(token) {- const username = getUserName(token);+ const username = fetchUserProfile(token); return validateUser(username); }
JSON Format
Section titled “JSON Format”renamify plan getUserName fetchUserProfile --preview json
Outputs structured JSON for programmatic use:
{ "id": "a3b7c9d4e8f2a6b1", "created_at": "1734567890", "old": "getUserName", "new": "fetchUserProfile", "matches": [ { "file": "src/auth.js", "line": 23, "old_text": "getUserName", "new_text": "fetchUserProfile" } ], "renames": [ { "old_path": "src/getUserName.js", "new_path": "src/fetchUserProfile.js" } ]}
Examples
Section titled “Examples”Basic Planning
Section titled “Basic Planning”# Create a plan with table preview (default)renamify plan old_name new_name
# Plan is saved to .renamify/plan.jsoncat .renamify/plan.json
# Or specify specific pathsrenamify plan old_name new_name src/ tests/
Dry Run (No Plan File)
Section titled “Dry Run (No Plan File)”# Just see what would change, don't create a plan filerenamify plan old_name new_name --dry-run
Excluding Lines by Pattern
Section titled “Excluding Lines by Pattern”# Skip matches in comment lines (starting with //)renamify plan old_name new_name --exclude-matching-lines '^//'
# Skip matches in lines containing TODO or FIXMErenamify plan old_name new_name --exclude-matching-lines '(TODO|FIXME)'
# Combine with other optionsrenamify plan old_name new_name \ --exclude-matching-lines '^\\s*#' \ # Skip Python comments --exclude-styles kebab \ # Don't generate kebab-case variants --preview diff # Show as diff
Custom Plan Location
Section titled “Custom Plan Location”# Save plan to a specific locationrenamify plan old_name new_name --plan-out ./renamify-plan.json
Specific File Types
Section titled “Specific File Types”# Only plan changes for Rust files using pathsrenamify plan old_name new_name src/ lib/
# Or use include patterns for more controlrenamify plan old_name new_name --include "**/*.rs"
# Plan for source files, exclude testsrenamify plan old_name new_name \ --include "src/**/*.{js,ts}" \ --exclude "**/*test*"
Case Style Control
Section titled “Case Style Control”# Only plan camelCase and snake_case transformationsrenamify plan oldName newName --only-styles camel,snake
# Exclude SCREAMING_SNAKE_CASE from default stylesrenamify plan oldName newName --exclude-styles screaming-snake
Large Codebase Planning
Section titled “Large Codebase Planning”# Include gitignored files (like vendor directories)renamify plan old_name new_name -u
# Plan for everything (including hidden files)renamify plan old_name new_name -uu
Plan File Structure
Section titled “Plan File Structure”The generated plan file (.renamify/plan.json
) contains:
{ "id": "7f3a2b5c9d1e8f4a", "created_at": "1734567890", "old": "original_pattern", "new": "replacement_pattern", "styles": ["snake", "kebab", "camel", "pascal", "screaming-snake"], "includes": ["**/*"], "excludes": ["target/**", "node_modules/**"], "matches": [ { "file": "relative/path/to/file.js", "line": 42, "column": 10, "old_text": "matched_text", "new_text": "replacement_text", "context": "surrounding context for verification" } ], "renames": [ { "old_path": "old/file/path.js", "new_path": "new/file/path.js", "is_dir": false } ], "stats": { "files_scanned": 1247, "files_to_modify": 23, "files_to_rename": 5, "directories_to_rename": 2, "total_matches": 89 }}
After Planning
Section titled “After Planning”Once you have a plan, you can:
Apply the Plan
Section titled “Apply the Plan”renamify apply
Review Before Applying
Section titled “Review Before Applying”# Look at the plan in detailcat .renamify/plan.json | jq .
# Count total changesjq '.stats.total_matches' .renamify/plan.json
Modify the Plan
Section titled “Modify the Plan”Advanced users can edit the plan file directly before applying (not recommended for beginners).
Create a New Plan
Section titled “Create a New Plan”Running plan
again will overwrite the existing plan file.
Exit Codes
Section titled “Exit Codes”0
- Plan created successfully1
- Conflicts detected in planned changes2
- Invalid input or arguments3
- Internal error or system issue
Performance Tips
Section titled “Performance Tips”For large codebases:
- Use specific
--include
patterns to limit scope - Use
--exclude
to skip large directories likenode_modules/
- Consider using
-u
flags judiciously to include necessary ignored files