豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content

Latest commit

 

History

History
64 lines (40 loc) · 2.07 KB

File metadata and controls

64 lines (40 loc) · 2.07 KB
title NuGet CLI setapikey command
description Reference for the nuget.exe setapikey command
author JonDouglas
ms.author jodou
ms.date 01/18/2018
ms.topic reference

setapikey command (NuGet CLI)

Applies to: publishing • Supported versions: all

Saves an API key for a given server URL into NuGet.Config so that it doesn't need to be entered for subsequent push commands.

Usage

nuget setapikey <key> -Source <url> [options]

where <source> identifies the server and <key> is the key to save. If <source> is omitted, nuget.org is assumed.

Note

API key is not used for authenticating with the private feed. Refer to nuget sources command to manage credentials for authenticating with the source. API keys can be obtained from the individual NuGet servers. To create and manage APIKeys for nuget.org refer to acquire-an-api-key.

Options

  • -ConfigFile

    The NuGet configuration file to apply. If not specified, %AppData%\NuGet\NuGet.Config (Windows), or ~/.nuget/NuGet/NuGet.Config or ~/.config/NuGet/NuGet.Config (Mac/Linux) is used. See On Mac/Linux, the user-level config file location varies by tooling..

  • -ForceEnglishOutput

    (3.5+) Forces nuget.exe to run using an invariant, English-based culture.

  • -?|-help

    Displays help information for the command.

  • -NonInteractive

    Suppresses prompts for user input or confirmations.

  • -src|-Source

    Server URL where the API key is valid.

  • -Verbosity [normal|quiet|detailed]

    Specifies the amount of detail displayed in the output: normal (the default), quiet, or detailed.

Also see Environment variables

Examples

nuget setapikey 4003d786-cc37-4004-bfdf-c4f3e8ef9b3a

nuget setapikey 4003d786-cc37-4004-bfdf-c4f3e8ef9b3a -source https://example.com/nugetfeed