LazyMagic

How to Configure GitHub Access for LazyMagic

⚡ Quick Answer

To configure GitHub access for LazyMagic: Create a GitHub Classic Personal Access Token with 'read:packages' scope, then create a NuGet.Config file in your User folder with your GitHub username and token to access LazyMagic packages.

Prerequisites

  • ✅ GitHub account
  • ⏱️ Estimated time: 5 minutes
  • 💰 Cost: Free

What is GitHub Access Configuration?

This step configures your workstation to access GitHub-hosted NuGet packages from the LazyMagicOrg repository. These packages are essential components used in the LazyMagic sample system.

Step-by-Step Configuration Guide

Step 1: Create a Personal Access Token (PAT)

You need a GitHub Personal Access Token to authenticate with the LazyMagicOrg package repository:

  1. Login to your GitHub account
  2. Navigate to Personal Access Tokens
  3. Click "Generate new token" or "Generate new token (classic)"
  4. Set the scope to read:packages (minimal required permissions)
  5. Copy the generated token (it will start with ghp_)

Security Note: Keep the scope of access as limited as possible. The read:packages scope is sufficient for LazyMagic.

Step 2: Create NuGet.Config File

Create a NuGet.Config file in your User folder to provide repository access credentials:

2.1 Navigate to User Folder

Open File Explorer and navigate to your User folder (typically C:\Users\YourUsername\)

2.2 Create the Configuration File

Create a new file named NuGet.Config with the following content:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <packageSources>
        <add key="LazyMagic" 
                value = "https://nuget.pkg.github.com/LazyMagicOrg/index.json" />
    </packageSources>
    <packageSourceCredentials>
        <LazyMagic>
            <add key="Username" value="meongithub" />
            <add key="ClearTextPassword" value="ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" />
            </LazyMagic>
    </packageSourceCredentials>
</configuration>

2.3 Update Credentials

Replace the following values in your NuGet.Config file:

  • meongithub → Your actual GitHub username
  • ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx → Your Personal Access Token from Step 1

Verification

To verify your configuration is working:

  1. Open PowerShell or Command Prompt
  2. Run: dotnet nuget list source
  3. Confirm the LazyMagic source is listed

Troubleshooting

Common Issues

  • Authentication failed: Verify your GitHub username and PAT are correct
  • Insufficient permissions: Ensure your PAT has 'read:packages' scope
  • File location issues: Make sure NuGet.Config is in your User folder, not a project folder
  • XML formatting: Validate the XML syntax if you encounter parsing errors

Security Best Practices

  • Use minimal required permissions (read:packages only)
  • Set appropriate expiration dates for your PAT
  • Keep your Personal Access Token secure and don't share it
  • Regularly review and rotate your access tokens

Next Steps

After successfully configuring GitHub access, proceed to install Visual Studio IDE in the next step of the LazyMagic setup process.