dotnet-tool-install(1)

πŸ“¦
version 11.0.0~rc3 Β· 6 versions
, in alpine 3.24, centos-stream 10, centos-stream 9, fedora 43, fedora 44, nixpkgs unstable, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– dotnet-tool-install πŸ’–

okay bestie, welcome to the manual page for dotnet-tool-install, straight outta the .NET Documentation. this is the one that puts .NET tools on your machine. let's go 🫢

This article applies to: βœ”οΈ .NET 6 SDK and later versions


🌸 NAME 🌸

dotnet-tool-install β€” installs the specified .NET tool on your machine. that's it, that's the job πŸ’…


✨ SYNOPSIS ✨

dotnet tool install <PACKAGE_NAME> -g|--global
    [--allow-downgrade] [--allow-roll-forward] [-a|--arch <ARCHITECTURE>]
    [--add-source <SOURCE>] [--configfile <FILE>] [--disable-parallel]
    [--framework <FRAMEWORK>] [--ignore-failed-sources] [--interactive]
    [--no-cache] [--prerelease]
    [--tool-manifest <PATH>] [-v|--verbosity <LEVEL>]
    [--version <VERSION_NUMBER>]

dotnet tool install <PACKAGE_NAME> --tool-path <PATH>
    [--allow-downgrade] [--allow-roll-forward] [-a|--arch <ARCHITECTURE>]
    [--add-source <SOURCE>] [--configfile <FILE>] [--disable-parallel]
    [--framework <FRAMEWORK>] [--ignore-failed-sources] [--interactive]
    [--no-cache] [--prerelease]
    [--tool-manifest <PATH>] [-v|--verbosity <LEVEL>]
    [--version <VERSION_NUMBER>]

dotnet tool install <PACKAGE_NAME> [--local]
    [--allow-downgrade] [--allow-roll-forward] [-a|--arch <ARCHITECTURE>]
    [--add-source <SOURCE>] [--configfile <FILE>]
    [--create-manifest-if-needed] [--disable-parallel]
    [--framework <FRAMEWORK>] [--ignore-failed-sources] [--interactive]
    [--no-cache] [--prerelease]
    [--tool-manifest <PATH>] [-v|--verbosity <LEVEL>]
    [--version <VERSION_NUMBER>]

dotnet tool install -h|--help

πŸ¦‹ DESCRIPTION πŸ¦‹

the dotnet tool install command is literally your way to install .NET tools on your machine. to use it, you pick one of these installation options, no cap:

  • to install a global tool in the default location, use the --global option. set it and forget it energy ✨
  • to install a global tool in a custom location, use the --tool-path option. main character, choosing her own path πŸ’…
  • to install a local tool, just... omit the --global and --tool-path options. that's the whole trick, bestie.
[!WARNING] make sure the directory you specify with the --tool-path option is secure. tools installed in this location can be executed directly, so using an untrusted or shared path might introduce security risks. do not play with this one fr fr 😭

πŸ“ Installation locations

🌍 Global tools

global tools get installed in these directories by default when you specify the -g or --global option:

  • Linux/macOS β€” $HOME/.dotnet/tools
  • Windows β€” %USERPROFILE%\.dotnet\tools

executables are generated in these folders for each globally installed tool, although the actual tool binaries are nested deep into the sibling .store directory. sneaky little guys 🫣

on Linux, after installing a command-line tool with dotnet tool, the tool can be executed only from the $HOME/.dotnet/tools path. to make the tool executable from any directory, update the PATH environment variable. to make the updated PATH environment variable permanent in your shell, update your shell settings. for Bash, this is the $HOME/.bashrc file. ✨ go edit it, you got this.

🧰 --tool-path tools

tools with explicit tool paths are stored wherever you specified the --tool-path parameter to point to. they're stored in the same way as global tools: an executable binary with the actual binaries in a sibling .store directory. same vibe, different address πŸ’–

