| title | NuGet CLI config command |
|---|---|
| description | Reference for the nuget.exe config command |
| author | JonDouglas |
| ms.author | jodou |
| ms.date | 01/18/2018 |
| ms.topic | reference |
Applies to: all • Supported versions: all
Gets or sets NuGet configuration values. For additional usage, see Common NuGet configurations. For details on allowable key names, refer to the NuGet config file reference.
nuget config -Set <name>=[<value>] [<name>=<value> ...] [options]
nuget config -AsPath <name> [options]
where <name> and <value> specify a key-value pair to be set in the configuration. You can specify as many pairs as desired. To remove a value, specify the name and the = sign but no value.
For allowable key names, see the NuGet config file reference.
In NuGet 3.4+, <value> can use environment variables.
-
AsPathReturns the config value as a path, ignored when
-Setis used. -
-ConfigFileThe NuGet configuration file to apply. If not specified,
%AppData%\NuGet\NuGet.Config(Windows), or~/.nuget/NuGet/NuGet.Configor~/.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.
-
-?|-helpDisplays help information for the command.
-
-NonInteractiveSuppresses prompts for user input or confirmations.
-
-SetOne on more key-value pairs to be set in config.
-
-Verbosity [normal|quiet|detailed]Specifies the amount of detail displayed in the output:
normal(the default),quiet, ordetailed.
Also see Environment variables
nuget config -Set repositoryPath=c:\packages -configfile c:\my.config
nuget config -Set repositoryPath=
nuget config -Set repositoryPath=%PACKAGE_REPO% -configfile %ProgramData%\NuGet\NuGetDefaults.Config
nuget config -Set HTTP_PROXY=http://127.0.0.1 -set HTTP_PROXY.USER=domain\user