Usage Examples
See real-world renaming scenarios
The Renamify MCP Server provides 10 specialized tools for AI agents to perform intelligent renaming operations.
Search for identifiers across your codebase to understand their usage before renaming.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
search | string | ✅ Yes | - | The identifier to search for |
paths | string[] | No | Current dir | Paths to search (files or directories) |
includes | string[] | No | All files | Glob patterns to include |
excludes | string[] | No | None | Glob patterns to exclude |
styles | string[] | No | All styles | Case styles to detect |
preview | string | No | summary | Output format |
dryRun | boolean | No | false | Preview without saving |
renameFiles | boolean | No | true | Include file renames in search |
renameDirs | boolean | No | true | Include directory renames in search |
atomicSearch | boolean | No | false | Treat search term as indivisible unit |
Tool: renamify_searchArguments: { "search": "UserAccount", "includes": ["src/**/*.ts", "src/**/*.tsx"], "preview": "summary"}
Result:Found 45 occurrences across 12 files: UserAccount (15) userAccount (18) user_account (8) USER_ACCOUNT (4)Files that would be renamed: 2Directories that would be renamed: 0
Use this tool to explore the codebase before creating a renaming plan.
Creates a comprehensive renaming plan that identifies all case variations of your identifiers.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
old | string | ✅ Yes | - | The identifier to replace |
new | string | ✅ Yes | - | The new identifier |
paths | string[] | No | Current dir | Paths to search (files or directories) |
includes | string[] | No | All files | Glob patterns to include |
excludes | string[] | No | None | Glob patterns to exclude |
styles | string[] | No | All styles | Case styles to detect |
preview | string | No | summary | Output format |
dryRun | boolean | No | false | Preview without saving |
renameFiles | boolean | No | true | Rename matching files |
renameDirs | boolean | No | true | Rename matching directories |
atomicSearch | boolean | No | false | Treat search term as indivisible unit |
atomicReplace | boolean | No | false | Treat replace term as indivisible unit |
Available case style options:
snake
- snake_casecamel
- camelCasepascal
- PascalCasekebab
- kebab-casescreaming-snake
- SCREAMING_SNAKE_CASEtitle
- Title Casetrain
- Train-Casescreaming-train
- SCREAMING-TRAIN-CASEdot
- dot.caselower-flat
- lowerjoined (no separators)upper-flat
- UPPERJOINED (no separators)sentence
- Sentence caselower-sentence
- lower sentenceupper-sentence
- UPPER SENTENCEspace-separated
- Shorthand for all space-separated stylessummary
- AI-optimized concise formattable
- Human-readable tablediff
- Unified diff formatjson
- Full structured dataTool: renamify_planArguments: { "old": "UserAccount", "new": "CustomerAccount", "includes": ["src/**/*.ts", "tests/**/*.ts"], "excludes": ["node_modules/**", "dist/**"], "styles": ["camel", "pascal", "snake"], "preview": "summary", "dryRun": false}
Tool: renamify_planArguments: { "old": "DocSpring", "new": "FormAPI", "atomicSearch": true, "atomicReplace": true, "preview": "summary"}
With atomic identifiers, compound words like “DocSpring” are treated as single units, preventing unwanted word boundary detection (e.g., doc_spring
).
Created plan: a3b7c9d4e8f2a6b1
Summary: Files to modify: 12 Total replacements: 47 Variants found: UserAccount (15) userAccount (18) user_account (8) USER_ACCOUNT (6) Files to rename: 3 src/UserAccount.ts → src/CustomerAccount.ts tests/userAccount.test.ts → tests/customerAccount.test.ts docs/user-account.md → docs/customer-account.md
Applies a renaming plan to make the actual changes to your codebase.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
planId | string | No | Latest | Specific plan ID to apply |
planPath | string | No | Auto | Path to plan file |
commit | boolean | No | false | Create git commit after |
Tool: renamify_applyArguments: { "commit": true}
Successfully applied plan a3b7c9d4e8f2a6b1 ✓ Modified 12 files ✓ Applied 47 replacements ✓ Renamed 3 files ✓ Created git commit: "renamify: rename UserAccount to CustomerAccount"
All changes applied successfully.
If conflicts are detected:
Error: Conflicts detected in 2 files: - src/api/handlers.ts: Content changed since plan creation - lib/database.ts: File no longer exists
Run 'renamify_plan' again to create a fresh plan with current file state.
Reverts a previously applied renaming operation.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
id | string | No | latest | History ID to undo (use “latest” for most recent non-revert entry) |
Tool: renamify_undoArguments: { "id": "a3b7c9d4e8f2a6b1"}
Successfully undone renaming a3b7c9d4e8f2a6b1 ✓ Reverted 47 replacements in 12 files ✓ Restored 3 renamed files
All changes have been reverted.
Re-applies a previously undone renaming.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
id | string | No | latest | History ID to redo (use “latest” for most recent reverted entry) |
Tool: renamify_redoArguments: { "id": "a3b7c9d4e8f2a6b1"}
Successfully redone renaming a3b7c9d4e8f2a6b1 ✓ Re-applied 47 replacements in 12 files ✓ Re-renamed 3 files
All changes have been re-applied.
Shows the history of renaming operations.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
limit | number | No | 10 | Number of entries to show |
Tool: renamify_historyArguments: { "limit": 5}
Renaming History (last 5 operations):
1. 4e8f2a6b1d3c7a9b [APPLIED] getUserData → fetchUserData 12 files, 38 replacements Applied: 1734567890
2. a3b7c9d4e8f2a6b1 [UNDONE] UserAccount → CustomerAccount 12 files, 47 replacements Applied: 1734567800 Undone: 1734567900
3. 6b1d3a7c9e4f8a2b [APPLIED] snake_case → camelCase (config migration) 8 files, 156 replacements Applied: 1734567600
Shows the current status of Renamify, including pending plans and system state.
This tool takes no parameters.
Tool: renamify_statusArguments: {}
Renamify Status:
Current Directory: /home/user/projectGit Branch: feature/renamingGit Status: Clean (no uncommitted changes)
Pending Plans: 1d3a7c9e4f8b2a6c - oldFunction → newFunction Created: 5 minutes ago Status: Not applied Files: 8, Replacements: 23
Last Applied: 4e8f2a6b1d3c7a9b - getUserData → fetchUserData Applied: 1 hour ago Status: Success
System: Renamify Version: 1.2.0 Config: .renamify/config.toml found History Entries: 47
Preview a plan in different formats without applying changes.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
planId | string | No | Latest | Plan ID to preview |
planPath | string | No | Auto | Path to plan file |
format | string | No | summary | Preview format |
summary
- Concise AI-friendly formattable
- Detailed table viewdiff
- Unified diff formatjson
- Raw JSON dataTool: renamify_previewArguments: { "format": "diff"}
--- a/src/components/UserAccount.tsx+++ b/src/components/CustomerAccount.tsx@@ -1,8 +1,8 @@-import { UserAccount } from '../types';+import { CustomerAccount } from '../types';
-interface UserAccountProps {- account: UserAccount;+interface CustomerAccountProps {+ account: CustomerAccount; }
-export function UserAccountComponent({ account }: UserAccountProps) {+export function CustomerAccountComponent({ account }: CustomerAccountProps) {
Perform case-aware renaming in a single step (combines plan + apply).
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
old | string | ✅ Yes | - | The identifier to replace |
new | string | ✅ Yes | - | The new identifier |
paths | string[] | No | Current dir | Paths to search |
dryRun | boolean | No | false | Preview without applying |
preview | string | No | summary | Preview format |
excludeStyles | string[] | No | None | Case styles to exclude |
includeStyles | string[] | No | None | Additional case styles |
onlyStyles | string[] | No | None | Use only these styles |
atomicSearch | boolean | No | false | Treat search term as indivisible |
atomicReplace | boolean | No | false | Treat replace term as indivisible |
Tool: renamify_renameArguments: { "old": "getUserInfo", "new": "fetchUserProfile", "paths": ["src"], "dryRun": true}
Perform simple regex or literal string replacement without case transformations.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
pattern | string | ✅ Yes | - | Search pattern (regex or literal) |
replacement | string | ✅ Yes | - | Replacement string |
paths | string[] | No | Current dir | Paths to search |
noRegex | boolean | No | false | Treat pattern as literal |
preview | string | No | summary | Preview format |
dryRun | boolean | No | false | Preview without applying |
Regex replacement:
Tool: renamify_replaceArguments: { "pattern": "console\\.log\\((.*?)\\)", "replacement": "logger.debug($1)", "paths": ["src"]}
Literal replacement:
Tool: renamify_replaceArguments: { "pattern": "http://localhost:3000", "replacement": "https://api.example.com", "noRegex": true}
graph LR A[renamify_plan] --> B[renamify_preview] B --> C{Review OK?} C -->|Yes| D[renamify_apply] C -->|No| E[Adjust & re-plan] D --> F{Success?} F -->|No| G[renamify_undo] F -->|Yes| H[Complete]
Always plan before applying
renamify_plan
firstrenamify_preview
if neededrenamify_apply
Use specific includes when possible
["src/**/*.ts"]
["!**/*.test.ts"]
Check status before operations
renamify_status
to verify clean stateHandle errors gracefully
renamify_undo
if something goes wrongError | Cause | Solution |
---|---|---|
”Renamify CLI not available” | Binary not in PATH | Check installation |
”No matches found” | Pattern too restrictive | Broaden search criteria |
”Conflicts detected” | Files changed since plan | Create new plan |
”Plan not found” | Invalid plan ID | Check with renamify_history |
”Permission denied” | File permissions | Check file ownership |
When apply fails:
renamify_status
to check staterenamify_undo
When patterns don’t match:
dryRun: true
to testFor repositories with >10,000 files:
includes
patternsThe MCP Server loads plans into memory:
format: "summary"
for efficiencyUsage Examples
See real-world renaming scenarios
AI Agent Guide
Best practices for AI-assisted renaming