This is a short guide on how to consume packages from my GitHub packages feed. The official docs are here.

Notes:

  • How to find your NuGet.Config
  • My feed URL: https://nuget.pkg.github.com/LordMike/index.json
  • You must authenticate using a GitHub access token with read:packages permission — create one here.
  • The config file must exist — use dotnet new nugetconfig to create it.

Method A: Add source user-wide (CLI)

dotnet new nugetconfig

dotnet nuget add source \
  -n gh-lordmike \
  https://nuget.pkg.github.com/LordMike/index.json \
  -u MyGithubUser \
  -p MyGithubToken

This adds a user-wide source, allowing all projects to consume from it. On Windows, the password is encrypted on disk.

Method B: Add source to individual project

You can add the config to a single project with a local NuGet.Config file:

dotnet new nugetconfig

dotnet nuget add source \
  -n gh-lordmike \
  https://nuget.pkg.github.com/LordMike/index.json \
  --configfile NuGet.Config \
  -u MyGithubUser \
  -p MyGithubToken

Note on Sharing

If you share the NuGet.Config file across multiple machines, auth may fail since the token is encrypted. You can optionally store it in plain text:

--store-password-in-clear-text

This is fine for read-only tokens with the read:packages scope (recommended).

Happy packaging! 📦