Skip to content

Commit 6da1fc4

Browse files
authored
Created reference page for NuGet CLI's search command
1 parent 6097fe4 commit 6da1fc4

File tree

1 file changed

+65
-0
lines changed

1 file changed

+65
-0
lines changed
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
---
2+
title: NuGet CLI search command
3+
description: Reference for the nuget.exe search command
4+
author: advay26
5+
ms.author: t-adtand
6+
ms.date: 07/07/2020
7+
ms.topic: reference
8+
---
9+
10+
# search command (NuGet CLI)
11+
12+
**Applies to:** package consumption • **Supported versions:** all
13+
14+
Searches a given source using the query string provided. If no sources are specified, all sources defined in %AppData%\NuGet\NuGet.config are used.
15+
16+
## Usage
17+
18+
```cli
19+
nuget search [search terms] [options]
20+
```
21+
22+
where the search terms are applied to the names of packages, tags, and package descriptions just as they are when using them on nuget.org.
23+
24+
## Options
25+
26+
| Name | Description | Usage |
27+
| --- | --- | :-: |
28+
| PreRelease | Pre-release packages are not included by default, but can be included by using this argument | -PreRelease |
29+
| Source | Specific package source(s) to search instead of querying the default sources in __nuget.config__ | -Source `<Source URL>`|
30+
| Take | The number of results to return. The default value is 20. | -Take `<positive integer>` |
31+
| Verbosity | The level of detail to display in the output. The default is _normal_. (See the note below) | -Verbosity `<quiet\|normal\|detailed>` |
32+
| Help | Displays help information for the command | -Help |
33+
34+
Also see [Environment variables](cli-ref-environment-variables.md)
35+
36+
__NOTE__
37+
38+
Verbosity Levels:
39+
40+
* _quiet_ - Package ID, Version
41+
* _normal_ - Package ID, Version, Downloads, Preview of Description
42+
* _detailed_ - Package ID, Version, Downloads, Full Description, Other information such as the query URL
43+
44+
## Examples
45+
46+
Search for *logging*-related packages from default sources:
47+
```
48+
nuget search logging
49+
```
50+
Search for *logging*-related packages with detailed verbosity:
51+
```
52+
nuget search logging -Verbosity detailed
53+
```
54+
Search for *logging*-related packages, and only show the top 5 results:
55+
```
56+
nuget search logging -Take 5
57+
```
58+
Search for *JSON*-related packages, including pre-release versions, from specified source/feed:
59+
```
60+
nuget search JSON -PreRelease -Source "https://api.nuget.org/v3/index.json"
61+
```
62+
Search for *JSON*-related packages from multiple sources/feeds:
63+
```
64+
nuget search JSON -Source "https://api.nuget.org/v3/index.json" -Source "https://other-feed-url-goes-here"
65+
```

0 commit comments

Comments
 (0)