lr-rename-replace 2026.3.20.1548

dotnet tool install --global lr-rename-replace --version 2026.3.20.1548
                    
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.3.20.1548
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=lr-rename-replace&version=2026.3.20.1548
                    
nuke :add-package lr-rename-replace --version 2026.3.20.1548
                    

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.3.20.1548 91 3/20/2026
2026.3.18.2139 82 3/18/2026
2026.3.18.2120 82 3/18/2026
2026.3.17.1358 93 3/17/2026
2026.3.4.2312 102 3/4/2026
2026.1.29.2106 143 1/29/2026
2026.1.6.2055 182 1/6/2026
2025.12.30.415 171 12/30/2025
2025.12.30.341 151 12/30/2025
2025.12.30.335 153 12/30/2025
2025.12.30.332 149 12/30/2025
2025.12.30.312 163 12/30/2025
2025.12.30.133 154 12/30/2025
2025.12.26.27 255 12/25/2025