-
-
Notifications
You must be signed in to change notification settings - Fork 60
Description
What
Add support for Cursor CLI as a new CLIProxy provider in CCS, similar to the existing codex, gemini, and agy profiles.
Why
User Value:
- Cursor CLI (released August 2025) is a popular AI-powered CLI that provides coding assistance directly from the terminal
- Supports multiple AI models: GPT-5, Claude 4 Sonnet/Opus, Gemini 2.5 Pro
- Offers both interactive and non-interactive modes for automation/CI/CD
- Users want seamless switching between Cursor and other providers via CCS
Alignment with CCS Goals:
- Fits CCS's mission: "CLI wrapper for instant switching between multiple Claude accounts and alternative models"
- Cursor CLI is a natural fit alongside existing CLIProxy providers (gemini, codex, agy, qwen, iflow, kiro, ghcp)
- Leverages existing OAuth infrastructure and zero-config profile mechanism
How
Proposed Implementation
1. Add cursor to CLIProxy provider types
Files to update:
src/cliproxy/types.ts- Add'cursor'toCLIProxyProvidertypesrc/config/unified-config-types.ts- Add to provider union typesconfig/reserved-names.ts- Add'cursor'to reserved names
2. Create base configuration
Create config/base-cursor.settings.json:
{
"env": {
"ANTHROPIC_BASE_URL": "http://127.0.0.1:8317/api/provider/cursor",
"ANTHROPIC_AUTH_TOKEN": "ccs-internal-managed",
"ANTHROPIC_MODEL": "cursor-default-model",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "cursor-opus-model",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "cursor-sonnet-model",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "cursor-haiku-model"
}
}3. Add OAuth configuration
Update src/cliproxy/auth/auth-types.ts:
- Add OAuth callback port (similar to gemini:8085, codex:1455, agy:51121)
- Add OAuth flow configuration
- Add token file prefix pattern for detection
4. Update model catalog
Update src/cliproxy/model-catalog.ts:
- Add Cursor model mappings
- Define default models for Opus/Sonnet/Haiku tiers
5. Update account manager
Update src/cliproxy/account-manager.ts:
- Add
'cursor'to providers array - Add token prefix detection logic
6. Update CLI and help text
Update src/ccs.ts, lib/ccs, lib/ccs.ps1:
- Add cursor usage examples
- Update help text to include
ccs cursorcommand
7. Add to remote auth fetcher
Update src/cliproxy/remote-auth-fetcher.ts:
- Add cursor provider mapping
- Add display name for UI
Unknowns (Need Investigation)
- Cursor CLI OAuth Endpoint: What is Cursor's OAuth authorization URL and callback port?
- Model IDs: What are the exact model IDs for Cursor's supported models?
- Token Format: How does Cursor store OAuth tokens? (File format, location, structure)
- API Compatibility: Is Cursor CLI compatible with CLIProxyAPI, or does it need custom handling?
Reference Implementation
Use codex profile as reference (already implemented):
- Configuration:
config/base-codex.settings.json - OAuth port: 1455
- Model catalog:
src/cliproxy/model-catalog.ts(seecodexentry)
Testing Checklist
-
ccs cursorlaunches and authenticates via OAuth - Model selection works (
ccs cursor --config) - Session isolation (concurrent cursor + other providers)
- Dashboard shows Cursor profile
- Token refresh works (if applicable)
- Help text updated (
ccs --help) - Reserved name validation prevents conflicts
- Migration path if token format changes
Acceptance Criteria
- User can run
ccs cursorand authenticate via browser OAuth - Cursor CLI is accessible through standard Claude CLI commands
- Concurrent usage works:
ccs cursorin one terminal,ccs codexin another - Dashboard displays Cursor profile with correct provider name/logo
- All validation checks pass (format, lint, typecheck, tests)
Priority: Medium (user request, but requires OAuth endpoint investigation)
Estimated Complexity: Medium (follows existing pattern, OAuth details unknown)