Skip to content

Commit 469bef3

Browse files
JiaqiWang18tdykstraIEvangelist
authored
Tool list package id feature doc update (#31805)
* modify dotnet-tool-list.md * modify global-tools.md * Update docs/core/tools/dotnet-tool-list.md Co-authored-by: Tom Dykstra <tdykstra@microsoft.com> * Update docs/core/tools/dotnet-tool-list.md Co-authored-by: Tom Dykstra <tdykstra@microsoft.com> Co-authored-by: Tom Dykstra <tdykstra@microsoft.com> Co-authored-by: David Pine <david.pine@microsoft.com>
1 parent 98f2a7e commit 469bef3

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

docs/core/tools/dotnet-tool-list.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,27 @@ dotnet tool list --tool-path <PATH>
2020
2121
dotnet tool list --local
2222
23+
dotnet tool list [<PACKAGE_ID>]
24+
2325
dotnet tool list
2426
2527
dotnet tool list -h|--help
2628
```
2729

2830
## Description
2931

30-
The `dotnet tool list` command provides a way for you to list all .NET global, tool-path, or local tools installed on your machine. The command lists the package name, version installed, and the tool command. To use the command, you specify one of the following:
32+
The `dotnet tool list` command provides a way for you to list .NET global, tool-path, or local tools installed on your machine. The command lists the package name, version installed, and the tool command. To use the command, you specify one of the following:
3133

3234
* To list global tools installed in the default location, use the `--global` option
3335
* To list global tools installed in a custom location, use the `--tool-path` option.
3436
* To list local tools, use the `--local` option or omit the `--global`, `--tool-path`, and `--local` options.
37+
* To list a specific tool, use the optional `PACKAGE_ID` argument.
38+
39+
## Arguments
40+
41+
- **`PACKAGE_ID`**
42+
43+
Lists the tool that has the supplied package ID if the tool is installed. Can be used in conjunction with options. Provides a way to check if a specific tool was installed. The command returns 1 if no tool with the specified package ID is found; returns 0 otherwise.
3544

3645
## Options
3746

@@ -67,6 +76,14 @@ The `dotnet tool list` command provides a way for you to list all .NET global, t
6776

6877
Lists all local tools available in the current directory.
6978

79+
- **`dotnet tool list -g dotnetsay`**
80+
81+
Lists the global tool with the package id [dotnetsay](https://www.nuget.org/packages/dotnetsay/)
82+
83+
- **`dotnet tool list dotnetsay`**
84+
85+
Lists the local tool with the package id [dotnetsay](https://www.nuget.org/packages/dotnetsay/)
86+
7087
## See also
7188

7289
- [.NET tools](global-tools.md)

docs/core/tools/global-tools.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,20 @@ dotnetsay 2.1.3 dotnetsay /home/name/repository/.config/dotnet
189189

190190
As shown in the preceding example, the list shows local tools. To see global tools, use the `--global` option. To see tool-path tools, use the `--tool-path` option.
191191

192+
To list a specific tool, use the [dotnet tool list <PACKAGE_ID>](dotnet-tool-list.md) command:
193+
194+
```dotnetcli
195+
dotnet tool list dotnetsay
196+
```
197+
198+
The output will be only contain information of that tool if it is installed, similar to the following example:
199+
200+
```console
201+
Package Id Version Commands Manifest
202+
-------------------------------------------------------------------------------------------
203+
dotnetsay 2.1.3 dotnetsay /home/name/repository/.config/dotnet-tools.json
204+
```
205+
192206
### Invoke a global tool
193207

194208
For global tools, use the tool command by itself. For example, if the command is `dotnetsay` or `dotnet-doc`, that's what you use to invoke the global tool:

0 commit comments

Comments
 (0)