Aiursoft.NugetNinja.MergeBot 10.0.1

dotnet tool install --global Aiursoft.NugetNinja.MergeBot --version 10.0.1
                    
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 Aiursoft.NugetNinja.MergeBot --version 10.0.1
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=Aiursoft.NugetNinja.MergeBot&version=10.0.1
                    
nuke :add-package Aiursoft.NugetNinja.MergeBot --version 10.0.1
                    

Nuget Ninja

MIT licensed Pipeline stat Test Coverage NuGet version (Aiursoft.NugetNinja) NuGet version (Aiursoft.NugetNinja.PrBot) ManHours

Nuget Ninja is a tool for detecting dependencies of .NET projects. It analyzes the dependency structure of .NET projects in a directory and builds a directed acyclic graph. And will give some modification suggestions for Nuget packages, so that the dependencies of the project are as concise and up-to-date as possible.

Installation

Requirements:

  1. .NET 10 SDK

Run the following command to install this tool:

dotnet tool install --global Aiursoft.NugetNinja

Usage

After getting the binary, run it directly in the terminal.

C:\workspace> ninja.exe

Description:
  A tool for detecting dependencies of .NET projects.

Usage:
  ninja [command] [options]

Options:
  -p, --path <path> (REQUIRED)                     Path of the projects to be changed.
  -d, --dry-run                                    Preview changes without actually making them
  -v, --verbose                                    Show detailed log
  --allow-preview                                  Allow using preview versions of packages from Nuget.
  --nuget-server <nuget-server>                    If you want to use a customized nuget server instead of the official nuget.org, you can set it with a value like: https://nuget.myserver/v3/index.json
  --token <token>                                  The PAT token which has privilege to access the nuget server. See: 
                                                   https://docs.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate
  --allow-package-version-cross-microsoft-runtime  Allow using NuGet package versions for different Microsoft runtime versions. For example, when using runtime 6.0, it will avoid upgrading packages to 7.0.
  --version                                        Show version information
  -?, -h, --help                                   Show help and usage information

Commands:
  all, all-officials  The command to run all officially supported features.
  fill-properties     The command to fill all missing properties for .csproj files.
  remove-deprecated   The command to replace all deprecated packages to new packages.
  upgrade-pkg         The command to upgrade all package references to possible latest and avoid conflicts.
  clean-pkg           The command to clean up possible useless package references.
  clean-prj           The command to clean up possible useless project references.
  visualize           The command to visualize the dependency relationship, with mermaid markdown.
  expect-files        The command to search for all expected files and add patch the content.

Config file

Beyond managing NuGet packages, NugetNinja can also enforce repository structure by ensuring common files (like .gitignore, LICENSE, or .editorconfig) are present and up-to-date.

This feature is configured by placing a ninja.yaml file in the root of your repository.

This YAML file defines a list of files you expect to be in your repository. For each file, you must specify its name and can optionally provide a contentUri pointing to the raw content that file should have.

Here is a sample ninja.yaml:

configVersion: 1
files:
  - name: .editorconfig
    contentUri: https://gitlab.aiursoft.com/aiursoft/tracer/-/raw/master/.editorconfig
  - name: .gitignore
    contentUri: https://gitlab.aiursoft.com/aiursoft/tracer/-/raw/master/.gitignore
  - name: .gitlab-ci.yml
    contentUri: https://gitlab.aiursoft.com/aiursoft/tracer/-/raw/master/.gitlab-ci.yml
  - name: LICENSE
    contentUri: https://gitlab.aiursoft.com/aiursoft/tracer/-/raw/master/LICENSE
  - name: CODE_OF_CONDUCT.md
    contentUri: https://gitlab.aiursoft.com/aiursoft/tracer/-/raw/master/CODE_OF_CONDUCT.md
  - name: ninja.yaml
    contentUri: https://gitlab.aiursoft.com/aiursoft/tracer/-/raw/master/ninja.yaml
  - name: nuget.config
    contentUri: https://gitlab.aiursoft.com/aiursoft/tracer/-/raw/master/nuget.config
  - name: README.md

When you run the expect-files command, NugetNinja will read this configuration and perform the following actions:

  1. Create Missing Files: If a file specified in files (e.g., LICENSE) does not exist in your project's root directory, NugetNinja will create it.

    • If a contentUri is provided, the tool will download the content from that URL and write it to the new file.
    • If no contentUri is provided, an empty file will be created.
  2. Patch Existing Files: If a file already exists, NugetNinja will compare its content with the content at the specified contentUri.

    • If the contents do not match, the local file will be overwritten (patched) with the content from the URL.
    • If the contents match, no action is taken.
  3. Correct File Casing: The tool performs a case-insensitive search for the file. If it finds a file with a matching name but different casing (e.g., your repo has license but the YAML specifies LICENSE), it will rename the file to match the exact casing in the name property.

