Skip to content

Publish as dotnet tool on NuGet #19

@chrisyarbrough

Description

@chrisyarbrough

https://tedspence.com/publishing-a-dotnet-tool-on-nuget-e1df7909ec5a

  1. .NET Tool packages - The recommended approach for CLI tools. These are installed globally or locally using dotnet tool install. They automatically add the tool to PATH and handle versioning well. You specify true in your .csproj.
  2. Regular packages with tools folder - You can include executables in the tools folder of a NuGet package. This is the older approach but still used.
  3. Build-integrated packages - Packages that copy binaries to the output directory during build.

Many popular CLI tools are distributed via NuGet:

  • Entity Framework Core tools (dotnet-ef)
  • Various code generators
  • Build and deployment tools
  • Development utilities

For a .NET CLI tool specifically, the .NET Tool format is definitely the modern standard and provides the best user experience. Users can install with:
dotnet tool install -g YourToolName

Metadata

Metadata

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions