CLICommands
ox login
Authenticate your CLI with the SageOx platform using device flow authorization.
Usage
terminal
$
For CI, cloud agents, or scripts: use a Personal Access Token instead of interactive login. See Personal Access Tokens.
How It Works
The ox login command uses OAuth 2.0 device flow:
- Request device code - CLI requests a code from SageOx
- Open browser - Authorization page opens automatically
- Authorize - Sign in and approve CLI access
- Complete - CLI receives and stores credentials
This is secure because your password never enters the terminal.
Credential Storage
| OS | Location |
|---|---|
| macOS/Linux | ~/.config/sageox/credentials.json |
| Windows | %APPDATA%\sageox\credentials.json |
Commands
terminal
# Check authentication status
$
# Remove stored credentials
$
# Re-authenticate (switch accounts)
$
Troubleshooting
Browser does not open - Copy the displayed URL manually.
Authentication timeout - Device code expires after 15 minutes. Run ox login again.
Wrong account - Run ox logout then ox login.
Environment Variables
| Variable | Description |
|---|---|
SAGEOX_API_URL | Override API endpoint |
SAGEOX_NO_BROWSER | Set to 1 to disable automatic browser |
SAGEOX_TOKEN | Personal Access Token for headless auth — see pats |
Related Commands
- Personal Access Tokens - Headless auth for CI and cloud agents
- Running ox in ephemeral environments - Claude Code Cloud, Devin, GitHub Actions
- ox doctor - Diagnose CLI issues
- ox init - Initialize a repository

