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 logout

What Gets Removed

The logout command removes:

It does NOT remove:

Examples

Simple Logout

nmbl logout

Removes all authentication tokens.

Logout and Re-login

# Sign out
nmbl logout

# Sign back in
nmbl login

# Verify new authentication
nmbl whoami

Logout Before Leaving Machine

# End of day on shared/public machine
nmbl logout

Use Cases

Security Cleanup

# Before leaving a shared workstation
nmbl logout

Remove your credentials from shared machines.

Troubleshooting Authentication

# If having authentication issues
nmbl logout
nmbl login

Fresh authentication can resolve token corruption or expiry issues.

Switching Accounts

# Log out of current account
nmbl logout

# Log in with different Google account
nmbl login

Machine Decommissioning

# Before decommissioning a development machine
nmbl logout
dotnet tool uninstall --global nmbl

Security Incident Response

# If credentials might be compromised
nmbl logout

# Then re-authenticate
nmbl login

Verification

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:

Commands That Don’t Require Authentication

These commands work without authentication:

nmbl help
nmbl --version
nmbl -v
nmbl login
nmbl logout
nmbl whoami

Troubleshooting

Logout Fails

If logout fails:

# Check if tool is installed correctly
nmbl --version

# Try again
nmbl logout

Tokens Still Present

If you think tokens weren’t removed:

# Verify by checking auth status
nmbl whoami

# Should show "Not authenticated" or similar

Can’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 login

Best Practices

Shared Machines

# Always logout on shared machines
nmbl logout

Regular Security Maintenance

# Periodically refresh credentials
nmbl logout
nmbl login

Before Extended Leave

# Logout before vacation or extended time away
nmbl logout

CI/CD Systems

# In CI/CD, use environment-specific authentication
# Don't rely on persistent login tokens