logout - Clear Authentication Tokens
Overview
The logout command clears all stored authentication tokens from your local machine. This signs you out of nmbl and removes your credentials. You’ll need to run nmbl login again to use authenticated commands.
Syntax
nmbl logoutWhat Gets Removed
The logout command removes:
- OAuth authentication tokens
- Cached credentials
- Session information
It does NOT remove:
- nmbl tool installation
- Your command history
- Configuration files (other than credentials)
Examples
Simple Logout
nmbl logoutRemoves all authentication tokens.
Logout and Re-login
# Sign out
nmbl logout
# Sign back in
nmbl login
# Verify new authentication
nmbl whoamiLogout Before Leaving Machine
# End of day on shared/public machine
nmbl logoutUse Cases
Security Cleanup
# Before leaving a shared workstation
nmbl logoutRemove your credentials from shared machines.
Troubleshooting Authentication
# If having authentication issues
nmbl logout
nmbl loginFresh authentication can resolve token corruption or expiry issues.
Switching Accounts
# Log out of current account
nmbl logout
# Log in with different Google account
nmbl loginMachine Decommissioning
# Before decommissioning a development machine
nmbl logout
dotnet tool uninstall --global nmblSecurity Incident Response
# If credentials might be compromised
nmbl logout
# Then re-authenticate
nmbl loginVerification
After logout, verify by checking authentication status:
# Logout
nmbl logout
# Check status (should show not authenticated)
nmbl whoami
# Try a command (should fail with auth error)
nmbl cc src/What Happens After Logout
After logging out:
- Most nmbl commands will require re-authentication
- Commands that don’t require auth (like
help,version) still work - You can re-authenticate anytime with
nmbl login
Commands That Don’t Require Authentication
These commands work without authentication:
nmbl help
nmbl --version
nmbl -v
nmbl login
nmbl logout
nmbl whoamiTroubleshooting
Logout Fails
If logout fails:
# Check if tool is installed correctly
nmbl --version
# Try again
nmbl logoutTokens Still Present
If you think tokens weren’t removed:
# Verify by checking auth status
nmbl whoami
# Should show "Not authenticated" or similarCan’t Re-login After Logout
If you have trouble logging back in:
# Ensure clean state
nmbl logout
# Wait a moment
sleep 5
# Try logging in again
nmbl loginBest Practices
Shared Machines
# Always logout on shared machines
nmbl logoutRegular Security Maintenance
# Periodically refresh credentials
nmbl logout
nmbl loginBefore Extended Leave
# Logout before vacation or extended time away
nmbl logoutCI/CD Systems
# In CI/CD, use environment-specific authentication
# Don't rely on persistent login tokensRelated Commands
login- Authenticate with OAuthwhoami- Check authentication status- Authentication Guide - Detailed authentication documentation