sources command (NuGet CLI)

In this article

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 in Windows and at ~/.nuget/NuGet.Config in Mac/Linux.

Note that the source URL for nuget.org is https://api.nuget.org/v3/index.json.

Usage

nuget sources <operation> -Name <name> -Source <source>

where <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.

Options

Option

Description

ConfigFile

The NuGet configuration file to apply. If not specified, %AppData%\NuGet\NuGet.Config is used.

ForceEnglishOutput

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

Format

Applies to the list action and can be Detailed (the default) or Short.

Help

Displays help information for the command.

NonInteractive

Suppresses prompts for user input or confirmations.

Password

Specifies the password for authenticating with the source.

StorePasswordInClearText

Indicates to store the password in unencrypted text instead of the default behavior of storing an encrypted form.

UserName

Specifies the user name for authenticating with the source.

Verbosity

Specifies the amount of detail displayed in the output: normal, quiet, detailed.

Note

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.

The feedback system for this content will be changing soon. Old comments will not be carried over. If content within a comment thread is important to you, please save a copy. For more information on the upcoming change, we invite you to read our blog post.