Authentication

nmbl requires authentication to use. You can authenticate using either OAuth or a license key.

OAuth provides secure authentication through your Google account.

Sign In

nmbl login

This command:

  1. Opens a browser window
  2. Redirects to Google authentication
  3. Validates your email domain
  4. Stores authentication token securely

Authorized Domains:

Check Authentication Status

nmbl whoami

Shows:

Sign Out

nmbl logout

Removes all stored authentication tokens.

License Key Authentication

If you have a license key, you can use it instead of OAuth.

Configuration Priority

nmbl checks for license keys in this order:

  1. Command line argument (highest priority)
  2. Environment variable
  3. User configuration file
  4. Local appsettings.json (lowest priority)

Method 1: Command Line Argument

Pass the license key with each command:

nmbl --license-key YOUR_LICENSE_KEY cc MyProject.csproj
nmbl -l YOUR_LICENSE_KEY deps MySolution.slnx

Pros:

Cons:


Method 2: Environment Variable

Set the NMBL_LICENSE_KEY environment variable:

Windows PowerShell:

# Current session only
$env:NMBL_LICENSE_KEY = "YOUR_LICENSE_KEY"

# Permanently (user level)
[System.Environment]::SetEnvironmentVariable('NMBL_LICENSE_KEY', 'YOUR_LICENSE_KEY', 'User')

# Permanently (system level - requires admin)
[System.Environment]::SetEnvironmentVariable('NMBL_LICENSE_KEY', 'YOUR_LICENSE_KEY', 'Machine')

Windows Command Prompt:

# Current session only
set NMBL_LICENSE_KEY=YOUR_LICENSE_KEY

# Permanently (user level)
setx NMBL_LICENSE_KEY "YOUR_LICENSE_KEY"

Linux/macOS (Bash/Zsh):

# Current session only
export NMBL_LICENSE_KEY="YOUR_LICENSE_KEY"

# Permanently (add to ~/.bashrc or ~/.zshrc)
echo 'export NMBL_LICENSE_KEY="YOUR_LICENSE_KEY"' >> ~/.bashrc
source ~/.bashrc

Pros:

Cons:


Method 3: User Configuration File

Create a configuration file at:

Windows:

%APPDATA%\nmbl\config.json

Linux/macOS:

~/.config/nmbl/config.json

File contents:

{
  "licenseKey": "YOUR_LICENSE_KEY"
}

Create the file (Windows PowerShell):

$configPath = "$env:APPDATA\nmbl"
New-Item -ItemType Directory -Force -Path $configPath
Set-Content -Path "$configPath\config.json" -Value '{"licenseKey": "YOUR_LICENSE_KEY"}'

Create the file (Linux/macOS):

mkdir -p ~/.config/nmbl
echo '{"licenseKey": "YOUR_LICENSE_KEY"}' > ~/.config/nmbl/config.json

Pros:

Cons:


Method 4: Local appsettings.json

Place an appsettings.json file in your current working directory:

{
  "licenseKey": "YOUR_LICENSE_KEY"
}

Pros:

Cons:

Important: Add to .gitignore:

appsettings.json

Security Best Practices

Protecting Your License Key

  1. Never commit license keys to source control

    # .gitignore
    appsettings.json
    config.json
  2. Use environment variables in CI/CD

    • GitHub Actions: Use secrets
    • Azure DevOps: Use pipeline variables
    • GitLab CI: Use protected variables
  3. Limit key exposure

    • Prefer OAuth when possible
    • Use user config file over environment variables
    • Rotate keys periodically

Token Storage

OAuth tokens are stored securely:

Troubleshooting

“Authentication required” error

Try these steps:

  1. Check authentication status:

    nmbl whoami
  2. For OAuth users:

    nmbl logout
    nmbl login
  3. For license key users:

    • Verify key is correctly set
    • Check configuration priority
    • Ensure no typos in key

“Invalid license key” error

OAuth browser not opening

Getting a License Key

Contact NimblePros:

Next Steps