sources command (NuGet CLI)
Applies to: package consumption, publishing • Supported versions: all
Manages the list of sources located in the user scope configuration file or a specified configuration file. The user scope configuration file is located at
%appdata%\NuGet\NuGet.Config (Windows) and
Note that the source URL for nuget.org is
nuget sources <operation> -Name <name> -Source <source>
<operation> is one of List, Add, Remove, Enable, Disable, or Update,
<name> is the name of the source, and
<source> is the source's URL. You can operate on only one source at a time.
The NuGet configuration file to apply. If not specified,
~/.config/NuGet/NuGet.Config(Mac/Linux) is used.
(3.5+) Forces nuget.exe to run using an invariant, English-based culture.
Applies to the
listaction and can be
Detailed(the default) or
Displays help information for the command.
Name of the source.
Suppresses prompts for user input or confirmations.
Specifies the password for authenticating with the source.
Path to the package(s) source.
Indicates to store the password in unencrypted text instead of the default behavior of storing an encrypted form.
Specifies the user name for authenticating with the source.
Comma-separated list of valid authentication types for this source. By default, all authentication types are valid. Example:
Specifies the amount of detail displayed in the output:
Make sure to add the sources' password under the same user context as the nuget.exe is later used to access the package source. The password will be stored encrypted in the config file and can only be decrypted in the same user context as it was encrypted. So for example when you use a build server to restore NuGet packages the password must be encrypted with the same Windows user under which the build server task will run.
Also see Environment variables
nuget sources Add -Name "MyServer" -Source \\myserver\packages nuget sources Disable -Name "MyServer" nuget sources Enable -Name "nuget.org" nuget sources add -name foo.bar -source C:\NuGet\local -username foo -password bar -StorePasswordInClearText -configfile %AppData%\NuGet\my.config
Submit and view feedback for