Skip to content

Support nuget push scenarios in dotnet CLI

Drew Gillies edited this page Aug 4, 2016 · 4 revisions

Problem

dotnet CLI doesn't yet have a push scenario--the only way to effect a nuget push from the command line is by using the nuget CLI.

Who is the customer?

Package authors

Evidence

still amassing

Solution

nuget.exe push options are defined here: NuGet Push Command Options

The proposal is to insert a command into the dotnet CLI to target nuget, and push will be an option of that command (with the potential for other options). The dotnet CLI will route all arguments to the push command, ensuring behavior consistent with nuget.exe push.

Usage

dotnet nuget push <package path> [API key] [options]

Specify the path to the package and your API key to push the package to the server.

Options

apikey The API key for the server.
configfile (v2.5) Specifies the user specific configuration file. If omitted, nuget.config is used instead.
help Displays help information for the push command.
noninteractive Do not prompt for user input or confirmations.
source Specifies the server URL. This is a mandatory parameter unless the NuGet.config file specifies a DefaultPushSource value.
if dotnet nuget push identifies a UNC/folder source, it will copy the file to the source.
timeout Specifies the timeout for pushing to a server in seconds. Defaults to 300 seconds (5 minutes).
verbosity Specifies the amount of details displayed in the output: normal, quiet, (v2.5) detailed.

Examples

-Source is a mandatory parameter unless DefaultPushSource config value is set in the NuGet config file.
dotnet nuget push foo.nupkg 4003d786-cc37-4004-bfdf-c4f3e8ef9b3a -Source https://www.nuget.org/api/v2/package

dotnet nuget push foo.nupkg 4003d786-cc37-4004-bfdf-c4f3e8ef9b3a -Source https://www.nuget.org/api/v2/package

dotnet nuget push foo.nupkg 4003d786-cc37-4004-bfdf-c4f3e8ef9b3a

dotnet nuget push foo.nupkg 4003d786-cc37-4004-bfdf-c4f3e8ef9b3a -s http://customsource/

dotnet nuget push foo.nupkg

dotnet nuget push foo.symbols.nupkg

dotnet nuget push foo.nupkg -Timeout 360

dotnet nuget push *.nupkg

dotnet nuget push will support a UNC/Folder source:
dotnet nuget push -source \\mycompany\repo\ mypackage.1.0.0.nupkg

Contributing

What's Being Worked On?

Check out the proposals in the accepted & proposed folders on the repository, and active PRs for proposals being discussed today.

Common Problems

Clone this wiki locally