jaytwo.NuGetCheck.GlobalTool 0.3.2

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

jaytwo.NuGetCheck

A .NET Core Tool (and docker image) that can check to see if a NuGet package/version has already been published.

I use this in my CI pipelines to fail a build in which I forget to bump the version.

Installation

dotnet tool install -g jaytwo.NuGetCheck

Normal Usage

To view help:

nugetcheck --help

To see if the package xunit has any published versions greater than or equal to 2.0.0 and less than 3.0.0, run the following command:

nugetcheck xunit -gte 2.0.0 --same-major

To see if the package xunit has any published versions greater than or equal to 2.0.0 and less than 2.1.0, run the following command:

nugetcheck xunit -gte 2.0.0 --same-minor

For any .NET Core Global Tools to work, your path needs to include ~/.dotnet/tools

Normal Exit Codes

If there are no results, the process exits with code -1 (fail).

If there are results, the process exits with code 0 (success).

If there is an exception, the process exits with code 1 (fail).

Opposite Day Exit Codes

Since the main use case for this tool is to fail CI if I forgot to bump the version, I want to fail when there are versions found. Just use the option --fail-on-match.

If there are no results, the process exits with code 0 (success).

If there are results, the process exits with code -1 (fail).

If there is an exception, the process exits with code 1 (fail).

# This will fail if `xunit` has any published versions greater than or equal to `2.0.0` and less than `2.1.0`:
nugetcheck xunit -gte 2.0.0 --same-minor --fail-on-match

Docker Usage

Sometimes the easiest way to use someting is in a docker image. To see if the package has any published versions greater than or equal to 2.0.0 and less than 3.0.0, run the following command:

docker run --rm jakegough/jaytwo.nugetcheck xunit -gte 2.0.0 --same-major

If you want to start the container with an interactive terminal, you'll need to override the entrypoint.
For example, when I run this in Jenkins. It's easier to use this with a docker.image().inside() and use the automagically mounted nupkg files. The command inside the container is nugetcheck.

docker run -it --rm --entrypoint sh jakegough/jaytwo.nugetcheck

# then inside the container
nugetcheck xunit -gte 2.0.0 --same-major
Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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. 
.NET Core netcoreapp3.1 is compatible. 
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
0.3.2 416 9/15/2025
0.3.2-beta-20250915092108 268 9/15/2025
0.3.1 518 4/8/2025
0.3.1-beta-20250408155141 193 4/8/2025
0.3.0 212 4/7/2025
0.3.0-beta-20250406234125 205 4/7/2025
0.3.0-beta-20250406160650 224 4/6/2025