lr-rename-replace 2026.1.29.2106

dotnet tool install --global lr-rename-replace --version 2026.1.29.2106
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local lr-rename-replace --version 2026.1.29.2106
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=lr-rename-replace&version=2026.1.29.2106
                    
nuke :add-package lr-rename-replace --version 2026.1.29.2106
                    

lr-rename-replace

NuGet

A command-line tool for bulk-renaming projects. It renames folders, files, and text content in one go. Unlike simple search-and-replace scripts, it processes directories from the inside out, ensuring that deep project hierarchies are renamed safely without breaking any paths.

Usage

Run it directly with dnx:

dnx -y lr-rename-replace <directory> <old@new> [another-old@another-new]

Examples

Rename a project and its namespace:

dnx -y lr-rename-replace . MyProject@OurProject

Rename multiple things at once:

dnx -y lr-rename-replace ./src "OldApp@NewApp" "v1@v2" "internal@public"

How it works

The tool goes through three steps to make sure nothing gets lost or broken:

  1. Directories first (Inside-Out) It renames folders starting from the deepest ones. This is important because if you rename a parent folder first, the paths to all its sub-folders would change, and the tool wouldn't be able to find them anymore. When a folder is renamed, all its contents are moved to the new location automatically.

  2. File names After folders are handled, it goes through every file and renames it if the filename matches any of your search terms.

  3. Text content Finally, it reads the content of every file and performs the replacements.

    • Binary safety: It checks for null bytes. If it finds 3 or more, it assumes the file is binary (like an image or executable) and leaves it alone.
    • BOM Preservation: If your text files use a UTF-8 BOM (Byte Order Mark), the tool detects it and makes sure it's kept when the file is saved.

Good to know

  • Case Sensitivity: Replacements are case-sensitive. If you need to rename both MyProject and myproject, provide both pairs: MyProject@OurProject myproject@ourproject.
  • Spaces: If your search or replacement strings have spaces, wrap the whole pair in quotes: "Old Name@New Name".
  • Safety: It's always best to run this on a clean git state so you can easily undo the changes if needed.

Installation

If you prefer to have it installed globally on your machine:

dotnet tool install -g lr-rename-replace

Usage after installation:

lr-rename-replace . Old@New
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
2026.1.29.2106 36 1/29/2026
2026.1.6.2055 104 1/6/2026
2025.12.30.415 116 12/30/2025
2025.12.30.341 97 12/30/2025
2025.12.30.335 100 12/30/2025
2025.12.30.332 96 12/30/2025
2025.12.30.312 109 12/30/2025
2025.12.30.133 101 12/30/2025
2025.12.26.27 199 12/25/2025