LinuxCommandLibrary

dotnet-tool

.NET CLI tool package manager

TLDR

Install global tool
$ dotnet tool install -g [tool-name]
copy
List global tools
$ dotnet tool list -g
copy
Update global tool
$ dotnet tool update -g [tool-name]
copy
Uninstall global tool
$ dotnet tool uninstall -g [tool-name]
copy
Install local tool
$ dotnet tool install [tool-name]
copy
Restore local tools
$ dotnet tool restore
copy

SYNOPSIS

dotnet tool command [options]

DESCRIPTION

dotnet tool manages .NET CLI tools, which are NuGet packages containing console applications. Tools can be installed globally (user-wide) or locally (project-specific).
Global tools are available from any directory and installed in a user-specific location. Local tools are specified in a manifest file (dotnet-tools.json) and installed per-project.
Popular tools include dotnet-ef (Entity Framework), dotnet-format (code formatting), and various analyzers and generators.

PARAMETERS

COMMAND

Operation: install, list, update, uninstall, restore.
install PACKAGE
Install tool package.
list
List installed tools.
update PACKAGE
Update tool to latest version.
uninstall PACKAGE
Remove tool.
restore
Restore local tools from manifest.
-g, --global
Global installation (user-wide).
--tool-path PATH
Custom installation directory.
--help
Display help information.

CONFIGURATION

dotnet-tools.json

Manifest file specifying local tool dependencies and versions for the project.

CAVEATS

Global tools may have version conflicts. Local tools require manifest restoration. Tool versions should match project requirements. PATH configuration needed for global tools.

HISTORY

dotnet tool was introduced in .NET Core 2.1 (2018) to provide extensibility through NuGet-distributed CLI tools, enabling ecosystem growth beyond the built-in commands.

SEE ALSO

dotnet(1), dotnet-ef(1), nuget(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard