Auth Commands¶
Show authentication and security information for SuperQode.
Overview¶
The superqode auth command group provides commands for inspecting authentication status, checking API key configuration, and understanding security practices. SuperQode NEVER stores API keys - this command shows where keys are stored and who controls them.
Security Principle¶
SuperQode NEVER stores API keys
All credentials are read from YOUR environment at runtime. You control where and how your keys are stored.
auth info¶
Show comprehensive authentication information for all providers and agents.
Examples¶
Output¶
Displays three sections:
1. BYOK Mode (Direct LLM)¶
Shows status for common providers: - Provider: Provider identifier - Env Variable: Environment variable name for API key - Status: [CORRECT] Set or [INCORRECT] Not set - Source: Where the env var is detected (e.g., ~/.zshrc, .env, environment)
2. ACP Mode (Coding Agents)¶
Shows authentication status for ACP agents: - Agent: Agent identifier - Auth Location: Where the agent stores its credentials - Status: [CORRECT] Configured or WARNING: Check agent
3. Data Flow¶
Shows how data flows through the system: - BYOK: You โ SuperQode โ LiteLLM โ Provider API - ACP: You โ SuperQode โ Agent (e.g., opencode) โ Provider API
Example Output¶
SuperQode Auth Information
๐ SECURITY PRINCIPLE: SuperQode NEVER stores your API keys.
All credentials are read from YOUR environment at runtime.
You control where and how your keys are stored.
โโโ BYOK MODE (Direct LLM) โโโ
Your API keys are read from YOUR environment variables:
โโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโฌโโโโโโโโโโโโโโ
โ Provider โ Env Variable โ Status โ Source โ
โโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโผโโโโโโโโโโโโโโค
โ anthropic โ ANTHROPIC_API_KEYโ [CORRECT] Set โ ~/.zshrc โ
โ openai โ OPENAI_API_KEY โ [INCORRECT] Not setโ - โ
โ google โ GOOGLE_API_KEY โ [CORRECT] Set โ .env โ
โ ollama โ (none) โ Local โ localhost โ
โโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโดโโโโโโโโโโโโโโ
Keys are read at runtime, never stored by SuperQode
โโโ ACP MODE (Coding Agents) โโโ
Agent authentication is managed by each agent, not SuperQode:
โโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโ
โ Agent โ Auth Location โ Status โ
โโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโค
โ opencode โ ~/.local/share/opencode/ โ [CORRECT] Config โ
โ โ auth.json โ โ
โโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโ
Agent auth is managed by the agent itself, not SuperQode
Run the agent directly to configure: e.g., 'opencode' โ /connect
โโโ DATA FLOW โโโ
BYOK: You โ SuperQode โ LiteLLM โ Provider API
ACP: You โ SuperQode โ Agent (e.g., opencode) โ Provider API
SuperQode is a pass-through orchestrator. Your data goes directly
to the LLM provider or agent. We don't intercept or store anything.
auth check¶
Check authentication status for a specific provider or agent.
Arguments¶
| Argument | Description |
|---|---|
PROVIDER_OR_AGENT | Provider ID (e.g., anthropic) or Agent ID (e.g., opencode) |
Examples¶
# Check Anthropic provider
superqode auth check anthropic
# Check OpenCode agent
superqode auth check opencode
# Check OpenAI provider
superqode auth check openai
Output¶
For Providers¶
Shows: - Provider name and details - Environment variable status - Masked API key (first 8 and last 4 characters) - Source location of env var - Setup instructions if not configured
Example Output (Configured):
Example Output (Not Configured):
Provider: Anthropic
[INCORRECT] ANTHROPIC_API_KEY = (not set)
To configure:
export ANTHROPIC_API_KEY="your-api-key"
Get your key at: https://console.anthropic.com/
For Agents¶
Shows: - Agent name and authentication method - Auth file location and existence - Setup instructions if not configured
Example Output (Configured):
Agent: SST OpenCode
Auth managed by: SST OpenCode (not SuperQode)
Auth location: Managed by OpenCode CLI (run `opencode /connect`)
[CORRECT] Auth file exists: /home/user/.local/share/opencode/auth.json
Example Output (Not Configured):
Agent: SST OpenCode
Auth managed by: SST OpenCode (not SuperQode)
Auth location: Managed by OpenCode CLI (run `opencode /connect`)
WARNING: Auth file not found: /home/user/.local/share/opencode/auth.json
To configure:
opencode /connect
For Local Providers¶
Shows that no API key is required:
Understanding Auth Sources¶
SuperQode detects where environment variables are set by checking:
- Shell configuration files:
~/.zshrc,~/.bashrc,~/.bash_profile,~/.profile - Project
.envfile:.envin current directory - Environment: System environment (e.g., exported in current shell)
The auth info command shows the detected source for each configured variable.
Setting Up Authentication¶
BYOK Providers¶
- Get your API key from the provider:
- Anthropic: https://console.anthropic.com/
- OpenAI: https://platform.openai.com/api-keys
-
Google AI: https://aistudio.google.com/app/apikey
-
Set the environment variable:
# In shell config file (~/.zshrc, ~/.bashrc, etc.)
export ANTHROPIC_API_KEY="sk-ant-api03-..."
# Or in project .env file
echo 'ANTHROPIC_API_KEY=sk-ant-api03-...' >> .env
- Verify:
ACP Agents¶
Each agent manages its own authentication:
# OpenCode example
opencode /connect
# Follow prompts to authenticate
# Verify
superqode auth check opencode
Local Providers¶
No authentication required. Just ensure the service is running:
Security Best Practices¶
1. Never Commit API Keys¶
2. Use Environment Variables¶
# Good: Set in environment
export ANTHROPIC_API_KEY="sk-ant-..."
# Bad: Hardcode in config files
# ANTHROPIC_API_KEY: "sk-ant-..." # [INCORRECT] DON'T DO THIS
3. Use Different Keys for Different Environments¶
# Development
export ANTHROPIC_API_KEY="sk-ant-dev-..."
# Production (in CI/CD)
export ANTHROPIC_API_KEY="${{ secrets.ANTHROPIC_API_KEY }}"
4. Rotate Keys Regularly¶
If a key is compromised: 1. Generate a new key from the provider dashboard 2. Update the environment variable 3. Revoke the old key
Troubleshooting¶
Key Not Detected¶
Solution:
# 1. Verify key is exported
echo $ANTHROPIC_API_KEY
# 2. If empty, set it
export ANTHROPIC_API_KEY="your-key"
# 3. For persistence, add to shell config
echo 'export ANTHROPIC_API_KEY="your-key"' >> ~/.zshrc
source ~/.zshrc
# 4. Verify again
superqode auth check anthropic
Agent Auth Not Found¶
Solution:
# Run the agent's authentication command
opencode /connect
# Or follow agent-specific setup
superqode agents show opencode # Check setup instructions
Multiple Keys Set¶
If multiple environment variables are set for the same provider, SuperQode uses the first one found in this order: 1. Shell environment 2. .env file 3. Shell config files
To use a specific key, export it explicitly:
Data Flow and Privacy¶
BYOK Mode¶
You (API Key) โ SuperQode CLI โ LiteLLM Gateway โ Provider API
โ
No storage, pass-through only
- SuperQode reads keys from your environment
- Keys are passed to LiteLLM (local process)
- LiteLLM makes API calls to providers
- SuperQode never writes keys to disk
ACP Mode¶
You โ SuperQode CLI โ Agent Process โ Agent's Auth โ Provider API
โ
Agent manages its own auth
- SuperQode connects to agent subprocess
- Agent handles its own authentication
- Agent makes API calls using its credentials
- SuperQode doesn't see agent credentials
Related Commands¶
superqode providers list- List available providerssuperqode providers test- Test provider connectionsuperqode agents show- Show agent authentication infosuperqode roles check- Check role readiness (includes auth check)
Next Steps¶
- Provider Commands - Provider management
- Agents Commands - Agent management
- Configuration - Config file structure