Authentication
nmbl requires authentication to use. You can authenticate using either OAuth or a license key.
OAuth provides secure authentication through your Google account.
nmbl login
This command:
- Opens a browser window
- Redirects to Google authentication
- Validates your email domain
- Stores authentication token securely
Authorized Domains:
- @nimblepros.com
- Other configured domains
nmbl whoami
Shows:
- Authentication method (OAuth or License Key)
- User email (for OAuth)
- Token expiration
- License status
nmbl logout
Removes all stored authentication tokens.
If you have a license key, you can use it instead of OAuth.
nmbl checks for license keys in this order:
- Command line argument (highest priority)
- Environment variable
- User configuration file
- Local appsettings.json (lowest priority)
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:
- No configuration needed
- Easy to use in CI/CD
Cons:
- Must be specified every time
- Visible in command history
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:
- No need to specify with each command
- Works well in CI/CD environments
Cons:
- Requires shell/system configuration
- May expose key in environment
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:
- Persistent across sessions
- Not visible in command history
- User-specific configuration
Cons:
- Requires file creation
- One configuration per user
Place an appsettings.json file in your current working directory:
{
"licenseKey": "YOUR_LICENSE_KEY"
}
Pros:
- Project-specific configuration
- Easy to share with team (if appropriate)
Cons:
- Different configuration per directory
- Risk of committing to source control
Important: Add to .gitignore:
appsettings.json
-
Never commit license keys to source control
# .gitignore appsettings.json config.json -
Use environment variables in CI/CD
- GitHub Actions: Use secrets
- Azure DevOps: Use pipeline variables
- GitLab CI: Use protected variables
-
Limit key exposure
- Prefer OAuth when possible
- Use user config file over environment variables
- Rotate keys periodically
OAuth tokens are stored securely:
- Windows: Encrypted using DPAPI in
%APPDATA%\nmbl\tokens.json - Linux/macOS: Protected file at
~/.config/nmbl/tokens.json(0600 permissions)
Try these steps:
-
Check authentication status:
nmbl whoami -
For OAuth users:
nmbl logout nmbl login -
For license key users:
- Verify key is correctly set
- Check configuration priority
- Ensure no typos in key
- Verify the key is correct
- Check for extra spaces or quotes
- Contact support for key validation
- Check firewall settings
- Verify browser is set as default
- Try manual URL from console output
Contact NimblePros:
- Email: [email protected]
- Website: https://nimblepros.com
- Getting Started - Install and configure nmbl
- Commands Reference - Learn available commands