The Cloudsmith Developer Hub

Welcome to the Cloudsmith Developer Hub. You'll find comprehensive guides and documentation to help you start working with Cloudsmith as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    

NuGet Feed

Cloudsmith provides public & private feeds for NuGet

NuGet is an open-source package manager designed for the Microsoft development technologies.

For more information on NuGet, please see:

Contextual Documentation

The examples in this document are generic. Cloudsmith provides contextual setup instructions within each repository, complete with copy n' paste snippets (with your namespace/repo pre-configured).

In the following examples:

Identifier

Description

OWNER

Your Cloudsmith account name or organisation name (namespace)

REPOSITORY

Your Cloudsmith Repository name (also called "slug")

TOKEN

Your Cloudsmith Entitlement Token (see Entitlements for more details)

USERNAME

Your Cloudsmith username

PASSWORD

Your Cloudsmith password

API-KEY

Your Cloudsmith API Key

PACKAGE_NAME

The name of your package

PACKAGE_VERSION

The version number of your package


Upload a Package

Before you can upload, you need to create your NuGet package using the NuGet CLI or the .NET Core CLI:

📘

This assumes that you've created a compatible project.csproj file for your project.

nuget pack
donet pack

This generates a nupkg (.nupkg) file like your-package-1.2.3.nupkg that you can upload.

Upload via native NuGet Tooling

The endpoint for the native NuGet API is:

https://nuget.cloudsmith.io/OWNER/REPOSITORY/

You can upload your package using the NuGet CLI or the .NET Core CLI.

NuGet CLI
You can publish a nupkg file that you've generated from your project, using nuget.
As a shortcut, you can set up the source (upstream) ahead of time, using nuget source:

nuget sources add -Name example-repo -Source https://nuget.cloudsmith.io/OWNER/REPOSITORY/v3/index.json

Then you can publish your package using:

nuget push PACKAGE_NAME-PACKAGE_VERSION.nupkg -Source example-repo -ApiKey API-KEY

.NET Core CLI
You can publish a nupkg file that you've generated from your project, using dotnet:

dotnet nuget push PACKAGE_NAME-VERSION.nupkg -k API-KEY -s https://nuget.cloudsmith.io/OWNER/REPOSITORY/v3/index.json

Upload via the Cloudsmith CLI

For full details of how to install and setup the Cloudsmith CLI, see Command Line Interface.

The command to upload a NuGet package via the Cloudsmith CLI is:

cloudsmith push nuget OWNER/REPOSITORY PACKAGE_NAME-PACKAGE_VERSION.nupkg

Example:

cloudsmith push nuget your-account/your-repo your-package-1.0.0.nupkg

Upload via Cloudsmith Website

Please see Upload a Package for details of how to upload via the Website UI.

Example Project

For examples of what your project should look like for packaging and publishing/uploading, please have a look at our examples repository (on GitHub). We'll supplement these with more detailed guidance later, but otherwise just ask, we're here to help!


Download / Install a Package

Setup

To consume packages in NuGet from a Cloudsmith NuGet Feed , you'll need to configure it as a source:

Public Repositories

NuGet CLI

nuget sources add -Name example-repo -Source https://nuget.cloudsmith.io/OWNER/REPOSITORY/v3/index.json

.NET Core CLI
When specifying the source in commands via -s, use the following URL:

https://nuget.cloudsmith.io/OWNER/REPOSITORY/v3/index.json

Paket CLI
You can add the source to your paket.dependencies file:

source https://nuget.cloudsmith.io/OWNER/REPOSITORY/v3/index.json

If you don't want to check your username into source control, you can use environment variables instead

VS Package Manager (PM)
When specifying the source in commands via -Source, use the following URL:

https://nuget.cloudsmith.io/OWNER/REPOSITORY/v3/index.json

Private Repositories

📘

Private Cloudsmith repositories require authentication. You can choose between two types of authentication, Entitlement Token Authentication or HTTP Basic Authentication.

The setup method will differ depending on what authentication type you choose to use.

NuGet CLI

nuget sources add -Name example-repo -Source https://nuget.cloudsmith.io/OWNER/REPOSITORY/v3/index.json -Username token -Password TOKEN -StorePasswordInClearText
nuget sources add -Name example-repo -Source https://nuget.cloudsmith.io/OWNER/REPOSITORY/v3/index.json -Username USERNAME -Password PASSWORD -StorePasswordInClearText
nuget sources add -Name example-repo -Source https://nuget.cloudsmith.io/OWNER/REPOSITORY/v3/index.json -Username USERNAME -Password API-KEY -StorePasswordInClearText
nuget sources add -Name example-repo -Source https://nuget.cloudsmith.io/OWNER/REPOSITORY/v3/index.json -Username token -Password TOKEN -StorePasswordInClearText

.NET Core CLI
When specifying the source in commands via -s, use the following URL:

https://token:[email protected]/OWNER/REPOSITORY/v3/index.json
https://USERNAME:[email protected]/OWNER/REPOSITORY/v3/index.json
https://USERNAME:[email protected]/OWNER/REPOSITORY/v3/index.json
https://token:[email protected]/OWNER/REPOSITORY/v3/index.json

Paket CLI
You can add the source to your paket.dependencies file:

source https://nuget.cloudsmith.io/OWNER/REPOSITORY/v3/index.json username: "token" password: "TOKEN" authtype: "basic"
source https://nuget.cloudsmith.io/demo/examples-repo/v3/index.json username: "USERNAME" password: "PASSWORD" authtype: "basic"
source https://nuget.cloudsmith.io/demo/examples-repo/v3/index.json username: "USERNAME" password: "API-KEY" authtype: "basic"
source https://nuget.cloudsmith.io/demo/examples-repo/v3/index.json username: "token" password: "TOKEN" authtype: "basic"

If you don't want to check your username into source control, you can use environment variables instead.

VS Package Manager (PM)
When specifying the source in commands via -Source, use the following URL:

https://nuget.cloudsmith.io/demo/examples-repo/v3/index.json
https://USERNAME:[email protected]/demo/examples-repo/v3/index.json
https://USERNAME:[email protected]/demo/examples-repo/v3/index.json
https://token:[email protected]/demo/examples-repo/v3/index.json

Install a Package

To install the latest version of a package you would use:

NuGet CLI

nuget install PACKAGE_NAME -Source example-repo -DependencyVersion Highest

.NET Core CLI

dotnet add package PACKAGE_NAME -s https://nuget.cloudsmith.io/OWNER/REPOSITOY/v3/index.json

Paket CLI

paket add nuget PACKAGE_NAME

VS Package Manager (PM)

Install-Package PACKAGE_NAME -Source example-repo

Current Limitations

The Cloudsmith NuGet feed implementation currently has the following limitations:

  • The maximum size per-package file is currently limited to 200MiB (100 megabytes), but only when utilising the native nuget-cli for publishing. If uploading using the cloudsmith-cli, then the absolute maximum size per-package file limit will be the standard 5GiB.
  • Only the v3 API for NuGet is currently implemented; v2 is partially implemented.
  • Symbol packages are supported (and parsed), but symbol server is not yet supported.

Follow our roadmap for development progress.


Upstream Proxying / Caching

Not Supported


Troubleshooting

Please see the Troubleshooting NuGet page for further help and information.

Updated 2 months ago


NuGet Feed


Cloudsmith provides public & private feeds for NuGet

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.