Auth
Manage accounts and API keys in Cue CLI
Cue CLI stores two types of credentials to connect you to AI services.
Credential Types
Accounts
Your Cue backend login. Cue supports multiple accounts — useful for separating work and personal use. Used for:
- WebSocket connection to Cue servers
- Syncing with your phone
- Remote agent control
- Activity feed, posts, and notifications
AI Keys
Direct API credentials for AI providers:
- Anthropic — Claude models
- OpenAI — GPT models
- Gemini — Google AI models
Each account selects which AI key to use via the provider field.
Storage
Credentials are stored in ~/.cue/auth-profiles.json:
{
"version": 1,
"accounts": {
"cue:work": {
"email": "me@company.com",
"endpoint": "https://api.cueos.ai",
"token": "eyJhbGci...",
"provider": "anthropic:api"
},
"cue:personal": {
"email": "me@gmail.com",
"endpoint": "https://api.cueos.ai",
"token": "eyJhbGci..."
}
},
"ai_keys": {
"anthropic:api": {
"type": "api_key",
"api_key": "sk-ant-..."
}
},
"defaults": {
"account": "cue:work"
}
}Account names follow the pattern cue:<email_prefix> (e.g., cue:john for john@example.com).
Commands
Check Status
cue authShows your current account, selected AI key, and available keys.
List All
cue auth listShows all accounts and AI keys with details.
Switch Account
# Switch to a different account
cue auth use cue:personal
# Switch account for specific environment
cue auth use cue:work --env productionSwitch AI Key
# Persist to config
cue auth use anthropic:api
# Session only (not saved)
cue auth use anthropic:api --session
# Set for specific environment
cue auth use openai:api --env productionAdd Account
Log in with a different email to add another account:
cue
/login
# Follow prompts — new account will be added without removing existing onesRemove Account
cue auth remove cue:old-accountAdd New Key
cue auth new
# Interactive setup for Anthropic, OpenAI, or GeminiReset All
cue auth reset
# Clears all accounts and API keysEnvironment Variables
Environment variables take priority over stored credentials:
# Cue backend
export CUE_ACCESS_TOKEN=eyJhbGci...
# Direct providers
export ANTHROPIC_API_KEY=sk-ant-...
export OPENAI_API_KEY=sk-...
export GEMINI_API_KEY=...Providers
Use --provider to choose how requests are routed:
| Provider | Flag | Description |
|---|---|---|
cue | --provider cue | Through Cue backend (default) |
anthropic | --provider anthropic | Direct to Anthropic |
openai | --provider openai | Direct to OpenAI |
gemini | --provider gemini | Direct to Gemini |
# Use Anthropic directly with your local API key
cue --provider anthropic -p "hello"
# Use Cue backend (uses your account's selected key or backend's key)
cue --provider cue -p "hello"Resolution Order
For Accounts
- Environment variable
CUE_ACCESS_TOKEN - Environment default (
envDefaults[env].account) - Global default (
defaults.account)
For AI Keys
- Environment variables (
ANTHROPIC_API_KEY, etc.) - Account's selected provider (
account.provider) - First matching key in
ai_keys
One-Command Usage
Use --profile to select an account or AI key for a single command without changing your default:
With Accounts
# Post activity as work account
cue --profile cue:work activity "Checked deploy logs"
# Check personal feed
cue --profile cue:personal feed
# Send notification via work account
cue --profile cue:work notify "Build Done" "Completed successfully"With AI Keys
cue --profile anthropic:api -p "hello"
cue --profile openai:api -p "hello"This is useful for scripting and automation where you want to use a specific account without affecting interactive sessions.