Skip to content

Search & Replace

The Search & Replace page provides a visual interface for bulk search and replace operations across multiple repositories with automatic merge request creation.

Navigate to the Replace page from the main navigation.

  1. Enter your search pattern and replacement text

  2. Click Preview to see all matches

  3. Review the changes - each match shows the before/after diff

  4. Click Execute to create merge requests with the changes

The search pattern field supports Zoekt query syntax:

oldFunction lang:go repo:myorg/api
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

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

Replace parameters are encoded in the URL for easy sharing:

http://localhost:3000/replace?q=oldFunction&replace=newFunction&files=*.go&repos=myorg/api

Share the URL with teammates to let them preview or execute the same replacement.

If you attempt to execute a replacement with read-only repositories, a modal will prompt you for your personal access token:

  1. Generate a PAT from your code host (GitLab, GitHub, etc.) with api or repository write permissions
  2. Enter the token in the modal
  3. The token is used only for the current session and is not stored in your browser
  4. The token is used to authenticate the MR creation on your behalf

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

Each match shows:

  • Old text struck through in red
  • New text highlighted in green

Once you’re satisfied with the preview:

  1. Click Execute (N matches) button
  2. Confirm the action in the dialog
  3. A background job is queued
  4. Merge requests are created for each repository with changes
Search: getUserById
Replace: findUserById
Files: *.go, *.ts
Search: github.com/old-org/package
Replace: github.com/new-org/package
Search: "version": "1.0.0"
Replace: "version": "2.0.0"
Files: package.json
Search: FOO case:yes
Replace: BAR