From 6f8587db6881dd3638320882e2eadcbf943c3945 Mon Sep 17 00:00:00 2001 From: kaitranntt Date: Sun, 21 Dec 2025 22:25:48 -0500 Subject: [PATCH 01/21] feat(cliproxy): migrate from CLIProxyAPI to CLIProxyAPIPlus - Update GitHub repo URL to router-for-me/CLIProxyAPIPlus - Handle new release naming pattern (v6.6.X-0 suffix) - Add version comparison support for Plus releases --- src/cliproxy/binary-manager.ts | 4 ++-- src/cliproxy/binary/types.ts | 4 ++-- src/cliproxy/binary/version-checker.ts | 9 +++++++-- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/cliproxy/binary-manager.ts b/src/cliproxy/binary-manager.ts index 70adfec1..8e83f2a7 100644 --- a/src/cliproxy/binary-manager.ts +++ b/src/cliproxy/binary-manager.ts @@ -25,10 +25,10 @@ import { ensureBinary, } from './binary'; -/** Default configuration */ +/** Default configuration (uses CLIProxyAPIPlus fork with Kiro + Copilot support) */ const DEFAULT_CONFIG: BinaryManagerConfig = { version: CLIPROXY_FALLBACK_VERSION, - releaseUrl: 'https://github.com/router-for-me/CLIProxyAPI/releases/download', + releaseUrl: 'https://github.com/router-for-me/CLIProxyAPIPlus/releases/download', binPath: getBinDir(), maxRetries: 3, verbose: false, diff --git a/src/cliproxy/binary/types.ts b/src/cliproxy/binary/types.ts index 461100f0..133faaf4 100644 --- a/src/cliproxy/binary/types.ts +++ b/src/cliproxy/binary/types.ts @@ -24,6 +24,6 @@ export const VERSION_CACHE_DURATION_MS = 60 * 60 * 1000; /** Version pin file name - stores user's explicit version choice */ export const VERSION_PIN_FILE = '.version-pin'; -/** GitHub API URL for latest release */ +/** GitHub API URL for latest release (CLIProxyAPIPlus fork with Kiro + Copilot support) */ export const GITHUB_API_LATEST_RELEASE = - 'https://api.github.com/repos/router-for-me/CLIProxyAPI/releases/latest'; + 'https://api.github.com/repos/router-for-me/CLIProxyAPIPlus/releases/latest'; diff --git a/src/cliproxy/binary/version-checker.ts b/src/cliproxy/binary/version-checker.ts index c21398e7..6108bd82 100644 --- a/src/cliproxy/binary/version-checker.ts +++ b/src/cliproxy/binary/version-checker.ts @@ -9,10 +9,15 @@ import { UpdateCheckResult, GITHUB_API_LATEST_RELEASE } from './types'; /** * Compare semver versions (true if latest > current) + * Handles CLIProxyAPIPlus versioning: strips -0 suffix before comparison */ export function isNewerVersion(latest: string, current: string): boolean { - const latestParts = latest.split('.').map((p) => parseInt(p, 10) || 0); - const currentParts = current.split('.').map((p) => parseInt(p, 10) || 0); + // Strip -0 suffix from CLIProxyAPIPlus versions (e.g., "6.6.40-0" -> "6.6.40") + const cleanLatest = latest.replace(/-\d+$/, ''); + const cleanCurrent = current.replace(/-\d+$/, ''); + + const latestParts = cleanLatest.split('.').map((p) => parseInt(p, 10) || 0); + const currentParts = cleanCurrent.split('.').map((p) => parseInt(p, 10) || 0); // Pad arrays to same length while (latestParts.length < 3) latestParts.push(0); From 2b441f64982c74174cb350537956e24970ef69f4 Mon Sep 17 00:00:00 2001 From: kaitranntt Date: Sun, 21 Dec 2025 22:26:11 -0500 Subject: [PATCH 02/21] feat(auth): add Kiro and GitHub Copilot OAuth providers - Add kiro (port 8329) and copilot (port 8330) to auth-types - Implement OAuth flows in oauth-handler - Update token-manager to include new providers - Add new providers to CLIPROXY_PROFILES - Update diagnostics and API routes for new providers --- src/auth/profile-detector.ts | 10 ++++- src/cliproxy/auth/auth-types.ts | 22 ++++++++++ src/cliproxy/auth/oauth-handler.ts | 41 +++++++++++-------- src/cliproxy/auth/token-manager.ts | 10 ++++- src/management/oauth-port-diagnostics.ts | 16 +++++++- src/web-server/routes/cliproxy-auth-routes.ts | 12 +++++- 6 files changed, 90 insertions(+), 21 deletions(-) diff --git a/src/auth/profile-detector.ts b/src/auth/profile-detector.ts index 72955947..7016a0ae 100644 --- a/src/auth/profile-detector.ts +++ b/src/auth/profile-detector.ts @@ -20,7 +20,15 @@ import { loadUnifiedConfig, isUnifiedMode } from '../config/unified-config-loade export type ProfileType = 'settings' | 'account' | 'cliproxy' | 'copilot' | 'default'; /** CLIProxy profile names (OAuth-based, zero config) */ -export const CLIPROXY_PROFILES = ['gemini', 'codex', 'agy', 'qwen'] as const; +export const CLIPROXY_PROFILES = [ + 'gemini', + 'codex', + 'agy', + 'qwen', + 'iflow', + 'kiro', + 'copilot', +] as const; export type CLIProxyProfileName = (typeof CLIPROXY_PROFILES)[number]; export interface ProfileDetectionResult { diff --git a/src/cliproxy/auth/auth-types.ts b/src/cliproxy/auth/auth-types.ts index ddabae1c..3fc7336f 100644 --- a/src/cliproxy/auth/auth-types.ts +++ b/src/cliproxy/auth/auth-types.ts @@ -16,12 +16,16 @@ import { AccountInfo } from '../account-manager'; * - Codex: Authorization Code Flow with local callback server on port 1455 * - Agy: Authorization Code Flow with local callback server on port 51121 * - Qwen: Device Code Flow (polling-based, NO callback port needed) + * - Kiro: Authorization Code Flow with local callback server on port 9876 + * - Copilot: Device Code Flow (polling-based, NO callback port needed) */ export const OAUTH_CALLBACK_PORTS: Partial> = { gemini: 8085, + kiro: 9876, // codex uses 1455 // agy uses 51121 // qwen uses Device Code Flow - no callback port needed + // copilot uses Device Code Flow - no callback port needed }; /** @@ -100,6 +104,20 @@ export const OAUTH_CONFIGS: Record = { scopes: ['phone', 'profile', 'email'], authFlag: '--iflow-login', }, + kiro: { + provider: 'kiro', + displayName: 'Kiro (AWS)', + authUrl: 'https://oidc.us-east-1.amazonaws.com', + scopes: ['codewhisperer:completions', 'codewhisperer:conversations'], + authFlag: '--kiro-login', + }, + copilot: { + provider: 'copilot', + displayName: 'GitHub Copilot', + authUrl: 'https://github.com/login/device/code', + scopes: ['copilot'], + authFlag: '--github-copilot-login', + }, }; /** @@ -113,6 +131,8 @@ export const PROVIDER_AUTH_PREFIXES: Record = { agy: ['antigravity-', 'agy-'], qwen: ['qwen-'], iflow: ['iflow-'], + kiro: ['kiro-', 'aws-', 'codewhisperer-'], + copilot: ['github-copilot-', 'copilot-', 'gh-'], }; /** @@ -125,6 +145,8 @@ export const PROVIDER_TYPE_VALUES: Record = { agy: ['antigravity'], qwen: ['qwen'], iflow: ['iflow'], + kiro: ['kiro', 'codewhisperer'], + copilot: ['github-copilot', 'copilot'], }; /** diff --git a/src/cliproxy/auth/oauth-handler.ts b/src/cliproxy/auth/oauth-handler.ts index b27201d6..f2bb51c2 100644 --- a/src/cliproxy/auth/oauth-handler.ts +++ b/src/cliproxy/auth/oauth-handler.ts @@ -1,12 +1,13 @@ /** * OAuth Handler for CLIProxyAPI * - * Manages OAuth authentication flow for CLIProxy providers (Gemini, Codex, Antigravity). + * Manages OAuth authentication flow for CLIProxy providers (Gemini, Codex, Antigravity, Kiro, Copilot). * CLIProxyAPI handles OAuth internally - we just need to: * 1. Check if auth exists (token files in CCS auth directory) * 2. Trigger OAuth flow by spawning binary with auth flag * 3. Auto-detect headless environments (SSH, no DISPLAY) * 4. Use --no-browser flag for headless, display OAuth URL for manual auth + * 5. Handle Device Code flows for Copilot/Qwen (no callback server) */ import * as fs from 'fs'; @@ -118,6 +119,7 @@ async function prepareBinary( * Trigger OAuth flow for provider * Auto-detects headless environment and uses --no-browser flag accordingly * Shows real-time step-by-step progress for better user feedback + * Handles both Authorization Code (callback server) and Device Code (polling) flows */ export async function triggerOAuth( provider: CLIProxyProvider, @@ -128,6 +130,7 @@ export async function triggerOAuth( const callbackPort = OAUTH_PORTS[provider]; const isCLI = !fromUI; const headless = options.headless ?? isHeadlessEnvironment(); + const isDeviceCodeFlow = callbackPort === null; // Check for existing accounts const existingAccounts = getProviderAccounts(provider); @@ -145,8 +148,8 @@ export async function triggerOAuth( } } - // Pre-flight checks - if (!(await runPreflightChecks(provider, oauthConfig))) { + // Pre-flight checks (skip for device code flows which don't need callback ports) + if (!isDeviceCodeFlow && !(await runPreflightChecks(provider, oauthConfig))) { return null; } @@ -158,7 +161,7 @@ export async function triggerOAuth( const { binaryPath, tokenDir, configPath } = prepared; - // Free callback port if needed + // Free callback port if needed (only for authorization code flows) const localCallbackPort = OAUTH_CALLBACK_PORTS[provider]; if (localCallbackPort) { const killed = killProcessOnPort(localCallbackPort, verbose); @@ -173,19 +176,25 @@ export async function triggerOAuth( args.push('--no-browser'); } - // Show callback server step - showStep(2, 4, 'progress', `Starting callback server on port ${callbackPort || 'N/A'}...`); + // Show step based on flow type + if (isDeviceCodeFlow) { + showStep(2, 4, 'progress', `Starting ${oauthConfig.displayName} Device Code flow...`); + console.log(''); + console.log(info('Device Code Flow - follow the instructions below')); + } else { + showStep(2, 4, 'progress', `Starting callback server on port ${callbackPort}...`); - // Show headless instructions - if (headless) { - console.log(''); - console.log(warn('PORT FORWARDING REQUIRED')); - console.log(` OAuth callback uses localhost:${callbackPort} which must be reachable.`); - console.log(' Run this on your LOCAL machine:'); - console.log( - ` ${color(`ssh -L ${callbackPort}:localhost:${callbackPort} @`, 'command')}` - ); - console.log(''); + // Show headless instructions (only for authorization code flows) + if (headless) { + console.log(''); + console.log(warn('PORT FORWARDING REQUIRED')); + console.log(` OAuth callback uses localhost:${callbackPort} which must be reachable.`); + console.log(' Run this on your LOCAL machine:'); + console.log( + ` ${color(`ssh -L ${callbackPort}:localhost:${callbackPort} @`, 'command')}` + ); + console.log(''); + } } // Execute OAuth process diff --git a/src/cliproxy/auth/token-manager.ts b/src/cliproxy/auth/token-manager.ts index c1e4fafe..e16ea424 100644 --- a/src/cliproxy/auth/token-manager.ts +++ b/src/cliproxy/auth/token-manager.ts @@ -145,7 +145,15 @@ export function getAuthStatus(provider: CLIProxyProvider): AuthStatus { * Get auth status for all providers */ export function getAllAuthStatus(): AuthStatus[] { - const providers: CLIProxyProvider[] = ['gemini', 'codex', 'agy', 'qwen', 'iflow']; + const providers: CLIProxyProvider[] = [ + 'gemini', + 'codex', + 'agy', + 'qwen', + 'iflow', + 'kiro', + 'copilot', + ]; return providers.map(getAuthStatus); } diff --git a/src/management/oauth-port-diagnostics.ts b/src/management/oauth-port-diagnostics.ts index 84828f8d..f789ce3a 100644 --- a/src/management/oauth-port-diagnostics.ts +++ b/src/management/oauth-port-diagnostics.ts @@ -32,6 +32,8 @@ export const OAUTH_CALLBACK_PORTS: Record = { agy: 51121, qwen: null, // Device Code Flow - no callback port iflow: null, // Device Code Flow - no callback port + kiro: 9876, // Authorization Code Flow + copilot: null, // Device Code Flow - no callback port }; /** @@ -48,6 +50,8 @@ export const OAUTH_FLOW_TYPES: Record = { agy: 'authorization_code', qwen: 'device_code', iflow: 'device_code', + kiro: 'authorization_code', + copilot: 'device_code', }; /** @@ -134,7 +138,15 @@ export async function checkOAuthPort(provider: CLIProxyProvider): Promise { - const providers: CLIProxyProvider[] = ['gemini', 'codex', 'agy', 'qwen', 'iflow']; + const providers: CLIProxyProvider[] = [ + 'gemini', + 'codex', + 'agy', + 'qwen', + 'iflow', + 'kiro', + 'copilot', + ]; const results: OAuthPortDiagnostic[] = []; for (const provider of providers) { @@ -149,7 +161,7 @@ export async function checkAllOAuthPorts(): Promise { * Check OAuth ports for providers that use Authorization Code flow only */ export async function checkAuthCodePorts(): Promise { - const providers: CLIProxyProvider[] = ['gemini', 'codex', 'agy']; + const providers: CLIProxyProvider[] = ['gemini', 'codex', 'agy', 'kiro']; const results: OAuthPortDiagnostic[] = []; for (const provider of providers) { diff --git a/src/web-server/routes/cliproxy-auth-routes.ts b/src/web-server/routes/cliproxy-auth-routes.ts index feeff110..1b3ed88b 100644 --- a/src/web-server/routes/cliproxy-auth-routes.ts +++ b/src/web-server/routes/cliproxy-auth-routes.ts @@ -28,7 +28,15 @@ import type { CLIProxyProvider } from '../../cliproxy/types'; const router = Router(); // Valid providers list -const validProviders: CLIProxyProvider[] = ['gemini', 'codex', 'agy', 'qwen', 'iflow']; +const validProviders: CLIProxyProvider[] = [ + 'gemini', + 'codex', + 'agy', + 'qwen', + 'iflow', + 'kiro', + 'copilot', +]; /** * GET /api/cliproxy/auth - Get auth status for built-in CLIProxy profiles @@ -57,6 +65,8 @@ router.get('/', async (_req: Request, res: Response): Promise => { codex: 'codex', qwen: 'qwen', iflow: 'iflow', + kiro: 'kiro', + copilot: 'copilot', }; // Update lastUsedAt for providers with recent activity From b15ff7f2355bf88f5867fe97475690a5affcbe10 Mon Sep 17 00:00:00 2001 From: kaitranntt Date: Sun, 21 Dec 2025 22:26:32 -0500 Subject: [PATCH 03/21] feat(config): add base settings for Kiro and Copilot providers - Add base-kiro.settings.json with default Kiro models - Add base-copilot.settings.json with default Copilot models - Update config-generator for new provider sections - Extend CLIProxyProvider type with kiro and copilot --- config/base-copilot.settings.json | 10 ++++++++++ config/base-kiro.settings.json | 10 ++++++++++ src/cliproxy/config-generator.ts | 5 ++++- src/cliproxy/platform-detector.ts | 5 +++-- src/cliproxy/services/variant-config-adapter.ts | 2 +- src/cliproxy/types.ts | 4 +++- src/config/unified-config-types.ts | 2 +- 7 files changed, 32 insertions(+), 6 deletions(-) create mode 100644 config/base-copilot.settings.json create mode 100644 config/base-kiro.settings.json diff --git a/config/base-copilot.settings.json b/config/base-copilot.settings.json new file mode 100644 index 00000000..985e513a --- /dev/null +++ b/config/base-copilot.settings.json @@ -0,0 +1,10 @@ +{ + "env": { + "ANTHROPIC_BASE_URL": "http://127.0.0.1:8317/api/provider/copilot", + "ANTHROPIC_AUTH_TOKEN": "ccs-internal-managed", + "ANTHROPIC_MODEL": "gpt-4o", + "ANTHROPIC_DEFAULT_OPUS_MODEL": "gpt-4o", + "ANTHROPIC_DEFAULT_SONNET_MODEL": "gpt-4o", + "ANTHROPIC_DEFAULT_HAIKU_MODEL": "gpt-4o-mini" + } +} diff --git a/config/base-kiro.settings.json b/config/base-kiro.settings.json new file mode 100644 index 00000000..e84d0b18 --- /dev/null +++ b/config/base-kiro.settings.json @@ -0,0 +1,10 @@ +{ + "env": { + "ANTHROPIC_BASE_URL": "http://127.0.0.1:8317/api/provider/kiro", + "ANTHROPIC_AUTH_TOKEN": "ccs-internal-managed", + "ANTHROPIC_MODEL": "kiro", + "ANTHROPIC_DEFAULT_OPUS_MODEL": "kiro", + "ANTHROPIC_DEFAULT_SONNET_MODEL": "kiro", + "ANTHROPIC_DEFAULT_HAIKU_MODEL": "kiro" + } +} diff --git a/src/cliproxy/config-generator.ts b/src/cliproxy/config-generator.ts index 57022dcd..ea7d1e27 100644 --- a/src/cliproxy/config-generator.ts +++ b/src/cliproxy/config-generator.ts @@ -44,8 +44,9 @@ export function getCliproxyWritablePath(): string { * v1: Initial config (port, auth-dir, api-keys only) * v2: Full-featured config with dashboard, quota mgmt, simplified key * v3: Logging disabled by default (user opt-in via ~/.ccs/config.yaml) + * v4: Added Kiro (AWS) and GitHub Copilot providers */ -export const CLIPROXY_CONFIG_VERSION = 3; +export const CLIPROXY_CONFIG_VERSION = 4; /** Provider display names (static metadata) */ const PROVIDER_DISPLAY_NAMES: Record = { @@ -54,6 +55,8 @@ const PROVIDER_DISPLAY_NAMES: Record = { agy: 'Antigravity', qwen: 'Qwen Code', iflow: 'iFlow', + kiro: 'Kiro (AWS)', + copilot: 'GitHub Copilot', }; /** diff --git a/src/cliproxy/platform-detector.ts b/src/cliproxy/platform-detector.ts index b3f45984..004f835a 100644 --- a/src/cliproxy/platform-detector.ts +++ b/src/cliproxy/platform-detector.ts @@ -8,10 +8,11 @@ import { PlatformInfo, SupportedOS, SupportedArch, ArchiveExtension } from './types'; /** - * CLIProxyAPI fallback version (used when GitHub API unavailable) + * CLIProxyAPIPlus fallback version (used when GitHub API unavailable) * Auto-update fetches latest from GitHub; this is only a safety net + * Note: CLIProxyAPIPlus uses v6.6.X-0 suffix pattern */ -export const CLIPROXY_FALLBACK_VERSION = '6.5.53'; +export const CLIPROXY_FALLBACK_VERSION = '6.6.40-0'; /** @deprecated Use CLIPROXY_FALLBACK_VERSION instead */ export const CLIPROXY_VERSION = CLIPROXY_FALLBACK_VERSION; diff --git a/src/cliproxy/services/variant-config-adapter.ts b/src/cliproxy/services/variant-config-adapter.ts index a4b09058..12461d6a 100644 --- a/src/cliproxy/services/variant-config-adapter.ts +++ b/src/cliproxy/services/variant-config-adapter.ts @@ -80,7 +80,7 @@ export function saveVariantUnified( if (!config.cliproxy) { config.cliproxy = { oauth_accounts: {}, - providers: ['gemini', 'codex', 'agy', 'qwen', 'iflow'], + providers: ['gemini', 'codex', 'agy', 'qwen', 'iflow', 'kiro', 'copilot'], variants: {}, }; } diff --git a/src/cliproxy/types.ts b/src/cliproxy/types.ts index 9fc1c1a9..b6cb745a 100644 --- a/src/cliproxy/types.ts +++ b/src/cliproxy/types.ts @@ -114,8 +114,10 @@ export interface DownloadResult { * - agy: Antigravity via OAuth (short name for easy usage) * - qwen: Qwen Code via OAuth (qwen3-coder) * - iflow: iFlow via OAuth + * - kiro: Kiro (AWS CodeWhisperer) via OAuth + * - copilot: GitHub Copilot via Device Code */ -export type CLIProxyProvider = 'gemini' | 'codex' | 'agy' | 'qwen' | 'iflow'; +export type CLIProxyProvider = 'gemini' | 'codex' | 'agy' | 'qwen' | 'iflow' | 'kiro' | 'copilot'; /** * CLIProxy config.yaml structure (minimal) diff --git a/src/config/unified-config-types.ts b/src/config/unified-config-types.ts index f8548cec..812b89eb 100644 --- a/src/config/unified-config-types.ts +++ b/src/config/unified-config-types.ts @@ -58,7 +58,7 @@ export type OAuthAccounts = Record; */ export interface CLIProxyVariantConfig { /** Base provider to use */ - provider: 'gemini' | 'codex' | 'agy' | 'qwen' | 'iflow'; + provider: 'gemini' | 'codex' | 'agy' | 'qwen' | 'iflow' | 'kiro' | 'copilot'; /** Account nickname (references oauth_accounts) */ account?: string; /** Path to settings file (e.g., "~/.ccs/gemini-custom.settings.json") */ From 9ca20e70de856f5cadb2cf8d1aeb60f1e725052a Mon Sep 17 00:00:00 2001 From: kaitranntt Date: Sun, 21 Dec 2025 22:26:53 -0500 Subject: [PATCH 04/21] feat(ui): add Kiro and Copilot provider icons - Add kiro.png icon for Kiro (AWS) provider - Add copilot.svg icon for GitHub Copilot provider --- ui/public/assets/providers/copilot.svg | 1 + ui/public/assets/providers/kiro.png | Bin 0 -> 2762 bytes 2 files changed, 1 insertion(+) create mode 100644 ui/public/assets/providers/copilot.svg create mode 100644 ui/public/assets/providers/kiro.png diff --git a/ui/public/assets/providers/copilot.svg b/ui/public/assets/providers/copilot.svg new file mode 100644 index 00000000..3cbf22a5 --- /dev/null +++ b/ui/public/assets/providers/copilot.svg @@ -0,0 +1 @@ +GithubCopilot \ No newline at end of file diff --git a/ui/public/assets/providers/kiro.png b/ui/public/assets/providers/kiro.png new file mode 100644 index 0000000000000000000000000000000000000000..919b7fd5857ef0540f3d15105269fa1b85c6e9b2 GIT binary patch literal 2762 zcmZ`*c{tQ-8~&NGjwKXn$i581G$gw*C`-c-B9v`t7-NLPF%cO_QZkmvG88#vnMjN^ zTehSKWjVrFqU>dhGtT+0bA8u$UElj&&wJm`{XF;kynnv&7_0NV5GVuy0A6!56I&)C z4}+7Pc^2aWCzv4VX=aNCfN*&Lh#~{P4pWMn2Y?Vb0DN@=0G&qwaGaP$x6xx3*gY)I zn*axgo7(Vz%6(fEFZ=r_n0C_usPb4V}VB)q$#_5`>6-BO~l;9$S&+N z7ZSNugsu@)CNr`B44`e zV!@As^eQ3P9TPKq+jV{qlqWfgU;0CTzocN+VA%AgzuLrj#`X?;@#S#3magt%?8?=| zr404C-k;g)*$3N=K{mZHU{}7}0!kHI3%Z$|%IyfQ0^3LR9p~2M2djdY0exgZ)5(Of z{7bZF=O3$6GPm7srt5D9=vSN^Vf$)8%^!mb-(l@^nv`5Y@Uw*#Dm0C+DKT4O1&vaw z#kY7@{F`B~75jW=N8BRlSf| zDdfpVa_L6>$&$!Ot2U`&*GsgG<9A>7lm8lvUg&DuY__bC4OO2;R2-cL_alKnIC6F& zFl&c5b1vCz#;nKi9G@_RE@1&tV(s@M>}Hha2U}~E5mInshymWqIdap(QgZ4_XH^^| zrF&ncfwLr<_qL?#jJCG#Z98=v6MEEiRG~7;p1;hVTx@h!=)T<3sU$HWc@H-%YXK5x z5NT-G0GdY-$474{mM63fm?FiBisPzxg9#CsCk(5^V)ob*Aav+}x}w=V&S6!q^mijJ zI@9nQ_Q=9ZVjr0;S_#yit|ZK%gu?3?a5r> z_mLT`(7PQ);rpwPOyfbKfz(YxV!$u0=C$238VxHsD$*vqv9GT55*vqGs$b}RIf6G% z`d|_QQXUe;?>R-$9hTA0Qu6cAt8Hqa!B>hC;fluIs67w!apEqysZD`zj5ahGpUY81 z*my$#OSOOgCVvjF+Sf+Qs|=iaU9tyx8^S8L$ln(_9!B>x9{2_oy$RhwZ=28G&YxDK zaO5Ivd_Tj#Iz_%tVsol&PJ^^QG34p*pEdN1*7Y)YG43_#nP6=_ikb1LVk<7A_RwN= z#ZNoZ%Brlerr8}by0=(MT#`?n^G2^MD4;3?9YQliqCe~g_FP&Vs~tjSP0i%EBh~$` z$?Jjwv;f0xn>^b9lxa>9OG~S-{{l^{Ch?Z-jjk;TZ?&>W4{9nyKXb4DVL}FT@KyMaYF6Vvwe0`e%^*CC zJ0jt|KKpiQtd^or`oaI;jZf<8%kstfb2efaz1;+v!B;r4AH**%FHh=9#HKxdwByAo zzLPp_&CLLih7FwQ6!4&l0B`P}oF1zUs_ZTb7~rx~diNxHHUa#UEZ4Ik3b|hB>E%T> zlTEIZ5EJViSD=`exzr|Gib_a4YihdbaKe5QDirbwvLbl^as>#oC)r-UjU~xiC=OP2 zdhayYLeK-=4TeWwTbN?AGkvsN9QX6T}>G8F19c6PW{rSS{ogmo~z3vd|D9V#wzs1Hvs(p`*_{L{5*0vWaxQU zZdUkOmx6Zq2CTKU^|@CB5Gx25aA0? zOq@hy*lR>e=F+{`v#9s?leADZ4g$|z^o|h4&Gi^cjUZOvObt-pnthZf_tg88gxn*T z{t@r6%;j~kG)n19%>k*uooXfszhJrusXWykqYF+I3th3gWqQNKq{wdw=jzl5srZ1x zkFeXb3m!XP^DSEPr3zzIHAO7+j;V?sh3dn{e^$)(R~TESg8@h^VMO+vKPI7<hNfvb3`FL>sj9_%JoQ_}Pr9?tn`KBp(|AFmD8kMvZn`71=NXCY; zU2_$HJzfLiPsb_GU4%Vg<;+n*7U71DV}JY%-`exY^!v52g!q)7Oy!rLxeh231>3A$ z!gP(4zEgvjJu}iqi*1?yRM4yH~%5^!F5(ZJM9(@d>LL)b;Z8v)mYd ziE6F2Q6qswndCRE} z$4~{H+>4sSHshGfZ(!Pl^~iT34jqa*?24))9}3eJQls*eKQHsX)efCg=sQsEV+5I} z%)Z_3Dv9!l$*XSx-K7^4xI#t6JBeRY-4QsW0a&=}oAgvEc?JejN*>D1A!@C@k}A9M z2)Q2babsK}$z1my-(@yNMpma|(Wv8zxU*O9u1(Nv?w;LKyjG*2aw9rBaBIF)#9_9h zt>=PPJt;UP;n~sQ2(?tARv_`tMAH#>=li*JFn{AD5d(k9MQ9c&C~H)rh&o;Oavf3S z&vi-d0`n;_AM1OxsXU9cQXYY_zGXvc)XeqF;e+dml?ok1yx#eUb;&}*p~hVfq~&{4 ztUH!$-PacXV1!%}5?O!*i$M;VInRI4ye zK-4e!wS8m`U6>+QD(`SvM7)zf;qo2KUEXBM7KP;lICy$4uV|@ouC2!OMsGK-hSKhh zzK5vSE6B|GgE6p}#pCcM6Ei@cytV38)Y*&+-yPE4>C@#q@R--W&AJ*mv>h8<>*95 z;;r;mq~lU-mvlo8j?FDaY(x-a=#O_MpLUC9jfH+?al0L`+PgDQGeHZwD4s1;u&Ee0 z^5;)C)xaTGozE}Qr?_HquexT{Nz3rC%t{E~t?(1FO3l%Y_v_PVL)3pfCmpY&v*-)I z70*pq`?UJ|NAQMkxN#e;JdnDar>*`=f-NMAGq(Dw74zF^LdMxy~GCg%iLS)c$L zld&+vfJO9QevSnOfdAG(0027rAAZ>N&oX1eVfHr$bji?}TrSwuG1$vJ7^~xX9m@m& z0Y{usIgL<3Anf1>9d!+z(^|@KxDFf+v5;kc{{GA0AK-=a{{8bUYyLB2sFeF~$nirDHVo&j<7Dh%d>s=IgbT(65O4$^;Pmq&QJ%~e Nz}(czqzvVD>o1Pn*-Zcd literal 0 HcmV?d00001 From 0f029f960a835f307f045eb9b7e01b448d4b539e Mon Sep 17 00:00:00 2001 From: kaitranntt Date: Sun, 21 Dec 2025 22:27:36 -0500 Subject: [PATCH 05/21] feat(ui): integrate Kiro and Copilot providers, rename to CLIProxy Plus - Rename sidebar/header from CLIProxy to CLIProxy Plus - Add Kiro and Copilot to all provider lists and type unions - Add provider logos and color configs - Add model catalogs with upstream CLIProxyAPIPlus models - Update Quick Setup Wizard with new providers --- .../components/cliproxy/cliproxy-dialog.tsx | 4 +- .../components/cliproxy/cliproxy-header.tsx | 7 +- .../cliproxy/provider-editor/index.tsx | 2 + ui/src/components/cliproxy/provider-logo.tsx | 4 + ui/src/components/layout/app-sidebar.tsx | 2 +- ui/src/components/setup/wizard/constants.ts | 2 + ui/src/lib/api-client.ts | 8 +- ui/src/lib/model-catalogs.ts | 115 ++++++++++++++++++ ui/src/lib/provider-config.ts | 6 + ui/src/lib/utils.ts | 2 + ui/src/pages/cliproxy.tsx | 2 +- 11 files changed, 143 insertions(+), 11 deletions(-) diff --git a/ui/src/components/cliproxy/cliproxy-dialog.tsx b/ui/src/components/cliproxy/cliproxy-dialog.tsx index f699305d..cd01df4f 100644 --- a/ui/src/components/cliproxy/cliproxy-dialog.tsx +++ b/ui/src/components/cliproxy/cliproxy-dialog.tsx @@ -14,7 +14,7 @@ import { Label } from '@/components/ui/label'; import { useCreateVariant, useCliproxyAuth } from '@/hooks/use-cliproxy'; import { usePrivacy } from '@/contexts/privacy-context'; -const providers = ['gemini', 'codex', 'agy', 'qwen', 'iflow'] as const; +const providers = ['gemini', 'codex', 'agy', 'qwen', 'iflow', 'kiro', 'copilot'] as const; const schema = z.object({ name: z @@ -39,6 +39,8 @@ const providerOptions = [ { value: 'agy', label: 'Antigravity' }, { value: 'qwen', label: 'Alibaba Qwen' }, { value: 'iflow', label: 'iFlow' }, + { value: 'kiro', label: 'Kiro (AWS)' }, + { value: 'copilot', label: 'GitHub Copilot' }, ]; export function CliproxyDialog({ open, onClose }: CliproxyDialogProps) { diff --git a/ui/src/components/cliproxy/cliproxy-header.tsx b/ui/src/components/cliproxy/cliproxy-header.tsx index c610c60c..790e58c8 100644 --- a/ui/src/components/cliproxy/cliproxy-header.tsx +++ b/ui/src/components/cliproxy/cliproxy-header.tsx @@ -116,6 +116,7 @@ export function CliproxyHeader({ { id: 'gemini', displayName: 'Gemini' }, { id: 'codex', displayName: 'Codex' }, { id: 'agy', displayName: 'Agy' }, + { id: 'kiro', displayName: 'Kiro' }, ]; const getProviderStatus = (providerId: string) => { @@ -131,10 +132,8 @@ export function CliproxyHeader({ {/* Top row: Title and Login Buttons */}
-

CLIProxy

-

- Manage OAuth providers and configuration -

+

CLIProxy Plus

+

CCS-level account management

{/* Login Buttons - Wrap on mobile */} diff --git a/ui/src/components/cliproxy/provider-editor/index.tsx b/ui/src/components/cliproxy/provider-editor/index.tsx index a153dbbd..69af143f 100644 --- a/ui/src/components/cliproxy/provider-editor/index.tsx +++ b/ui/src/components/cliproxy/provider-editor/index.tsx @@ -54,6 +54,8 @@ export function ProviderEditor({ codex: ['openai'], qwen: ['alibaba', 'qwen'], iflow: ['iflow'], + kiro: ['kiro', 'aws'], + copilot: ['github', 'copilot'], }; const owners = ownerMap[provider.toLowerCase()] || [provider.toLowerCase()]; return modelsData.models.filter((m) => diff --git a/ui/src/components/cliproxy/provider-logo.tsx b/ui/src/components/cliproxy/provider-logo.tsx index 3c7bb486..683ef8ba 100644 --- a/ui/src/components/cliproxy/provider-logo.tsx +++ b/ui/src/components/cliproxy/provider-logo.tsx @@ -18,6 +18,8 @@ const PROVIDER_IMAGES: Record = { agy: '/assets/providers/agy.png', qwen: '/assets/providers/qwen-color.svg', iflow: '/assets/providers/iflow.png', + kiro: '/assets/providers/kiro.png', + copilot: '/assets/providers/copilot.svg', }; /** Provider color configuration (for fallback only - no background for image logos) */ @@ -28,6 +30,8 @@ const PROVIDER_CONFIG: Record = { agy: { text: 'text-violet-600', letter: 'A' }, qwen: { text: 'text-cyan-600', letter: 'Q' }, iflow: { text: 'text-indigo-600', letter: 'i' }, + kiro: { text: 'text-teal-600', letter: 'K' }, + copilot: { text: 'text-green-600', letter: 'C' }, }; /** Size configuration */ diff --git a/ui/src/components/layout/app-sidebar.tsx b/ui/src/components/layout/app-sidebar.tsx index 6aeaac7b..bd5b489a 100644 --- a/ui/src/components/layout/app-sidebar.tsx +++ b/ui/src/components/layout/app-sidebar.tsx @@ -54,7 +54,7 @@ const navGroups = [ { path: '/cliproxy', icon: Zap, - label: 'CLIProxy', + label: 'CLIProxy Plus', isCollapsible: true, children: [ { path: '/cliproxy', label: 'Overview' }, diff --git a/ui/src/components/setup/wizard/constants.ts b/ui/src/components/setup/wizard/constants.ts index 6ac80cff..bef68bcb 100644 --- a/ui/src/components/setup/wizard/constants.ts +++ b/ui/src/components/setup/wizard/constants.ts @@ -10,6 +10,8 @@ export const PROVIDERS: ProviderOption[] = [ { id: 'agy', name: 'Antigravity', description: 'Antigravity AI models' }, { id: 'qwen', name: 'Alibaba Qwen', description: 'Qwen Code models' }, { id: 'iflow', name: 'iFlow', description: 'iFlow AI models' }, + { id: 'kiro', name: 'Kiro (AWS)', description: 'AWS CodeWhisperer models' }, + { id: 'copilot', name: 'GitHub Copilot', description: 'GitHub Copilot models' }, ]; export const ALL_STEPS = ['provider', 'auth', 'variant', 'success']; diff --git a/ui/src/lib/api-client.ts b/ui/src/lib/api-client.ts index 840965cc..ea699f8e 100644 --- a/ui/src/lib/api-client.ts +++ b/ui/src/lib/api-client.ts @@ -47,20 +47,20 @@ export interface UpdateProfile { export interface Variant { name: string; - provider: 'gemini' | 'codex' | 'agy' | 'qwen' | 'iflow'; + provider: 'gemini' | 'codex' | 'agy' | 'qwen' | 'iflow' | 'kiro' | 'copilot'; settings: string; account?: string; } export interface CreateVariant { name: string; - provider: 'gemini' | 'codex' | 'agy' | 'qwen' | 'iflow'; + provider: 'gemini' | 'codex' | 'agy' | 'qwen' | 'iflow' | 'kiro' | 'copilot'; model?: string; account?: string; } export interface UpdateVariant { - provider?: 'gemini' | 'codex' | 'agy' | 'qwen' | 'iflow'; + provider?: 'gemini' | 'codex' | 'agy' | 'qwen' | 'iflow' | 'kiro' | 'copilot'; model?: string; account?: string; } @@ -69,7 +69,7 @@ export interface UpdateVariant { export interface OAuthAccount { id: string; email?: string; - provider: 'gemini' | 'codex' | 'agy' | 'qwen' | 'iflow'; + provider: 'gemini' | 'codex' | 'agy' | 'qwen' | 'iflow' | 'kiro' | 'copilot'; isDefault: boolean; tokenFile: string; createdAt: string; diff --git a/ui/src/lib/model-catalogs.ts b/ui/src/lib/model-catalogs.ts index 06f78c71..70edf061 100644 --- a/ui/src/lib/model-catalogs.ts +++ b/ui/src/lib/model-catalogs.ts @@ -151,4 +151,119 @@ export const MODEL_CATALOGS: Record = { }, ], }, + kiro: { + provider: 'kiro', + displayName: 'Kiro (AWS)', + defaultModel: 'kiro-claude-sonnet-4-5', + models: [ + { + id: 'kiro-claude-opus-4-5', + name: 'Kiro Claude Opus 4.5', + description: 'Claude Opus 4.5 via Kiro (2.2x credit)', + presetMapping: { + default: 'kiro-claude-opus-4-5', + opus: 'kiro-claude-opus-4-5', + sonnet: 'kiro-claude-sonnet-4-5', + haiku: 'kiro-claude-haiku-4-5', + }, + }, + { + id: 'kiro-claude-sonnet-4-5', + name: 'Kiro Claude Sonnet 4.5', + description: 'Claude Sonnet 4.5 via Kiro (1.3x credit)', + presetMapping: { + default: 'kiro-claude-sonnet-4-5', + opus: 'kiro-claude-opus-4-5', + sonnet: 'kiro-claude-sonnet-4-5', + haiku: 'kiro-claude-haiku-4-5', + }, + }, + { + id: 'kiro-claude-sonnet-4', + name: 'Kiro Claude Sonnet 4', + description: 'Claude Sonnet 4 via Kiro (1.3x credit)', + presetMapping: { + default: 'kiro-claude-sonnet-4', + opus: 'kiro-claude-opus-4-5', + sonnet: 'kiro-claude-sonnet-4', + haiku: 'kiro-claude-haiku-4-5', + }, + }, + { + id: 'kiro-claude-haiku-4-5', + name: 'Kiro Claude Haiku 4.5', + description: 'Claude Haiku 4.5 via Kiro (0.4x credit)', + }, + ], + }, + copilot: { + provider: 'copilot', + displayName: 'GitHub Copilot', + defaultModel: 'claude-sonnet-4.5', + models: [ + { + id: 'claude-opus-4.5', + name: 'Claude Opus 4.5', + description: 'Anthropic Claude Opus 4.5 via GitHub Copilot', + presetMapping: { + default: 'claude-opus-4.5', + opus: 'claude-opus-4.5', + sonnet: 'claude-sonnet-4.5', + haiku: 'claude-haiku-4.5', + }, + }, + { + id: 'claude-sonnet-4.5', + name: 'Claude Sonnet 4.5', + description: 'Anthropic Claude Sonnet 4.5 via GitHub Copilot', + presetMapping: { + default: 'claude-sonnet-4.5', + opus: 'claude-opus-4.5', + sonnet: 'claude-sonnet-4.5', + haiku: 'claude-haiku-4.5', + }, + }, + { + id: 'claude-sonnet-4', + name: 'Claude Sonnet 4', + description: 'Anthropic Claude Sonnet 4 via GitHub Copilot', + }, + { + id: 'claude-haiku-4.5', + name: 'Claude Haiku 4.5', + description: 'Anthropic Claude Haiku 4.5 via GitHub Copilot', + }, + { + id: 'gpt-5.2', + name: 'GPT-5.2', + description: 'OpenAI GPT-5.2 via GitHub Copilot', + presetMapping: { + default: 'gpt-5.2', + opus: 'gpt-5.2', + sonnet: 'gpt-5.1', + haiku: 'gpt-5-mini', + }, + }, + { + id: 'gpt-5.1', + name: 'GPT-5.1', + description: 'OpenAI GPT-5.1 via GitHub Copilot', + }, + { + id: 'gpt-5', + name: 'GPT-5', + description: 'OpenAI GPT-5 via GitHub Copilot', + }, + { + id: 'gpt-5-mini', + name: 'GPT-5 Mini', + description: 'OpenAI GPT-5 Mini via GitHub Copilot', + }, + { + id: 'gemini-3-pro', + name: 'Gemini 3 Pro', + description: 'Google Gemini 3 Pro via GitHub Copilot', + }, + ], + }, }; diff --git a/ui/src/lib/provider-config.ts b/ui/src/lib/provider-config.ts index 299e8145..52d494d5 100644 --- a/ui/src/lib/provider-config.ts +++ b/ui/src/lib/provider-config.ts @@ -9,6 +9,8 @@ export const PROVIDER_ASSETS: Record = { agy: '/assets/providers/agy.png', codex: '/assets/providers/openai.svg', qwen: '/assets/providers/qwen-color.svg', + kiro: '/assets/providers/kiro.png', + copilot: '/assets/providers/copilot.svg', }; // Provider brand colors @@ -19,6 +21,8 @@ export const PROVIDER_COLORS: Record = { vertex: '#4285F4', iflow: '#f94144', qwen: '#6236FF', + kiro: '#4d908e', // Dark Cyan (AWS-inspired) + copilot: '#43aa8b', // Seaweed (GitHub-inspired) }; // Provider display names @@ -29,6 +33,8 @@ const PROVIDER_NAMES: Record = { vertex: 'Vertex AI', iflow: 'iFlow', qwen: 'Qwen', + kiro: 'Kiro (AWS)', + copilot: 'GitHub Copilot', }; // Map provider to display name diff --git a/ui/src/lib/utils.ts b/ui/src/lib/utils.ts index 326a4440..29bdb99d 100644 --- a/ui/src/lib/utils.ts +++ b/ui/src/lib/utils.ts @@ -27,6 +27,8 @@ const PROVIDER_COLORS: Record = { vertex: '#577590', // Blue Slate iflow: '#f94144', // Strawberry qwen: '#f9c74f', // Tuscan + kiro: '#4d908e', // Dark Cyan (AWS-inspired) + copilot: '#43aa8b', // Seaweed (GitHub-inspired) }; // Status colors (from Analytics Cost breakdown) - darker for light theme contrast diff --git a/ui/src/pages/cliproxy.tsx b/ui/src/pages/cliproxy.tsx index b9fc21a9..9a5840fa 100644 --- a/ui/src/pages/cliproxy.tsx +++ b/ui/src/pages/cliproxy.tsx @@ -235,7 +235,7 @@ export function CliproxyPage() {
-

CLIProxy

+

CLIProxy Plus

diff --git a/ui/src/components/cliproxy/overview/model-preferences-grid.tsx b/ui/src/components/cliproxy/overview/model-preferences-grid.tsx index 294d1e9d..62630fce 100644 --- a/ui/src/components/cliproxy/overview/model-preferences-grid.tsx +++ b/ui/src/components/cliproxy/overview/model-preferences-grid.tsx @@ -101,7 +101,9 @@ export function ModelPreferencesGrid() { {modelsData.totalCount} total - Models available through CLIProxyAPI, grouped by provider + + Models available through CLIProxy Plus, grouped by provider +
diff --git a/ui/src/pages/settings/sections/proxy/index.tsx b/ui/src/pages/settings/sections/proxy/index.tsx index 365d7dfd..14a8b666 100644 --- a/ui/src/pages/settings/sections/proxy/index.tsx +++ b/ui/src/pages/settings/sections/proxy/index.tsx @@ -142,7 +142,7 @@ export default function ProxySection() {

- Configure local or remote CLIProxyAPI connection for proxy-based profiles + Configure local or remote CLIProxy Plus connection for proxy-based profiles

{/* Mode Toggle - Card based selection */} @@ -166,7 +166,7 @@ export default function ProxySection() { Local

- Run CLIProxyAPI binary on this machine + Run CLIProxy Plus binary on this machine

@@ -187,7 +187,7 @@ export default function ProxySection() { Remote

- Connect to a remote CLIProxyAPI server + Connect to a remote CLIProxy Plus server

From 036714c77447c4887da038b7979495c80f171c88 Mon Sep 17 00:00:00 2001 From: kaitranntt Date: Mon, 22 Dec 2025 00:44:03 -0500 Subject: [PATCH 10/21] feat(cliproxy): add kiro and ghcp providers to CLIProxyProvider type - extend CLIProxyProvider union with 'kiro' and 'ghcp' - add both to CLIPROXY_PROFILES array --- src/auth/profile-detector.ts | 2 +- src/cliproxy/types.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/auth/profile-detector.ts b/src/auth/profile-detector.ts index 7016a0ae..014d5407 100644 --- a/src/auth/profile-detector.ts +++ b/src/auth/profile-detector.ts @@ -27,7 +27,7 @@ export const CLIPROXY_PROFILES = [ 'qwen', 'iflow', 'kiro', - 'copilot', + 'ghcp', ] as const; export type CLIProxyProfileName = (typeof CLIPROXY_PROFILES)[number]; diff --git a/src/cliproxy/types.ts b/src/cliproxy/types.ts index b6cb745a..b501fa71 100644 --- a/src/cliproxy/types.ts +++ b/src/cliproxy/types.ts @@ -115,9 +115,9 @@ export interface DownloadResult { * - qwen: Qwen Code via OAuth (qwen3-coder) * - iflow: iFlow via OAuth * - kiro: Kiro (AWS CodeWhisperer) via OAuth - * - copilot: GitHub Copilot via Device Code + * - ghcp: GitHub Copilot via Device Code (OAuth through CLIProxyAPIPlus) */ -export type CLIProxyProvider = 'gemini' | 'codex' | 'agy' | 'qwen' | 'iflow' | 'kiro' | 'copilot'; +export type CLIProxyProvider = 'gemini' | 'codex' | 'agy' | 'qwen' | 'iflow' | 'kiro' | 'ghcp'; /** * CLIProxy config.yaml structure (minimal) From a01abe181b63d88fcf7e7fa9404071a69e7727d7 Mon Sep 17 00:00:00 2001 From: kaitranntt Date: Mon, 22 Dec 2025 00:44:26 -0500 Subject: [PATCH 11/21] feat(cliproxy): add kiro and ghcp OAuth configurations - add OAUTH_CONFIGS entries for kiro (authorization_code) and ghcp (device_code) - update getAllAuthStatus providers array --- src/cliproxy/auth/auth-types.ts | 14 +++++++------- src/cliproxy/auth/token-manager.ts | 10 +--------- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/src/cliproxy/auth/auth-types.ts b/src/cliproxy/auth/auth-types.ts index 3fc7336f..4bb06256 100644 --- a/src/cliproxy/auth/auth-types.ts +++ b/src/cliproxy/auth/auth-types.ts @@ -17,7 +17,7 @@ import { AccountInfo } from '../account-manager'; * - Agy: Authorization Code Flow with local callback server on port 51121 * - Qwen: Device Code Flow (polling-based, NO callback port needed) * - Kiro: Authorization Code Flow with local callback server on port 9876 - * - Copilot: Device Code Flow (polling-based, NO callback port needed) + * - GHCP: Device Code Flow (polling-based, NO callback port needed) */ export const OAUTH_CALLBACK_PORTS: Partial> = { gemini: 8085, @@ -25,7 +25,7 @@ export const OAUTH_CALLBACK_PORTS: Partial> = { // codex uses 1455 // agy uses 51121 // qwen uses Device Code Flow - no callback port needed - // copilot uses Device Code Flow - no callback port needed + // ghcp uses Device Code Flow - no callback port needed }; /** @@ -111,9 +111,9 @@ export const OAUTH_CONFIGS: Record = { scopes: ['codewhisperer:completions', 'codewhisperer:conversations'], authFlag: '--kiro-login', }, - copilot: { - provider: 'copilot', - displayName: 'GitHub Copilot', + ghcp: { + provider: 'ghcp', + displayName: 'GitHub Copilot (OAuth)', authUrl: 'https://github.com/login/device/code', scopes: ['copilot'], authFlag: '--github-copilot-login', @@ -132,7 +132,7 @@ export const PROVIDER_AUTH_PREFIXES: Record = { qwen: ['qwen-'], iflow: ['iflow-'], kiro: ['kiro-', 'aws-', 'codewhisperer-'], - copilot: ['github-copilot-', 'copilot-', 'gh-'], + ghcp: ['github-copilot-', 'copilot-', 'gh-'], }; /** @@ -146,7 +146,7 @@ export const PROVIDER_TYPE_VALUES: Record = { qwen: ['qwen'], iflow: ['iflow'], kiro: ['kiro', 'codewhisperer'], - copilot: ['github-copilot', 'copilot'], + ghcp: ['github-copilot', 'copilot'], }; /** diff --git a/src/cliproxy/auth/token-manager.ts b/src/cliproxy/auth/token-manager.ts index e16ea424..4eb4fa72 100644 --- a/src/cliproxy/auth/token-manager.ts +++ b/src/cliproxy/auth/token-manager.ts @@ -145,15 +145,7 @@ export function getAuthStatus(provider: CLIProxyProvider): AuthStatus { * Get auth status for all providers */ export function getAllAuthStatus(): AuthStatus[] { - const providers: CLIProxyProvider[] = [ - 'gemini', - 'codex', - 'agy', - 'qwen', - 'iflow', - 'kiro', - 'copilot', - ]; + const providers: CLIProxyProvider[] = ['gemini', 'codex', 'agy', 'qwen', 'iflow', 'kiro', 'ghcp']; return providers.map(getAuthStatus); } From fae1ee2b3139a22a753b55908305c5d4303be560 Mon Sep 17 00:00:00 2001 From: kaitranntt Date: Mon, 22 Dec 2025 00:44:52 -0500 Subject: [PATCH 12/21] feat(cliproxy): add ghcp settings and update variant adapter - rename base-copilot.settings.json to base-ghcp.settings.json - add kiro and ghcp to variant adapter providers list - update provider display names in config generator --- config/base-ghcp.settings.json | 10 ++++++++++ src/cliproxy/config-generator.ts | 2 +- src/cliproxy/services/variant-config-adapter.ts | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 config/base-ghcp.settings.json diff --git a/config/base-ghcp.settings.json b/config/base-ghcp.settings.json new file mode 100644 index 00000000..985e513a --- /dev/null +++ b/config/base-ghcp.settings.json @@ -0,0 +1,10 @@ +{ + "env": { + "ANTHROPIC_BASE_URL": "http://127.0.0.1:8317/api/provider/copilot", + "ANTHROPIC_AUTH_TOKEN": "ccs-internal-managed", + "ANTHROPIC_MODEL": "gpt-4o", + "ANTHROPIC_DEFAULT_OPUS_MODEL": "gpt-4o", + "ANTHROPIC_DEFAULT_SONNET_MODEL": "gpt-4o", + "ANTHROPIC_DEFAULT_HAIKU_MODEL": "gpt-4o-mini" + } +} diff --git a/src/cliproxy/config-generator.ts b/src/cliproxy/config-generator.ts index ea7d1e27..7e9f940e 100644 --- a/src/cliproxy/config-generator.ts +++ b/src/cliproxy/config-generator.ts @@ -56,7 +56,7 @@ const PROVIDER_DISPLAY_NAMES: Record = { qwen: 'Qwen Code', iflow: 'iFlow', kiro: 'Kiro (AWS)', - copilot: 'GitHub Copilot', + ghcp: 'GitHub Copilot (OAuth)', }; /** diff --git a/src/cliproxy/services/variant-config-adapter.ts b/src/cliproxy/services/variant-config-adapter.ts index 12461d6a..69a36ded 100644 --- a/src/cliproxy/services/variant-config-adapter.ts +++ b/src/cliproxy/services/variant-config-adapter.ts @@ -80,7 +80,7 @@ export function saveVariantUnified( if (!config.cliproxy) { config.cliproxy = { oauth_accounts: {}, - providers: ['gemini', 'codex', 'agy', 'qwen', 'iflow', 'kiro', 'copilot'], + providers: ['gemini', 'codex', 'agy', 'qwen', 'iflow', 'kiro', 'ghcp'], variants: {}, }; } From 49bc0a44cc58cafdb74d008e32500a6154460246 Mon Sep 17 00:00:00 2001 From: kaitranntt Date: Mon, 22 Dec 2025 00:45:13 -0500 Subject: [PATCH 13/21] feat(cliproxy): add kiro and ghcp to OAuth diagnostics and account manager - add OAUTH_CALLBACK_PORTS: kiro=9876, ghcp=null (device code) - add OAUTH_FLOW_TYPES for both providers - update getAllAccountsSummary providers array --- src/cliproxy/account-manager.ts | 2 +- src/management/oauth-port-diagnostics.ts | 14 +++----------- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/src/cliproxy/account-manager.ts b/src/cliproxy/account-manager.ts index 23ffbb7d..71cc2d3e 100644 --- a/src/cliproxy/account-manager.ts +++ b/src/cliproxy/account-manager.ts @@ -495,7 +495,7 @@ export function discoverExistingAccounts(): void { * Get summary of all accounts across providers */ export function getAllAccountsSummary(): Record { - const providers: CLIProxyProvider[] = ['gemini', 'codex', 'agy', 'qwen', 'iflow']; + const providers: CLIProxyProvider[] = ['gemini', 'codex', 'agy', 'qwen', 'iflow', 'kiro', 'ghcp']; const summary: Record = {} as Record< CLIProxyProvider, AccountInfo[] diff --git a/src/management/oauth-port-diagnostics.ts b/src/management/oauth-port-diagnostics.ts index f789ce3a..e3d28317 100644 --- a/src/management/oauth-port-diagnostics.ts +++ b/src/management/oauth-port-diagnostics.ts @@ -33,7 +33,7 @@ export const OAUTH_CALLBACK_PORTS: Record = { qwen: null, // Device Code Flow - no callback port iflow: null, // Device Code Flow - no callback port kiro: 9876, // Authorization Code Flow - copilot: null, // Device Code Flow - no callback port + ghcp: null, // Device Code Flow - no callback port }; /** @@ -51,7 +51,7 @@ export const OAUTH_FLOW_TYPES: Record = { qwen: 'device_code', iflow: 'device_code', kiro: 'authorization_code', - copilot: 'device_code', + ghcp: 'device_code', }; /** @@ -138,15 +138,7 @@ export async function checkOAuthPort(provider: CLIProxyProvider): Promise { - const providers: CLIProxyProvider[] = [ - 'gemini', - 'codex', - 'agy', - 'qwen', - 'iflow', - 'kiro', - 'copilot', - ]; + const providers: CLIProxyProvider[] = ['gemini', 'codex', 'agy', 'qwen', 'iflow', 'kiro', 'ghcp']; const results: OAuthPortDiagnostic[] = []; for (const provider of providers) { From d04bcc117f5fd79bf52ab97ce597173a9c40ff00 Mon Sep 17 00:00:00 2001 From: kaitranntt Date: Mon, 22 Dec 2025 00:45:38 -0500 Subject: [PATCH 14/21] feat(config): add kiro and ghcp to unified config and auth routes - extend CLIProxyVariantConfig provider type - update createEmptyUnifiedConfig providers array - add kiro and ghcp to validProviders in auth routes --- src/config/unified-config-types.ts | 4 ++-- src/web-server/routes/cliproxy-auth-routes.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/config/unified-config-types.ts b/src/config/unified-config-types.ts index 812b89eb..a5e2bc4c 100644 --- a/src/config/unified-config-types.ts +++ b/src/config/unified-config-types.ts @@ -58,7 +58,7 @@ export type OAuthAccounts = Record; */ export interface CLIProxyVariantConfig { /** Base provider to use */ - provider: 'gemini' | 'codex' | 'agy' | 'qwen' | 'iflow' | 'kiro' | 'copilot'; + provider: 'gemini' | 'codex' | 'agy' | 'qwen' | 'iflow' | 'kiro' | 'ghcp'; /** Account nickname (references oauth_accounts) */ account?: string; /** Path to settings file (e.g., "~/.ccs/gemini-custom.settings.json") */ @@ -370,7 +370,7 @@ export function createEmptyUnifiedConfig(): UnifiedConfig { profiles: {}, cliproxy: { oauth_accounts: {}, - providers: ['gemini', 'codex', 'agy', 'qwen', 'iflow'], + providers: ['gemini', 'codex', 'agy', 'qwen', 'iflow', 'kiro', 'ghcp'], variants: {}, logging: { enabled: false, diff --git a/src/web-server/routes/cliproxy-auth-routes.ts b/src/web-server/routes/cliproxy-auth-routes.ts index 1b3ed88b..1abf36d2 100644 --- a/src/web-server/routes/cliproxy-auth-routes.ts +++ b/src/web-server/routes/cliproxy-auth-routes.ts @@ -35,7 +35,7 @@ const validProviders: CLIProxyProvider[] = [ 'qwen', 'iflow', 'kiro', - 'copilot', + 'ghcp', ]; /** @@ -66,7 +66,7 @@ router.get('/', async (_req: Request, res: Response): Promise => { qwen: 'qwen', iflow: 'iflow', kiro: 'kiro', - copilot: 'copilot', + copilot: 'ghcp', // CLIProxyAPI returns 'copilot', we map to 'ghcp' }; // Update lastUsedAt for providers with recent activity From 8c8a15f1e14a71d0359a9d3a93abb29fee36633c Mon Sep 17 00:00:00 2001 From: kaitranntt Date: Mon, 22 Dec 2025 00:46:01 -0500 Subject: [PATCH 15/21] docs(cli): add ccs kiro and ccs ghcp to help text - add 'ccs kiro' entry for AWS CodeWhisperer - add 'ccs ghcp' entry for GitHub Copilot OAuth - clarify ccs copilot is for copilot-api integration --- src/commands/help-command.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/commands/help-command.ts b/src/commands/help-command.ts index 714bbc9a..2333c729 100644 --- a/src/commands/help-command.ts +++ b/src/commands/help-command.ts @@ -162,7 +162,7 @@ Claude Code Profile & Model Switcher`.trim(); ['ccs agy', 'Antigravity (Claude/Gemini models)'], ['ccs qwen', 'Qwen Code (qwen3-coder)'], ['ccs kiro', 'Kiro (AWS CodeWhisperer Claude models)'], - ['ccs copilot', 'GitHub Copilot (GPT/Claude/Gemini)'], + ['ccs ghcp', 'GitHub Copilot (OAuth via CLIProxy Plus)'], ['', ''], // Spacer ['ccs --auth', 'Authenticate only'], ['ccs --auth --add', 'Add another account'], @@ -176,16 +176,17 @@ Claude Code Profile & Model Switcher`.trim(); ); // ═══════════════════════════════════════════════════════════════════════════ - // MAJOR SECTION 4: GitHub Copilot Integration + // MAJOR SECTION 4: GitHub Copilot Integration (copilot-api) // ═══════════════════════════════════════════════════════════════════════════ printMajorSection( - 'GitHub Copilot Integration', + 'GitHub Copilot Integration (copilot-api)', [ - 'Use your GitHub Copilot subscription with Claude Code', + 'Use your GitHub Copilot subscription with Claude Code via copilot-api', 'Requires: npm install -g copilot-api', + 'Note: For OAuth-based access, use ccs ghcp instead', ], [ - ['ccs copilot', 'Use Copilot as API backend'], + ['ccs copilot', 'Use Copilot via copilot-api daemon'], ['ccs copilot auth', 'Authenticate with GitHub'], ['ccs copilot status', 'Show integration status'], ['ccs copilot models', 'List available models'], From f5a382c3d51383bfa478543adc4091f095b16b63 Mon Sep 17 00:00:00 2001 From: kaitranntt Date: Mon, 22 Dec 2025 00:46:29 -0500 Subject: [PATCH 16/21] chore(config): remove deprecated base-copilot.settings.json - replaced by base-ghcp.settings.json for ghcp provider --- config/base-copilot.settings.json | 10 ---------- 1 file changed, 10 deletions(-) delete mode 100644 config/base-copilot.settings.json diff --git a/config/base-copilot.settings.json b/config/base-copilot.settings.json deleted file mode 100644 index 985e513a..00000000 --- a/config/base-copilot.settings.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "env": { - "ANTHROPIC_BASE_URL": "http://127.0.0.1:8317/api/provider/copilot", - "ANTHROPIC_AUTH_TOKEN": "ccs-internal-managed", - "ANTHROPIC_MODEL": "gpt-4o", - "ANTHROPIC_DEFAULT_OPUS_MODEL": "gpt-4o", - "ANTHROPIC_DEFAULT_SONNET_MODEL": "gpt-4o", - "ANTHROPIC_DEFAULT_HAIKU_MODEL": "gpt-4o-mini" - } -} From bf3d51ade33620653a9dff297b394d1f3eaa2cf3 Mon Sep 17 00:00:00 2001 From: kaitranntt Date: Mon, 22 Dec 2025 00:46:51 -0500 Subject: [PATCH 17/21] feat(ui): add kiro and ghcp to provider types and configs - update Variant, CreateVariant, UpdateVariant, OAuthAccount types - add ghcp to PROVIDER_ASSETS, PROVIDER_COLORS, PROVIDER_NAMES - add ghcp catalog with model configurations --- ui/src/lib/api-client.ts | 8 ++++---- ui/src/lib/model-catalogs.ts | 6 +++--- ui/src/lib/provider-config.ts | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/ui/src/lib/api-client.ts b/ui/src/lib/api-client.ts index ea699f8e..87013507 100644 --- a/ui/src/lib/api-client.ts +++ b/ui/src/lib/api-client.ts @@ -47,20 +47,20 @@ export interface UpdateProfile { export interface Variant { name: string; - provider: 'gemini' | 'codex' | 'agy' | 'qwen' | 'iflow' | 'kiro' | 'copilot'; + provider: 'gemini' | 'codex' | 'agy' | 'qwen' | 'iflow' | 'kiro' | 'ghcp'; settings: string; account?: string; } export interface CreateVariant { name: string; - provider: 'gemini' | 'codex' | 'agy' | 'qwen' | 'iflow' | 'kiro' | 'copilot'; + provider: 'gemini' | 'codex' | 'agy' | 'qwen' | 'iflow' | 'kiro' | 'ghcp'; model?: string; account?: string; } export interface UpdateVariant { - provider?: 'gemini' | 'codex' | 'agy' | 'qwen' | 'iflow' | 'kiro' | 'copilot'; + provider?: 'gemini' | 'codex' | 'agy' | 'qwen' | 'iflow' | 'kiro' | 'ghcp'; model?: string; account?: string; } @@ -69,7 +69,7 @@ export interface UpdateVariant { export interface OAuthAccount { id: string; email?: string; - provider: 'gemini' | 'codex' | 'agy' | 'qwen' | 'iflow' | 'kiro' | 'copilot'; + provider: 'gemini' | 'codex' | 'agy' | 'qwen' | 'iflow' | 'kiro' | 'ghcp'; isDefault: boolean; tokenFile: string; createdAt: string; diff --git a/ui/src/lib/model-catalogs.ts b/ui/src/lib/model-catalogs.ts index 70edf061..a4924c47 100644 --- a/ui/src/lib/model-catalogs.ts +++ b/ui/src/lib/model-catalogs.ts @@ -196,9 +196,9 @@ export const MODEL_CATALOGS: Record = { }, ], }, - copilot: { - provider: 'copilot', - displayName: 'GitHub Copilot', + ghcp: { + provider: 'ghcp', + displayName: 'GitHub Copilot (OAuth)', defaultModel: 'claude-sonnet-4.5', models: [ { diff --git a/ui/src/lib/provider-config.ts b/ui/src/lib/provider-config.ts index 52d494d5..989479a2 100644 --- a/ui/src/lib/provider-config.ts +++ b/ui/src/lib/provider-config.ts @@ -10,7 +10,7 @@ export const PROVIDER_ASSETS: Record = { codex: '/assets/providers/openai.svg', qwen: '/assets/providers/qwen-color.svg', kiro: '/assets/providers/kiro.png', - copilot: '/assets/providers/copilot.svg', + ghcp: '/assets/providers/copilot.svg', }; // Provider brand colors @@ -22,7 +22,7 @@ export const PROVIDER_COLORS: Record = { iflow: '#f94144', qwen: '#6236FF', kiro: '#4d908e', // Dark Cyan (AWS-inspired) - copilot: '#43aa8b', // Seaweed (GitHub-inspired) + ghcp: '#43aa8b', // Seaweed (GitHub-inspired) }; // Provider display names @@ -34,7 +34,7 @@ const PROVIDER_NAMES: Record = { iflow: 'iFlow', qwen: 'Qwen', kiro: 'Kiro (AWS)', - copilot: 'GitHub Copilot', + ghcp: 'GitHub Copilot (OAuth)', }; // Map provider to display name From 099b712d4a1cd64388e669493851750f072f6d98 Mon Sep 17 00:00:00 2001 From: kaitranntt Date: Mon, 22 Dec 2025 00:47:34 -0500 Subject: [PATCH 18/21] feat(ui): update cliproxy components with kiro and ghcp providers - add ghcp to PROVIDER_IMAGES and PROVIDER_CONFIG in provider-logo - update providers array and options in cliproxy-dialog - add kiro and ghcp to providerLabels in cliproxy-table - complete providers list in cliproxy-header - update ownerMap key from copilot to ghcp in provider-editor --- ui/src/components/cliproxy/cliproxy-dialog.tsx | 4 ++-- ui/src/components/cliproxy/cliproxy-header.tsx | 3 +++ ui/src/components/cliproxy/cliproxy-table.tsx | 2 ++ ui/src/components/cliproxy/provider-editor/index.tsx | 2 +- ui/src/components/cliproxy/provider-logo.tsx | 4 ++-- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/ui/src/components/cliproxy/cliproxy-dialog.tsx b/ui/src/components/cliproxy/cliproxy-dialog.tsx index cd01df4f..fa8fc3fb 100644 --- a/ui/src/components/cliproxy/cliproxy-dialog.tsx +++ b/ui/src/components/cliproxy/cliproxy-dialog.tsx @@ -14,7 +14,7 @@ import { Label } from '@/components/ui/label'; import { useCreateVariant, useCliproxyAuth } from '@/hooks/use-cliproxy'; import { usePrivacy } from '@/contexts/privacy-context'; -const providers = ['gemini', 'codex', 'agy', 'qwen', 'iflow', 'kiro', 'copilot'] as const; +const providers = ['gemini', 'codex', 'agy', 'qwen', 'iflow', 'kiro', 'ghcp'] as const; const schema = z.object({ name: z @@ -40,7 +40,7 @@ const providerOptions = [ { value: 'qwen', label: 'Alibaba Qwen' }, { value: 'iflow', label: 'iFlow' }, { value: 'kiro', label: 'Kiro (AWS)' }, - { value: 'copilot', label: 'GitHub Copilot' }, + { value: 'ghcp', label: 'GitHub Copilot (OAuth)' }, ]; export function CliproxyDialog({ open, onClose }: CliproxyDialogProps) { diff --git a/ui/src/components/cliproxy/cliproxy-header.tsx b/ui/src/components/cliproxy/cliproxy-header.tsx index 790e58c8..a2d39178 100644 --- a/ui/src/components/cliproxy/cliproxy-header.tsx +++ b/ui/src/components/cliproxy/cliproxy-header.tsx @@ -116,7 +116,10 @@ export function CliproxyHeader({ { id: 'gemini', displayName: 'Gemini' }, { id: 'codex', displayName: 'Codex' }, { id: 'agy', displayName: 'Agy' }, + { id: 'qwen', displayName: 'Qwen' }, + { id: 'iflow', displayName: 'iFlow' }, { id: 'kiro', displayName: 'Kiro' }, + { id: 'ghcp', displayName: 'GitHub Copilot' }, ]; const getProviderStatus = (providerId: string) => { diff --git a/ui/src/components/cliproxy/cliproxy-table.tsx b/ui/src/components/cliproxy/cliproxy-table.tsx index b9f7e2bb..ab4c5ff2 100644 --- a/ui/src/components/cliproxy/cliproxy-table.tsx +++ b/ui/src/components/cliproxy/cliproxy-table.tsx @@ -35,6 +35,8 @@ const providerLabels: Record = { agy: 'Antigravity', qwen: 'Alibaba Qwen', iflow: 'iFlow', + kiro: 'Kiro (AWS)', + ghcp: 'GitHub Copilot (OAuth)', }; export function CliproxyTable({ data }: CliproxyTableProps) { diff --git a/ui/src/components/cliproxy/provider-editor/index.tsx b/ui/src/components/cliproxy/provider-editor/index.tsx index 69af143f..ab278d5e 100644 --- a/ui/src/components/cliproxy/provider-editor/index.tsx +++ b/ui/src/components/cliproxy/provider-editor/index.tsx @@ -55,7 +55,7 @@ export function ProviderEditor({ qwen: ['alibaba', 'qwen'], iflow: ['iflow'], kiro: ['kiro', 'aws'], - copilot: ['github', 'copilot'], + ghcp: ['github', 'copilot'], }; const owners = ownerMap[provider.toLowerCase()] || [provider.toLowerCase()]; return modelsData.models.filter((m) => diff --git a/ui/src/components/cliproxy/provider-logo.tsx b/ui/src/components/cliproxy/provider-logo.tsx index 683ef8ba..66ad0420 100644 --- a/ui/src/components/cliproxy/provider-logo.tsx +++ b/ui/src/components/cliproxy/provider-logo.tsx @@ -19,7 +19,7 @@ const PROVIDER_IMAGES: Record = { qwen: '/assets/providers/qwen-color.svg', iflow: '/assets/providers/iflow.png', kiro: '/assets/providers/kiro.png', - copilot: '/assets/providers/copilot.svg', + ghcp: '/assets/providers/copilot.svg', }; /** Provider color configuration (for fallback only - no background for image logos) */ @@ -31,7 +31,7 @@ const PROVIDER_CONFIG: Record = { qwen: { text: 'text-cyan-600', letter: 'Q' }, iflow: { text: 'text-indigo-600', letter: 'i' }, kiro: { text: 'text-teal-600', letter: 'K' }, - copilot: { text: 'text-green-600', letter: 'C' }, + ghcp: { text: 'text-green-600', letter: 'C' }, }; /** Size configuration */ From 92215457f0226695a0d57b25fba4744b85401bac Mon Sep 17 00:00:00 2001 From: kaitranntt Date: Mon, 22 Dec 2025 00:48:10 -0500 Subject: [PATCH 19/21] feat(ui): add kiro and ghcp to wizard, auth flow, and settings - update PROVIDERS in wizard constants with ghcp - add AUTH_ENDPOINTS for qwen, iflow, kiro, ghcp - update globalenv description text --- ui/src/components/setup/wizard/constants.ts | 2 +- ui/src/hooks/use-cliproxy-auth-flow.ts | 4 ++++ ui/src/pages/settings/sections/globalenv-section.tsx | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ui/src/components/setup/wizard/constants.ts b/ui/src/components/setup/wizard/constants.ts index bef68bcb..4c530fe7 100644 --- a/ui/src/components/setup/wizard/constants.ts +++ b/ui/src/components/setup/wizard/constants.ts @@ -11,7 +11,7 @@ export const PROVIDERS: ProviderOption[] = [ { id: 'qwen', name: 'Alibaba Qwen', description: 'Qwen Code models' }, { id: 'iflow', name: 'iFlow', description: 'iFlow AI models' }, { id: 'kiro', name: 'Kiro (AWS)', description: 'AWS CodeWhisperer models' }, - { id: 'copilot', name: 'GitHub Copilot', description: 'GitHub Copilot models' }, + { id: 'ghcp', name: 'GitHub Copilot (OAuth)', description: 'GitHub Copilot via OAuth' }, ]; export const ALL_STEPS = ['provider', 'auth', 'variant', 'success']; diff --git a/ui/src/hooks/use-cliproxy-auth-flow.ts b/ui/src/hooks/use-cliproxy-auth-flow.ts index e896c3f3..502b4b19 100644 --- a/ui/src/hooks/use-cliproxy-auth-flow.ts +++ b/ui/src/hooks/use-cliproxy-auth-flow.ts @@ -18,6 +18,10 @@ const AUTH_ENDPOINTS: Record = { gemini: '/gemini-cli-auth-url', codex: '/codex-auth-url', agy: '/antigravity-auth-url', + qwen: '/qwen-auth-url', + iflow: '/iflow-auth-url', + kiro: '/kiro-auth-url', + ghcp: '/ghcp-auth-url', }; const AUTH_TIMEOUT_MS = 300000; // 5 minutes diff --git a/ui/src/pages/settings/sections/globalenv-section.tsx b/ui/src/pages/settings/sections/globalenv-section.tsx index f38b67fd..a055f577 100644 --- a/ui/src/pages/settings/sections/globalenv-section.tsx +++ b/ui/src/pages/settings/sections/globalenv-section.tsx @@ -81,7 +81,7 @@ export default function GlobalEnvSection() {

Environment variables injected into all non-Claude subscription profiles (gemini, codex, - agy, copilot, etc.) + agy, ghcp, etc.)

{/* Enable/Disable Toggle */} From b93b91c92596a747aae6b083819b1ec8162c1f5d Mon Sep 17 00:00:00 2001 From: kaitranntt Date: Mon, 22 Dec 2025 01:09:25 -0500 Subject: [PATCH 20/21] docs: update documentation for kiro and ghcp providers - add ccs kiro and ccs ghcp to README commands - update project-overview-pdr with v7.2 and FR-003 OAuth flows - update system-architecture with OAuth flow types - update codebase-summary with 7 CLIProxy providers - update project-roadmap with Phase 11 completion --- README.md | 7 +++-- docs/codebase-summary.md | 6 ++-- docs/project-overview-pdr.md | 19 ++++++++---- docs/project-roadmap.md | 9 ++++-- docs/system-architecture.md | 60 +++++++++++++++++++++++++++++------- 5 files changed, 76 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 3302a2e5..22653876 100644 --- a/README.md +++ b/README.md @@ -89,7 +89,7 @@ The dashboard provides visual management for all account types: | **Claude** | Subscription | `ccs` | Default, strategic planning | | **Gemini** | OAuth | `ccs gemini` | Zero-config, fast iteration | | **Codex** | OAuth | `ccs codex` | Code generation | -| **Copilot** | OAuth | `ccs copilot` | GitHub Copilot models | +| **Copilot** | OAuth | `ccs copilot` or `ccs ghcp` | GitHub Copilot models | | **Kiro** | OAuth | `ccs kiro` | AWS CodeWhisperer (Claude-powered) | | **Antigravity** | OAuth | `ccs agy` | Alternative routing | | **OpenRouter** | API Key | `ccs openrouter` | 300+ models, unified API | @@ -118,8 +118,11 @@ The dashboard provides visual management for all account types: ```bash ccs # Default Claude session -ccs agy # Antigravity (OAuth) ccs gemini # Gemini (OAuth) +ccs codex # OpenAI Codex (OAuth) +ccs kiro # Kiro/AWS CodeWhisperer (OAuth) +ccs ghcp # GitHub Copilot (OAuth device flow) +ccs agy # Antigravity (OAuth) ccs glm # GLM (API key) ``` diff --git a/docs/codebase-summary.md b/docs/codebase-summary.md index 1f07e61d..f8b4ad44 100644 --- a/docs/codebase-summary.md +++ b/docs/codebase-summary.md @@ -1,8 +1,8 @@ # CCS Codebase Summary -Last Updated: 2025-12-21 +Last Updated: 2025-12-22 -Comprehensive overview of the modularized CCS codebase structure following the Phase 9 modularization effort (Settings, Analytics, Auth Monitor splits + Test Infrastructure) and v7.1 Remote CLIProxy feature. +Comprehensive overview of the modularized CCS codebase structure following the Phase 9 modularization effort (Settings, Analytics, Auth Monitor splits + Test Infrastructure), v7.1 Remote CLIProxy feature, and v7.2 Kiro + GitHub Copilot (ghcp) OAuth providers. ## Repository Structure @@ -163,7 +163,7 @@ src/ | Core | `commands/`, `errors/` | CLI commands, error handling | | Auth | `auth/`, `cliproxy/auth/` | Authentication across providers | | Config | `config/`, `types/` | Configuration & type definitions | -| Providers | `cliproxy/`, `copilot/`, `glmt/` | Provider integrations | +| Providers | `cliproxy/`, `copilot/`, `glmt/` | Provider integrations (7 CLIProxy providers: gemini, codex, agy, qwen, iflow, kiro, ghcp) | | Remote Proxy | `cliproxy/remote-*.ts`, `proxy-config-resolver.ts` | Remote CLIProxy support (v7.1) | | Services | `web-server/`, `api/` | HTTP server, API services | | Utilities | `utils/`, `management/` | Helpers, diagnostics | diff --git a/docs/project-overview-pdr.md b/docs/project-overview-pdr.md index 86e36719..f1f7db05 100644 --- a/docs/project-overview-pdr.md +++ b/docs/project-overview-pdr.md @@ -1,6 +1,6 @@ # CCS Product Development Requirements (PDR) -Last Updated: 2025-12-21 +Last Updated: 2025-12-22 ## Product Overview @@ -10,7 +10,7 @@ Last Updated: 2025-12-21 **Description**: CLI wrapper enabling seamless switching between multiple Claude accounts and alternative AI providers (GLM, Gemini, Codex, OpenRouter) with a React-based dashboard for configuration management. Supports both local and remote CLIProxyAPI instances. -**Current Version**: v7.1.x (Remote CLIProxy routing, OpenRouter integration) +**Current Version**: v7.2.x (Kiro + GitHub Copilot OAuth providers) --- @@ -31,7 +31,7 @@ Developers using Claude Code face these challenges: CCS provides: 1. **Multi-Account Claude**: Isolated instances via `CLAUDE_CONFIG_DIR` -2. **OAuth Providers**: Zero-config Gemini, Codex, Antigravity, Copilot integration +2. **OAuth Providers**: Zero-config Gemini, Codex, Antigravity, Copilot, Kiro (ghcp) integration 3. **API Profiles**: GLM, Kimi, OpenRouter, any Anthropic-compatible API 4. **Visual Dashboard**: React SPA for configuration management 5. **Automatic WebSearch**: MCP fallback for third-party providers @@ -64,8 +64,8 @@ CCS provides: - Share commands, skills, agents across accounts ### FR-003: OAuth Provider Integration -- Support Gemini, Codex, Antigravity, Copilot OAuth flows -- Browser-based authentication +- Support Gemini, Codex, Antigravity, Copilot, Kiro (ghcp) OAuth flows +- Browser-based authentication (Authorization Code flow for most, Device Code for ghcp) - Token caching and refresh ### FR-004: API Profile Management @@ -210,11 +210,16 @@ CCS provides: - [x] Fallback to local when remote unreachable - [x] Protocol-based default ports (HTTPS:443, HTTP:8317) +### v7.2 Release (Complete) +- [x] Kiro (AWS) OAuth provider support via CLIProxyAPIPlus +- [x] GitHub Copilot (ghcp) OAuth provider via Device Code flow +- [x] Authorization Code flow for Kiro (port 9876) +- [x] Device Code flow for ghcp (no local port needed) + ### v8.0 Release (Planned - Q1 2026) - [ ] Multiple CLIProxyAPI instances (load balancing, failover) - [ ] Native git worktree support - [ ] Critical bug fixes (#158, #155, #124) -- [ ] Kiro auth support (#157) ### v9.0 Release (Future - Q2 2026) - [ ] Team collaboration features @@ -230,6 +235,8 @@ CCS provides: - Anthropic Claude API - Google Gemini API - GitHub Codex/Copilot API +- GitHub Copilot (ghcp - Device Code OAuth) +- AWS Kiro (Authorization Code OAuth) - Z.AI GLM API - OpenRouter API diff --git a/docs/project-roadmap.md b/docs/project-roadmap.md index 72f095eb..832a16a3 100644 --- a/docs/project-roadmap.md +++ b/docs/project-roadmap.md @@ -1,6 +1,6 @@ # CCS Project Roadmap -Last Updated: 2025-12-21 +Last Updated: 2025-12-22 Forward-looking roadmap documenting current priorities, GitHub issues, and future feature plans. @@ -22,6 +22,7 @@ All major modularization work is complete. The codebase evolved from monolithic | 8 | Auth Monitor | `monitoring/auth-monitor/` (465->8 files) | | 9 | Test Infrastructure | 99 UI tests + 539 CLI tests, 90% coverage | | 10 | Remote CLIProxy | `proxy-config-resolver.ts`, `remote-proxy-client.ts` | +| 11 | Kiro + ghcp Providers | OAuth support via CLIProxyAPIPlus (v7.2) | **Metrics Achieved**: - Files >500 lines: 12 -> 5 (-58%) @@ -62,7 +63,7 @@ All major modularization work is complete. The codebase evolved from monolithic | Issue | Title | Type | Status | |-------|-------|------|--------| | #142 | Configure with available CLIProxyAPI | enhancement | **COMPLETE** (v7.1) | -| #157 | Support for Kiro auth from CLIProxyAPIPlus | enhancement | - | +| #157 | Support for Kiro auth from CLIProxyAPIPlus | enhancement | **COMPLETE** (v7.2) | | #123 | Add More Models | enhancement | Ongoing | | #114 | OpenCode Zen Free model + Auto Rotation API Key | enhancement | - | @@ -150,7 +151,8 @@ worktrees: ### Priority 5: Authentication Enhancements - **#158**: Fix AGY OAuth flow -- **#157**: Add Kiro auth support from CLIProxyAPIPlus +- **#157**: ~~Add Kiro auth support from CLIProxyAPIPlus~~ **COMPLETE** (v7.2) +- GitHub Copilot (ghcp) Device Code flow **COMPLETE** (v7.2) --- @@ -160,6 +162,7 @@ worktrees: |-----------|--------|--------| | Modularization (Phases 1-9) | COMPLETE | - | | Remote CLIProxy Support (#142) | COMPLETE | v7.1 | +| Kiro + GitHub Copilot OAuth (#157) | COMPLETE | v7.2 | | Critical Bug Fixes (#158, #155, #124) | PLANNED | Q1 2026 | | Multiple CLIProxyAPI Instances | PLANNED | Q1 2026 | | Git Worktree Support | PLANNED | Q1 2026 | diff --git a/docs/system-architecture.md b/docs/system-architecture.md index 91589e57..32d1e091 100644 --- a/docs/system-architecture.md +++ b/docs/system-architecture.md @@ -1,6 +1,6 @@ # CCS System Architecture -Last Updated: 2025-12-21 +Last Updated: 2025-12-22 High-level architecture documentation for the CCS (Claude Code Switch) system. @@ -8,12 +8,12 @@ High-level architecture documentation for the CCS (Claude Code Switch) system. ## System Overview -CCS is a CLI wrapper that enables seamless switching between multiple Claude accounts and alternative AI providers (GLM, Gemini, Codex). It consists of two main components: +CCS is a CLI wrapper that enables seamless switching between multiple Claude accounts and alternative AI providers (GLM, Gemini, Codex, Kiro, GitHub Copilot). It consists of two main components: 1. **CLI Application** (`src/`) - Node.js TypeScript CLI 2. **Dashboard UI** (`ui/`) - React web application served by Express -CCS v7.1 adds support for both **local** and **remote** CLIProxyAPI instances. +CCS v7.2 adds Kiro (AWS) and GitHub Copilot (ghcp) OAuth providers via CLIProxyAPIPlus. ``` +===========================================================================+ @@ -84,8 +84,9 @@ CCS v7.1 adds support for both **local** and **remote** CLIProxyAPI instances. Profile Resolution | v - 1. CLIProxy Hardcoded ----+---> gemini, codex, agy + 1. CLIProxy Hardcoded ----+---> gemini, codex, agy, kiro, ghcp (OAuth-based) | Zero-config OAuth providers + | (kiro: Auth Code, ghcp: Device Code) | 2. CLIProxy Variants -----+---> config.cliproxy section (User-defined) | Custom provider configurations @@ -296,11 +297,21 @@ CCS v7.1 adds support for both **local** and **remote** CLIProxyAPI instances. | ANTHROPIC_BASE_URL = localhost:XXXX v +------------------+ - | CLIProxyAPI | Local proxy binary + | CLIProxyAPI | Local proxy binary (CLIProxyAPIPlus for kiro/ghcp) | (binary) | +------------------+ | - +---> OAuth Authentication (Gemini, Codex, AGY) + +---> OAuth Authentication + | | + | +---> Authorization Code Flow (port-based) + | | - Gemini, Codex, Antigravity, Kiro (port 9876) + | | - Opens browser for user auth + | | - Callback to localhost:PORT + | | + | +---> Device Code Flow (no port needed) + | - GitHub Copilot (ghcp) + | - User enters code at github.com/login/device + | - Polls for token completion | | | v | +------------------+ @@ -317,6 +328,8 @@ CCS v7.1 adds support for both **local** and **remote** CLIProxyAPI instances. +---> Google (Gemini) +---> GitHub (Codex) +---> Antigravity + +---> AWS Kiro (Claude-powered) + +---> GitHub Copilot (ghcp) +---> OpenAI-compatible endpoints ``` @@ -497,10 +510,10 @@ CCS v7.1 adds support for both **local** and **remote** CLIProxyAPI instances. | Authentication Flow | +===========================================================================+ - OAuth Providers (Gemini, Codex, AGY) - ----------------------------------- + OAuth Providers - Authorization Code Flow (Gemini, Codex, AGY, Kiro) + -------------------------------------------------------------------- - 1. User runs: ccs gemini + 1. User runs: ccs gemini (or ccs kiro) | v 2. Check token cache (~/.ccs/cliproxy/auth/) @@ -510,8 +523,8 @@ CCS v7.1 adds support for both **local** and **remote** CLIProxyAPI instances. +---> [No/Expired token] | v - 3. Open browser for OAuth - | + 3. Open browser for OAuth (localhost:PORT callback) + | - Kiro uses port 9876 v 4. Callback with auth code | @@ -522,6 +535,31 @@ CCS v7.1 adds support for both **local** and **remote** CLIProxyAPI instances. 6. Cache token locally + OAuth Providers - Device Code Flow (GitHub Copilot/ghcp) + -------------------------------------------------------- + + 1. User runs: ccs ghcp + | + v + 2. Check token cache (~/.ccs/cliproxy/auth/) + | + +---> [Valid token] ---> Use cached token + | + +---> [No/Expired token] + | + v + 3. Request device code from GitHub + | + v + 4. Display user code + verification URL + | "Enter code XXXX-XXXX at github.com/login/device" + v + 5. Poll for token (user completes auth in browser) + | + v + 6. Receive and cache token locally + + API Key Profiles (GLM, Kimi) ---------------------------- From 3c55ac906c4c6f6ebc7067d68dd26918ed2b16bf Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 22 Dec 2025 06:12:03 +0000 Subject: [PATCH 21/21] chore(release): 7.2.0-dev.1 [skip ci] --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 195157d1..26c5ce7b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@kaitranntt/ccs", - "version": "7.2.0", + "version": "7.2.0-dev.1", "description": "Claude Code Switch - Instant profile switching between Claude Sonnet 4.5 and GLM 4.6", "keywords": [ "cli",