🏠 Local tools

local tools are stored in the NuGet global directory, whatever you've set that to be. there are shim files in $HOME/.dotnet/toolResolverCache for each local tool that point to where the tools are within that location. shims = the little matchmakers πŸŽ€

references to local tools are added to a dotnet-tools.json file in a .config directory under the current directory. starting in .NET 10, if a manifest file doesn't exist yet, one is created automatically. you can also create one manually by running this command:

dotnet new tool-manifest

for more information, see Install a local tool.


πŸ“ ARGUMENTS πŸ“

  • PACKAGE_NAME β€” name/ID of the NuGet package that contains the .NET tool to install. the ID of the thing you want, basically.

πŸ‘‘ OPTIONS πŸ‘‘

  • --allow-downgrade β€” allow package downgrade when installing or updating a .NET tool package. suppresses the warning, "The requested version x.x.x is lower than existing version x.x.x." yes she's going backwards, let her 🫢
  • --allow-roll-forward β€” available starting with .NET 9.0 SDK. allow tool to use a newer version of the .NET runtime if the runtime it targets isn't installed. future-proofing behavior πŸ’…
  • -a|--arch <ARCHITECTURE> β€” specifies the target architecture. this is a shorthand syntax for setting the Runtime Identifier (RID), where the provided value is combined with the default RID. for example, on a win-x64 machine, specifying --arch x86 sets the RID to win-x86. cute little abbreviation ✨
  • --add-source <SOURCE> β€” adds an additional NuGet package source to use during installation. feeds are accessed in parallel, not sequentially in some order of precedence. if the same package and version is in multiple feeds, the fastest feed wins. it's giving race day 🏁 for more information, see What happens when a NuGet package is installed?.
  • --configfile <FILE> β€” the NuGet configuration file (nuget.config) to use. if specified, only the settings from this file will be used. if not specified, the hierarchy of configuration files from the current directory will be used. for more information, see Common NuGet Configurations.
  • --create-manifest-if-needed β€” available starting in .NET 8 SDK. πŸŽ€

applies to local tools. to find a manifest, the search algorithm searches up the directory tree for dotnet-tools.json or a .config folder that contains a dotnet-tools.json file.

if a tool-manifest can't be found and the --create-manifest-if-needed option is set to false, the CannotFindAManifestFile error occurs. πŸ’€

if a tool-manifest can't be found and the --create-manifest-if-needed option is set to true (or, in .NET 10 and later versions, when not specified), the tool creates a manifest automatically. it chooses a folder for the manifest as follows:

  • walk up the directory tree searching for a directory that has a .git subfolder. if one is found, create the manifest in that directory.
  • if the previous step doesn't find a directory, walk up the directory tree searching for a directory that has a .sln or .git file. if one is found, create the manifest in that directory.
  • if neither of the previous two steps finds a directory, create the manifest in the current working directory.

for more information on how manifests are located, see Install a local tool.

starting in .NET 10, a manifest is created automatically if no tools manifest is found. this change can be a breaking change. you can opt out by passing --create-manifest-if-needed=false.

