Usage Examples
See real-world renaming scenarios
The Renamify MCP Server provides 7 specialized tools for AI agents to perform intelligent renaming operations.
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 |
Available case style options:
snake
- snake_casecamel
- camelCasepascal
- PascalCasekebab
- kebab-casescreaming-snake
- SCREAMING_SNAKE_CASEtitle
- Title Casetrain
- Train-Casedot
- dot.casesummary
- 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}
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 |
atomic | boolean | No | true | All-or-nothing execution |
commit | boolean | No | false | Create git commit after |
Tool: renamify_applyArguments: { "atomic": true, "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.json 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) {
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