GitHub Copilot Provider (Deprecated)
Access GitHub Copilot models via OAuth Device Code flow for existing local setups. This provider is now a deprecated compatibility path.Compatibility Quick Start
Authentication
Device Code Flow
GitHub Copilot uses Device Code flow instead of browser OAuth - ideal for headless servers and remote machines.1
First Run
Run
ccs ghcp "your prompt"2
Device Code Displayed
CCS displays verification URL and user code
3
Manual Authorization
Open URL in any browser, enter code manually
4
Token Received
CCS polls GitHub API, receives OAuth token when authorized
5
Token Cached
Token saved to
~/.ccs/cliproxy/auth/ghcp-{oauth}-{profile_id}.jsonAvailable since v7.37.1 - Device code and verification URL are also displayed in the CCS Dashboard for convenient access during authentication.
- Device code shown with copy button
- Verification URL as clickable link
- 15-minute expiration timer countdown
- Auto-refresh on successful authorization
Device Code vs Browser OAuth
GHCP uses Device Code flow because GitHub Copilot OAuth does not support callback servers.
Authentication Commands
Multi-Account Support
GitHub Copilot supports multiple accounts with filename-based identification:Account Identification
Pattern:ghcp-{oauth}-{profile_id}.json → {oauth}-{profile_id}
Example:
- Token file:
ghcp-github-ABC123.json - Account ID:
github-ABC123 - Nickname: Auto-generated or custom via
--nickname
Account Commands
Configuration
Config Keys
Configure via~/.ccs/config.yaml:
Account Types
Set account type:
Rate Limiting
GitHub Copilot has rate limits - configure behavior on limit:- Wait (Default)
- Fail Fast
Environment Variables
Auto-managed by CCS. Manual override rarely needed.
Commands Reference
Basic Usage
Authentication Commands
Account Management
Troubleshooting
Improved OAuth Failure Diagnostics
Available since v7.51.0
Token not found
After v7.51: Specific errors surfaced from GitHub’s OAuth flow:
CCS strips ANSI escape codes and parses multi-line stderr from the GitHub OAuth flow, so errors from nested processes are surfaced cleanly in the terminal.
Device Code Expired
Symptom: “Device code expired” error during authorization Cause: User didn’t complete authorization within 15 minutes Solution: Re-run--auth to get new code:
Rate Limit Exceeded
Symptom:429 Too Many Requests error
Cause: Exceeded GitHub Copilot rate limit
Solution 1: Wait for rate limit reset (if wait_on_limit: true)
Solution 2: Configure wait behavior:
Wrong Account Type
Symptom: Unexpected rate limits or quota errors Cause: Account type mismatch (Individual vs Business) Solution: Set correct account type:Token Refresh Failures
Symptom: “Unauthorized” errors after initial auth Cause: OAuth token expired, refresh failed Solution: Re-authenticate:Storage Locations
Token Structure
GitHub Copilot OAuth token file format:ghcp-{oauth}-{profile_id}.json
Account Identification: Extracted from filename (no email field)
Device Code Flow Details
Authorization Flow
- CCS requests device code from GitHub API
- GitHub returns:
device_code(internal use)user_code(user enters in browser)verification_uri(URL to visit)interval(polling frequency)
- User visits URL, enters code manually
- CCS polls GitHub API every
intervalseconds - GitHub returns access token when user completes authorization
- CCS caches token to auth directory
Polling Behavior
- Interval: 5 seconds (default from GitHub API)
- Timeout: 15 minutes (device code expiry)
- Retry: Stops on authorization or expiry
No Callback Server Needed
Device Code flow eliminates need for:- Local HTTP server
- Port availability
- Firewall configuration
- Localhost access
- Headless servers
- Remote SSH sessions
- Docker containers
- CI/CD pipelines
Rate Limiting Behavior
Rate Limit Detection
CLIProxyAPI detects rate limits via:- HTTP 429 status code
X-RateLimit-Remaining: 0headerRetry-Afterheader
Wait Strategy
Whenwait_on_limit: true:
- Detect rate limit (429 response)
- Read
Retry-Afterheader or calculate reset time - Display wait message with countdown
- Sleep until reset (or user abort)
- Retry request automatically
Fail Fast Strategy
Whenwait_on_limit: false:
- Detect rate limit (429 response)
- Display error message with reset time
- Exit immediately with exit code 6 (
PROVIDER_ERROR)
Quota Information
CCS tracks GitHub Copilot quota viaccs cliproxy quota and ccs copilot usage:
Reset period: Monthly (shown in
ccs copilot usage output)
Cost Information
Rate Limits:
- Individual: ~100 requests/hour
- Business: ~200 requests/hour (configurable)
- Exact limits set by GitHub, vary by account
Advanced Features
Model Mapping
GitHub Copilot models are configured from the CLIProxy provider editor:- Open
ccs config→ CLIProxy → GitHub Copilot (OAuth). - Use Model Config to set the default, Opus, Sonnet, and Haiku routes.
claude-sonnet-5is the default recommended GHCP model.- If GitHub rolls out a model before CCS’s static fallback catalog updates, type the full model ID in the picker and select Custom model.
~/.ccs/ghcp.settings.json as standard
ANTHROPIC_MODEL and ANTHROPIC_DEFAULT_*_MODEL values.
Account Registry Integration
GHCP uses same multi-account system as other OAuth providers:- Accounts stored in
~/.ccs/cliproxy/accounts.json - Nicknames auto-generated from account ID
- Default account tracked per provider
lastUsedAttimestamp for analytics
Session Persistence
GitHub Copilot sessions benefit from CLIProxy session persistence:- First
ccs ghcpspawns proxy (1-2s startup) - Subsequent commands reuse existing proxy (instant)
- Proxy terminates when last session exits
- Version mismatch detection → auto-restart on upgrade
Next Steps
Multi-Account Setup
Manage multiple GitHub accounts
Rate Limiting
Configure rate limit behavior
Device Code Flow
Understand headless authentication
CLIProxy Config
Advanced CLIProxy settings
