Search & Replace
The Search & Replace page provides a visual interface for bulk search and replace operations across multiple repositories with automatic merge request creation.
Accessing Replace
Section titled “Accessing Replace”Navigate to the Replace page from the main navigation.
How It Works
Section titled “How It Works”-
Enter your search pattern and replacement text
-
Click Preview to see all matches
-
Review the changes - each match shows the before/after diff
-
Click Execute to create merge requests with the changes
Search Pattern
Section titled “Search Pattern”The search pattern field supports Zoekt query syntax:
oldFunction lang:go repo:myorg/apiAvailable Filters
Section titled “Available Filters”| Filter | Example | Description |
|---|---|---|
repo: | repo:myorg/api | Filter by repository |
lang: | lang:typescript | Filter by language |
file: | file:*.go | Filter by file pattern |
case:yes | FOO case:yes | Case-sensitive search |
case:no | foo case:no | Case-insensitive (default) |
-repo: | -repo:test | Exclude repository |
-file: | -file:*_test.go | Exclude files |
Options Panel
Section titled “Options Panel”Click More options to access additional filtering:
| Option | Description |
|---|---|
| File patterns | Glob patterns to filter files (e.g., *.go, *.ts) |
| Repositories | Filter to specific repos (comma-separated) |
| Limit | Maximum number of matches (0 = unlimited) |
| MR/PR title | Custom title for the merge request |
URL Sharing
Section titled “URL Sharing”Replace parameters are encoded in the URL for easy sharing:
http://localhost:3000/replace?q=oldFunction&replace=newFunction&files=*.go&repos=myorg/apiShare the URL with teammates to let them preview or execute the same replacement.
Read-Only Mode & Personal Access Token
Section titled “Read-Only Mode & Personal Access Token”If you attempt to execute a replacement with read-only repositories, a modal will prompt you for your personal access token:
- Generate a PAT from your code host (GitLab, GitHub, etc.) with
apior repository write permissions - Enter the token in the modal
- The token is used only for the current session and is not stored in your browser
- The token is used to authenticate the MR creation on your behalf
Preview Results
Section titled “Preview Results”After clicking Preview, you’ll see:
- Match count - Total number of matches found
- File count - Number of files with matches
- Grouped results - Matches organized by repository and file
- Line preview - Each match with the replacement highlighted
Diff View
Section titled “Diff View”Each match shows:
Old textstruck through in red- New text highlighted in green
Execute Replacement
Section titled “Execute Replacement”Once you’re satisfied with the preview:
- Click Execute (N matches) button
- Confirm the action in the dialog
- A background job is queued
- Merge requests are created for each repository with changes
Examples
Section titled “Examples”Rename a Function
Section titled “Rename a Function”Search: getUserByIdReplace: findUserByIdFiles: *.go, *.tsUpdate Import Path
Section titled “Update Import Path”Search: github.com/old-org/packageReplace: github.com/new-org/packageVersion Bump
Section titled “Version Bump”Search: "version": "1.0.0"Replace: "version": "2.0.0"Files: package.jsonCase-Sensitive Replacement
Section titled “Case-Sensitive Replacement”Search: FOO case:yesReplace: BARNext Steps
Section titled “Next Steps”- Search Interface - Learn the query syntax
- Jobs - Monitor replace job progress
- API Replace - Programmatic access