Authentication Commands
Authentication commands manage your connection to the Tank registry. Tank uses a browser-based OAuth flow to securely obtain API tokens.tank login
Authenticate with the Tank registry using browser-based OAuth.How It Works
- Initiates OAuth flow with the registry
- Opens your browser to GitHub for authentication
- Polls the registry until authorization completes
- Stores API token in
~/.tank/config.json
Options
--timeout <ms>- Authentication timeout in milliseconds (default: 300000 = 5 minutes)--poll-interval <ms>- Polling interval in milliseconds (default: 2000)
Environment Variables
TANK_DEBUG=1- Enable debug logging for authentication flow
Example Output
Manual Browser Flow
If the browser fails to open automatically:Errors
- Login timed out - Authorization not completed within 5 minutes. Run
tank loginagain. - Failed to start auth session - Network error connecting to registry. Check your internet connection.
tank logout
Remove stored credentials from local config.Behavior
- Removes
tokenanduserfrom~/.tank/config.json - If not logged in, prints warning and exits
- Does not revoke the token on the server (token may still be valid until expiration)
Example Output
tank whoami
Display current authenticated user information.Behavior
- Verifies token with registry
/api/v1/auth/whoamiendpoint - Displays cached user info from config
- Checks token validity and warns if expired
Example Output
Logged in (online):Use Cases
- Verify authentication before publishing
- Check which account is active in CI/CD
- Troubleshoot authentication issues
Configuration File
Authentication data is stored in~/.tank/config.json:
Token Format
API tokens use thetank_ prefix and are valid for 90 days. Tokens grant:
skills:read- Read public and private skills you have access toskills:write- Publish skills to your account or organizationsskills:admin- Manage skill versions and settings (if admin)
Security Best Practices
- Never commit
~/.tank/config.jsonto version control - Use
tank logouton shared machines - Rotate tokens regularly (re-login)
- Use service accounts for CI/CD instead of personal accounts
- Enable debug logging only when troubleshooting (
TANK_DEBUG=1)