dotnet tool search

此文章適用於:✔️ .NET 5 SDK 與更新版本

名稱

dotnet tool search - 搜尋發佈至 NuGet 的所有 .NET 工具

概要

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

dotnet tool search -h|--help

描述

dotnet tool search 命令可供您搜尋 NuGet 找出可做為 .NET 全域、工具路徑或本機工具的工具。 此命令會搜尋工具名稱和中繼資料,例如標題、描述和標記。

此命令會使用 NuGet 搜尋 API。 這會篩選 packageType=dotnettool 而僅選取 .NET 工具套件。

選項。

  • --detail

    顯示查詢的詳細結果。

  • --prerelease

    包含發行前版本套件。

  • --skip <NUMBER>

    指定要略過的查詢結果數目。 用於分頁。

  • --take <NUMBER>

    指定要顯示的查詢結果數目。 用於分頁。

  • -?|-h|--help

    列印如何使用命令的描述。

範例

  • 搜尋 NuGet.org 找出套件名稱或描述中有「格式」的 .NET 工具:

    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
    
  • 搜尋 NuGet.org .NET 尋找套件名稱或中繼資料中有「格式」的工具、只顯示第一個結果,並顯示詳細檢視。

    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
    

另請參閱