Skip to content

Project-Wide Changes

Rename an entire library or module throughout your project:

Terminal window
renamify rename mylib awesome_lib --commit

File structure:

src/
├── mylib/ → awesome_lib/
│ ├── core.js → core.js (contents updated)
│ └── utils.js → utils.js (contents updated)
├── components/
│ └── MyLibWidget.tsx → AwesomeLibWidget.tsx
└── tests/
└── mylib.test.js → awesome_lib.test.js

Import statements:

// Before
import { helper } from 'mylib/utils';
import MyLibWidget from './components/MyLibWidget';
// After
import { helper } from 'awesome_lib/utils';
import AwesomeLibWidget from './components/AwesomeLibWidget';

Package.json and configuration:

// Before
{
"name": "mylib",
"main": "src/mylib/index.js"
}
// After
{
"name": "awesome_lib",
"main": "src/awesome_lib/index.js"
}

Rename API endpoints consistently:

Terminal window
renamify rename getUserData fetchUserProfile \
--include "**/*.{js,ts,py,go}"

Backend code:

# Before
@app.route('/api/getUserData')
def get_user_data(user_id): ...
# After
@app.route('/api/fetchUserProfile')
def fetch_user_profile(user_id): ...

Frontend code:

// Before
const response = await fetch('/api/getUserData');
const getUserData = async (id) => { ... };
// After
const response = await fetch('/api/fetchUserProfile');
const fetchUserProfile = async (id) => { ... };

Rename database-related code:

Terminal window
renamify rename user_profile account_profile \
--include "**/*.{sql,js,py,rb}" \
--exclude "migrations/**"

Model definitions:

# Before
class UserProfile(models.Model):
def get_user_profile_data(self): ...
# After
class AccountProfile(models.Model):
def get_account_profile_data(self): ...

SQL queries:

-- Before
SELECT * FROM user_profile WHERE id = ?;
UPDATE user_profile SET name = ? WHERE id = ?;
-- After
SELECT * FROM account_profile WHERE id = ?;
UPDATE account_profile SET name = ? WHERE id = ?;

Update configuration keys across your application:

Terminal window
renamify rename redis_url cache_url \
--include "**/*.{js,py,rb,yml,yaml,json,toml}"

Environment files:

Terminal window
# Before
REDIS_URL=redis://localhost:6379
redis_url=redis://localhost:6379
# After
CACHE_URL=redis://localhost:6379
cache_url=redis://localhost:6379

Configuration files:

# Before
database:
redis_url: ${REDIS_URL}
# After
database:
cache_url: ${CACHE_URL}

Sometimes you need to be selective about what gets changed:

Terminal window
renamify rename config settings \
--exclude-match ConfigurationManager,ConfigService \
--include "src/**" \
--exclude "**/*test*"

This will:

  • ✅ Change configsettings
  • ✅ Change getConfiggetSettings
  • ❌ Skip ConfigurationManager (excluded match)
  • ❌ Skip ConfigService (excluded match)
  • ❌ Skip test files

Rename the entire project directory:

Terminal window
renamify rename myproject awesome_project \
--rename-root \
--commit

After confirmation, you’ll see:

✅ Applied successfully!
Next Steps:
1. cd ../awesome_project
2. npm install # or cargo build, etc.
3. Update any IDE project settings
  • Always commit changes before root directory rename
  • Update build scripts and CI/CD pipelines
  • Consider impact on deployment scripts
  • Update documentation and README files
Terminal window
# Only process source files, not dependencies
renamify rename old_name new_name \
--include "src/**/*.{js,ts,tsx}" \
--exclude "node_modules/**"
# Or use specific paths
renamify rename old_name new_name src/ lib/
Terminal window
# Explore the scope before committing
renamify dry-run old_name new_name src/
# Or with patterns
renamify dry-run old_name new_name --include "src/**"
# Count potential matches
renamify dry-run old_name new_name | grep -c ""
Terminal window
# Create plan and review while system is idle
renamify plan large_change huge_change --preview json > plan.json
# Apply later when ready
renamify apply --plan plan.json