Auth Commands
The cyberstrike auth commands manage authentication credentials for AI providers.
📸 SCREENSHOT: auth-commands.png
Authentication command interface
Login
Interactive Login
cyberstrike auth loginDisplays provider selection menu:
? Select provider❯ OpenRouter (free tier available) Anthropic (API key from console.anthropic.com) OpenAI (ChatGPT Plus/Pro or API key) Google (API key from ai.google.dev) Ollama (local models) OtherProvider-Specific Login
cyberstrike auth login anthropiccyberstrike auth login openaicyberstrike auth login googlecyberstrike auth login openrouterWith API Key
cyberstrike auth login anthropic --key sk-ant-api03-...OAuth Login
For providers supporting OAuth:
cyberstrike auth login openai --oauthOpens browser for authentication.
Logout
Single Provider
cyberstrike auth logout anthropicAll Providers
cyberstrike auth logout --allInteractive Selection
cyberstrike auth logoutDisplays list of authenticated providers.
Status
Check All Credentials
cyberstrike auth statusOutput:
Authentication Status━━━━━━━━━━━━━━━━━━━━━
Stored Credentials (~/.cyberstrike/auth.json): ✓ Anthropic (API key) ✓ OpenRouter (API key) ✗ OpenAI (not configured)
Environment Variables: ✓ ANTHROPIC_API_KEY ✗ OPENAI_API_KEY ✗ GOOGLE_API_KEYSpecific Provider
cyberstrike auth status anthropicOutput:
Anthropic Authentication━━━━━━━━━━━━━━━━━━━━━━━━Status: AuthenticatedMethod: API KeyKey: sk-ant-***...***Expires: NeverVerify Credentials
cyberstrike auth verifyTests all credentials against provider APIs.
List
List Stored Credentials
cyberstrike auth listOutput:
Stored Credentials━━━━━━━━━━━━━━━━━━
Provider Method Added───────────────────────────────Anthropic API Key 2025-01-15OpenRouter API Key 2025-01-10Google OAuth 2025-01-08JSON Output
cyberstrike auth list --jsonRefresh
Refresh OAuth Token
cyberstrike auth refresh openaiRefresh All OAuth Tokens
cyberstrike auth refresh --allSwitch
Switch Default Provider
cyberstrike auth switch anthropicList Available Providers
cyberstrike auth switchInteractive selection.
Credential Storage
Storage Location
Credentials are stored in:
~/.cyberstrike/auth.jsonFile Permissions
The auth file is created with restricted permissions:
ls -la ~/.cyberstrike/auth.json# -rw------- 1 user user 256 Jan 15 10:00 auth.jsonEncryption
Credentials are encrypted at rest using platform keychain when available:
- macOS: Keychain
- Linux: Secret Service / libsecret
- Windows: Credential Manager
Plain Text Storage
For systems without keychain:
cyberstrike auth login --no-keychainCaution
Plain text storage is less secure. Use environment variables in CI/CD environments.
Environment Variables
Override Stored Credentials
Environment variables take precedence:
export ANTHROPIC_API_KEY="sk-ant-..."cyberstrike # Uses environment variableSupported Variables
| Variable | Provider |
|---|---|
| ANTHROPIC_API_KEY | Anthropic |
| OPENAI_API_KEY | OpenAI |
| GOOGLE_API_KEY | |
| OPENROUTER_API_KEY | OpenRouter |
| GROQ_API_KEY | Groq |
| AZURE_API_KEY | Azure OpenAI |
Multiple Accounts
Add Second Account
cyberstrike auth login anthropic --alias workcyberstrike auth login anthropic --alias personalUse Specific Account
cyberstrike --auth-alias workList Accounts
cyberstrike auth list --allTroubleshooting
Invalid API Key
Error: Invalid API key for AnthropicVerify:
- Key is correctly copied
- No extra whitespace
- Key is active in provider console
Expired Token
Error: OAuth token expiredSolution:
cyberstrike auth refresh openaiPermission Denied
Error: Cannot write to auth fileCheck file permissions:
chmod 600 ~/.cyberstrike/auth.jsonKeychain Access
Error: Cannot access system keychainSolutions:
- Unlock keychain
- Use
--no-keychainflag - Use environment variables
Security Best Practices
- Rotate keys - Regularly rotate API keys
- Use environment variables - For CI/CD and automation
- Limit key scope - Use restricted API keys when available
- Monitor usage - Check provider dashboards for unusual activity
- Secure storage - Ensure auth file has proper permissions
Tip
Use separate API keys for different projects to track usage and limit blast radius.
Related Documentation
- Authentication Guide - Full setup guide
- Providers - Provider configuration
- Configuration - Config options