NuGet CLI sources command (original) (raw)

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 ~/.nuget/NuGet/NuGet.Config (Mac/Linux).

Note

Use package sources that you trust.

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. You can operate on only one source at a time.

Options

Also see Environment variables

Examples

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

nuget sources add -name MyAzureDevOpsSource -source "https://pkgs.dev.azure.com/yourorgname/yourprojectname/_packaging/yourfeedname/nuget/v3/index.json" -username ignored -password <Personal Access Token>

nuget sources Update -Name "nuget.org" -ProtocolVersion 3