Sample

Generate suggestions for the current workspace without modifying local files:

C:\workspace> ninja.exe all --path . --dry-run

Fill missing properties for current workspace:

C:\workspace> ninja.exe fill-properties --path .

Run all plugins under the current folder:

C:\workspace> ninja.exe all --path .

Run locally

Requirements about how to run

  1. .NET 10 SDK
  2. Execute dotnet run to run the app

Run in Microsoft Visual Studio

  1. Open the .sln file in the project path.
  2. Press F5.

How to contribute

There are many ways to contribute to the project: logging bugs, submitting pull requests, reporting issues, and creating suggestions.

Even if you with push rights on the repository, you should create a personal fork and create feature branches there when you need them. This keeps the main repository clean and your workflow cruft out of sight.

We're also interested in your feedback on the future of this project. You can submit a suggestion or feature request through the issue tracker. To make this process more effective, we're asking that these include more information to help define them more clearly.

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
10.0.1 233 11/14/2025
10.0.0 265 11/13/2025
9.0.43 261 11/12/2025
9.0.42 99 10/25/2025
9.0.41 164 10/20/2025
9.0.40 164 10/16/2025
9.0.39 102 10/4/2025
9.0.38 299 9/16/2025
9.0.37 156 9/14/2025
9.0.36 230 8/27/2025
9.0.35 93 8/16/2025
9.0.34 258 8/5/2025
9.0.33 199 8/4/2025
9.0.32 157 7/11/2025
9.0.30 167 7/9/2025
9.0.29 178 6/18/2025
9.0.28 177 6/17/2025
9.0.26 320 6/12/2025
9.0.25 325 6/11/2025
9.0.24 177 6/3/2025
9.0.23 178 6/2/2025
9.0.22 139 5/18/2025
9.0.21 185 4/11/2025
9.0.20 204 4/10/2025
9.0.19 213 4/9/2025
9.0.18 181 3/20/2025
9.0.17 187 3/13/2025
9.0.16 208 3/12/2025
9.0.15 149 2/28/2025
9.0.14 145 2/26/2025
9.0.13 147 2/24/2025
9.0.12 128 2/23/2025
9.0.11 150 2/14/2025
9.0.10 149 2/13/2025
9.0.9 164 2/12/2025
9.0.8 155 2/1/2025
9.0.7 138 2/1/2025
9.0.6 137 1/28/2025
9.0.5 150 1/17/2025
9.0.4 123 1/16/2025
9.0.3 98 1/15/2025
9.0.2 154 1/1/2025
9.0.1 133 12/31/2024
9.0.0 155 12/30/2024
8.0.49 134 12/30/2024
8.0.48 143 12/24/2024
8.0.47 150 12/1/2024
8.0.46 135 11/13/2024
8.0.45 159 11/12/2024
8.0.44 154 11/10/2024
8.0.43 143 10/29/2024
8.0.42 124 10/28/2024
8.0.41 157 10/26/2024
8.0.40 154 10/25/2024
8.0.39 148 10/24/2024
8.0.38 150 10/11/2024
8.0.37 151 10/10/2024
8.0.36 153 10/9/2024
8.0.34 152 10/2/2024
8.0.33 141 9/27/2024
8.0.32 147 9/23/2024
8.0.31 170 9/14/2024
8.0.30 194 9/2/2024
8.0.29 168 8/31/2024
8.0.28 179 8/20/2024
8.0.27 177 8/18/2024
8.0.26 173 8/1/2024
8.0.25 166 7/15/2024
8.0.24 142 7/10/2024
8.0.23 164 7/8/2024
8.0.22 177 7/7/2024
8.0.21 179 7/1/2024
8.0.20 172 6/29/2024
8.0.19 176 6/27/2024
8.0.18 171 6/17/2024
8.0.17 153 6/14/2024
8.0.16 138 6/13/2024
8.0.15 151 6/9/2024
8.0.14 152 6/8/2024
8.0.13 152 6/5/2024
8.0.12 156 5/16/2024
8.0.11 197 5/4/2024
8.0.10 244 3/31/2024
8.0.8 215 3/31/2024
8.0.7 237 3/28/2024
8.0.6 225 3/17/2024
8.0.5 234 3/17/2024
8.0.4 266 3/17/2024
8.0.3 264 3/15/2024
8.0.2 248 2/28/2024
8.0.1 248 2/19/2024
8.0.0 224 2/19/2024
7.0.47 249 2/15/2024
7.0.46 230 2/5/2024
7.0.45 227 2/4/2024