Skip to content
Latchkey

dotnet tool install: Install .NET CLI Tools

dotnet tool install downloads and installs a .NET CLI tool, either globally, into a specific path, or into the local tool manifest.

CI jobs often need tools like dotnet-ef, coverlet, or reportgenerator. install puts them on the runner; local manifests make that reproducible.

What it does

dotnet tool install fetches a tool package and installs it. --global puts it on the user PATH, --tool-path installs to a directory you control, and the local form (no --global) adds it to the repo manifest .config/dotnet-tools.json.

Common usage

Terminal
dotnet tool install --global dotnet-ef --version 8.0.0
dotnet tool install --tool-path ./tools dotnet-reportgenerator-globaltool
dotnet new tool-manifest        # then:
dotnet tool install dotnet-ef   # adds to .config/dotnet-tools.json

Options

FlagWhat it does
-g, --globalInstall as a global tool on the user PATH
--tool-path <dir>Install into a specific directory (no PATH change)
--version <ver>Pin a specific tool version
--localInstall into the local tool manifest (default when no --global)
--configfile <file>NuGet.config to resolve the tool package from

In CI

Prefer a local manifest committed to the repo plus dotnet tool restore so every run installs the exact pinned versions. If you do install --global, the tools land in ~/.dotnet/tools, which is not always on PATH on a fresh runner; add it (export PATH="$PATH:$HOME/.dotnet/tools") or use --tool-path and call the binary by full path.

Common errors in CI

"Could not execute because the specified command or file was not found" after a --global install means ~/.dotnet/tools is not on PATH. NU1101 ("Unable to find package <tool>") means the tool id is wrong or the feed is not configured. "Tool 'X' is already installed" means it exists; use dotnet tool update instead, or --version to change it.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →