Headless Workflow
Use OAuth providers on servers or remote machines without browser access.Available since v7.37.0 - Enhanced interactive OAuth mode with auto-detection for SSH sessions and paste-callback flow.
Interactive OAuth Modes
Auto-detected on SSH sessions - no manual configuration needed.
Paste-Callback Mode (Recommended)
Recommended for most headless scenarios.
- CCS generates authentication URL
- You open URL on any device with a browser
- Complete OAuth login
- GitHub/Provider redirects to callback URL
- Copy callback URL from browser address bar
- Paste URL back into CCS terminal
- CCS extracts token and continues
- Works over any SSH connection
- No port forwarding required
- No localhost access needed
- Faster than traditional headless mode
Port Forwarding Mode
- CCS starts local callback server
- You forward port via SSH tunnel
- Complete OAuth in browser on local machine
- Callback reaches remote CCS via tunnel
- SSH port forwarding is available
- Multiple users sharing the same server
- Network policies allow port forwarding
Auto-Detection
SSH session detection is automatic - CCS chooses the best mode for you.
SSH_CONNECTIONenvironment variableSSH_CLIENTenvironment variable- TTY detection
--headless explicitly requests traditional flow.
Usage
How It Works
- CCS generates an authentication URL
- You open the URL on any device with a browser
- Complete OAuth login
- CCS detects when tokens are cached
- Session continues
Use Cases
- SSH sessions on remote servers
- Docker containers
- CI/CD pipelines (with pre-cached tokens)
- Headless Linux environments
Commands
Pre-Caching Tokens
For automated environments, authenticate locally first:- Run
ccs gemini --authon local machine - Copy
~/.ccs/cliproxy/auth/*.jsonto remote server - Use without
--headlessflag