[!WARNING] don't run tool commands from the Downloads folder or any shared location. the CLI walks up the directory tree to find a tool manifest, which might cause it to use a manifest you don't expect. always run tool commands from a trusted, project-specific directory. πŸ™ˆ seriously, bestie, trust the vibe check on this one.
  • --disable-parallel β€” prevent restoring multiple projects in parallel. one at a time, we're being calm now 🧘
  • --framework <FRAMEWORK> β€” specifies the target framework to install the tool for. by default, the .NET SDK tries to choose the most appropriate target framework. she'll pick for you, she's good at it πŸ’…
  • -g|--global β€” specifies that the installation is user wide. can't be combined with the --tool-path option. omitting both --global and --tool-path specifies a local tool installation. pick a lane, not both 🌈
  • --source <SOURCE> β€” specifies the source for NuGet packages. this source replaces all NuGet package sources. not adds β€” replaces. read it twice πŸ”₯
  • -?|-h|--help β€” prints out a description of how to use the command. the classic cry for help, but helpful 🫢
  • --ignore-failed-sources β€” treat package source failures as warnings. she's unbothered, moisturized, in her lane ✨
  • --interactive β€” allows the command to stop and wait for user input or action. for example, to complete authentication. she's asking nicely πŸ™ˆ
  • --local β€” update the tool and the local tool manifest. can't be combined with the --global option or the --tool-path option. πŸ’–
  • --no-cache or --no-http-cache β€” don't cache packages and HTTP requests. fresh every single time, no leftovers πŸ“
  • --prerelease β€” include prerelease packages. living on the edge, iconic behavior πŸ’…
  • --tool-manifest <PATH> β€” path to the manifest file. that's it.
  • --tool-path <PATH> β€” specifies the location to install the Global Tool. PATH can be absolute or relative. if PATH doesn't exist, the command tries to create it. omitting both --global and --tool-path specifies a local tool installation. ✨
  • -v|--verbosity <LEVEL> β€” sets the verbosity level of the command. allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]. for more information, see <xref:Microsoft.Build.Framework.LoggerVerbosity>. pick your volume, girl πŸ”Š
  • --version <VERSION_NUMBER> β€” the version of the tool to install. by default, the latest stable package version is installed. use this option to install preview or older versions of the tool.

starting with .NET 8, --version Major.Minor.Patch refers to a specific major/minor/patch version, including unlisted versions. to get the latest version of a certain major/minor version instead, use --version Major.Minor.*. the asterisk is doing so much work here, periodt ⭐


🌈 EXAMPLES 🌈

  • dotnet tool install -g dotnetsay

installs dotnetsay (https://www.nuget.org/packages/dotnetsay/) as a global tool in the default location. ✨

  • dotnet tool install dotnetsay --tool-path c:\global-tools

installs dotnetsay (https://www.nuget.org/packages/dotnetsay/) as a global tool in a specific Windows directory. πŸͺŸ

  • dotnet tool install dotnetsay --tool-path ~/bin

installs dotnetsay (https://www.nuget.org/packages/dotnetsay/) as a global tool in a specific Linux/macOS directory. 🐧🍎

  • dotnet tool install -g dotnetsay --version 2.0.0

installs version 2.0.0 of dotnetsay (https://www.nuget.org/packages/dotnetsay/) as a global tool. throwback era πŸŽ€

  • dotnet tool install dotnetsay

installs dotnetsay (https://www.nuget.org/packages/dotnetsay/) as a local tool for the current directory. 🏠

  • dotnet tool install -g dotnetsay --verbosity minimal

installs dotnetsay (https://www.nuget.org/packages/dotnetsay/) as a global tool with the verbosity of minimal. the default verbosity for global tool is quiet. 🀫

  • dotnet tool install -g dotnetsay --allow-roll-forward

installs dotnetsay (https://www.nuget.org/packages/dotnetsay/) as a global tool and allows it to run on newer .NET versions if the target runtime isn't available. future-proof queen πŸ‘‘

🌈 SEE ALSO ✨

okay bestie you're done here but if you wanna keep going (and honestly? iconic of you), go peek at these:

  • πŸ’– .NET tools β€” the whole big-picture vibe of .NET tools, iykyk
  • πŸŽ€ Tutorial: Install and use a .NET global tool using the .NET CLI β€” step-by-step hand-holding for global tools, no cap
  • πŸ¦‹ Tutorial: Install and use a .NET local tool using the .NET CLI β€” same energy but local tools, and yes it's worth it fr fr

that's the whole page, bestie πŸ’… you officially know everything this manpage knows. it's from the dotnet-tool-install(1) manual, dated 2025-10-30 β€” go install something cute 🫢✨

πŸ“¦ where this page comes from