Basic Renaming
Function Renaming
Section titled “Function Renaming”Rename a function across your entire codebase:
# Generate a plan and reviewrenamify plan getUserName fetchUserProfile
# Apply the changesrenamify apply
Or use the fast-path:
# Plan, preview, confirm, and apply in one commandrenamify rename getUserName fetchUserProfile
What Gets Changed
Section titled “What Gets Changed”JavaScript/TypeScript files:
// Beforefunction getUserName(id) { ... }const name = getUserName(userId);export { getUserName };
// Afterfunction fetchUserProfile(id) { ... }const name = fetchUserProfile(userId);export { fetchUserProfile };
Python files:
# Beforedef get_user_name(user_id): ...name = get_user_name(id)
# Afterdef fetch_user_profile(user_id): ...name = fetch_user_profile(id)
Files and directories:
utils/getUserName.js
→utils/fetchUserProfile.js
tests/get_user_name.test.py
→tests/fetch_user_profile.test.py
Variable Renaming
Section titled “Variable Renaming”Rename variables and constants:
renamify rename apiKey secretKey
What Gets Changed
Section titled “What Gets Changed”Various naming conventions:
// Beforeconst apiKey = "...";const API_KEY = process.env.API_KEY;const api_key = config.api_key;
// Afterconst secretKey = "...";const SECRET_KEY = process.env.SECRET_KEY;const secret_key = config.secret_key;
Component Renaming
Section titled “Component Renaming”Rename React/Vue components:
renamify rename UserCard ProfileCard
What Gets Changed
Section titled “What Gets Changed”Component files:
components/UserCard.tsx
→components/ProfileCard.tsx
components/user-card.vue
→components/profile-card.vue
Component usage:
// Beforeimport UserCard from './UserCard';<UserCard user={currentUser} />
// Afterimport ProfileCard from './ProfileCard';<ProfileCard user={currentUser} />
Class Renaming
Section titled “Class Renaming”Rename classes across multiple files:
renamify rename DatabaseManager DataManager
What Gets Changed
Section titled “What Gets Changed”# Beforeclass DatabaseManager: def __init__(self): ...
db_manager = DatabaseManager()
# Afterclass DataManager: def __init__(self): ...
data_manager = DataManager()
Safe Undo
Section titled “Safe Undo”If you make a mistake, easily undo:
# See recent operationsrenamify history
# Undo the last operationrenamify undo abc123-20241201-143022
# Or redo if you change your mindrenamify redo abc123-20241201-143022