Skip to content

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.

Terminal window
renamify plan <OLD> <NEW> [PATHS]... [OPTIONS]
  • <OLD> - Old identifier to replace
  • <NEW> - New identifier to replace with
  • [PATHS]... - Search paths (files or directories)
  • --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
  • --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
  • --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
  • --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)
  • --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
  • --fixed-table-width - Use fixed column widths in table output for consistent formatting
  • -u - Disable .gitignore files
  • -uu - Disable all ignore files, include hidden files
  • -uuu - Disable all ignore files, include hidden files, process binary files
Terminal window
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 │
└─────────────────────────────────────┴─────────────────────────────────────┘
Terminal window
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);
}
Terminal window
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"
}
]
}
Terminal window
# Create a plan with table preview (default)
renamify plan old_name new_name
# Plan is saved to .renamify/plan.json
cat .renamify/plan.json
# Or specify specific paths
renamify plan old_name new_name src/ tests/
Terminal window
# Just see what would change, don't create a plan file
renamify plan old_name new_name --dry-run
Terminal window
# Skip matches in comment lines (starting with //)
renamify plan old_name new_name --exclude-matching-lines '^//'
# Skip matches in lines containing TODO or FIXME
renamify plan old_name new_name --exclude-matching-lines '(TODO|FIXME)'
# Combine with other options
renamify 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
Terminal window
# Save plan to a specific location
renamify plan old_name new_name --plan-out ./renamify-plan.json
Terminal window
# Only plan changes for Rust files using paths
renamify plan old_name new_name src/ lib/
# Or use include patterns for more control
renamify plan old_name new_name --include "**/*.rs"
# Plan for source files, exclude tests
renamify plan old_name new_name \
--include "src/**/*.{js,ts}" \
--exclude "**/*test*"
Terminal window
# Only plan camelCase and snake_case transformations
renamify plan oldName newName --only-styles camel,snake
# Exclude SCREAMING_SNAKE_CASE from default styles
renamify plan oldName newName --exclude-styles screaming-snake
Terminal window
# 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

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
}
}

Once you have a plan, you can:

Terminal window
renamify apply
Terminal window
# Look at the plan in detail
cat .renamify/plan.json | jq .
# Count total changes
jq '.stats.total_matches' .renamify/plan.json

Advanced users can edit the plan file directly before applying (not recommended for beginners).

Running plan again will overwrite the existing plan file.

  • 0 - Plan created successfully
  • 1 - Conflicts detected in planned changes
  • 2 - Invalid input or arguments
  • 3 - Internal error or system issue

For large codebases:

  • Use specific --include patterns to limit scope
  • Use --exclude to skip large directories like node_modules/
  • Consider using -u flags judiciously to include necessary ignored files