dotnet 工具搜索

本文适用于:✔️ .NET 6 SDK 及更高版本

Name

dotnet tool search - 搜索发布到 NuGet 的所有 .NET 工具

概要

dotnet tool search [--detail]  [--prerelease]
    [--skip <NUMBER>] [--take <NUMBER>] <SEARCH TERM>

dotnet tool search -h|--help

Description

dotnet tool search 命令提供了一种方法,用于搜索 NuGet 以获取可用作 .NET 全局工具、工具路径或本地工具的工具。 该命令搜索工具名称和元数据,例如标题、说明和标记。

该命令使用 NuGet 搜索 API。 它将筛选 packageType=dotnettool 为仅选择 .NET 工具包。

选项

  • --detail

    显示查询的详细结果。

  • --prerelease

    包括预发行包。

  • --skip <NUMBER>

    指定要跳过的查询结果数。 用于分页。

  • --take <NUMBER>

    指定要显示的查询结果数。 用于分页。

  • -?|-h|--help

    打印出有关如何使用命令的说明。

例子

  • 在其包名称或说明中搜索具有“format”的 .NET 工具 NuGet.org:

    dotnet tool search format
    

    输出如下所示:

    Package ID                              Latest Version      Authors                                                                     Downloads      Verified
    ---------------------------------------------------------------------------------------------------------------------------------------------------------------
    dotnet-format                           4.1.131201          Microsoft                                                                   496746
    bsoa.generator                          1.0.0               Microsoft                                                                   533
    
  • 在包名称或元数据中搜索具有“format”的 .NET 工具 NuGet.org,仅显示第一个结果,并显示详细视图。

    dotnet tool search format --take 1 --detail
    

    输出如下所示:

    ----------------
    dotnet-format
    Latest Version: 4.1.131201
    Authors: Microsoft
    Tags:
    Downloads: 496746
    Verified: False
    Description: Command line tool for formatting C# and Visual Basic code files based on .editorconfig settings.
    Versions:
            3.0.2 Downloads: 1973
            3.0.4 Downloads: 9064
            3.1.37601 Downloads: 114730
            3.2.107702 Downloads: 13423
            3.3.111304 Downloads: 131195
            4.0.130203 Downloads: 78610
            4.1.131201 Downloads: 145927
    

另请参阅