From 2c6dfe746b19dcbc43492dc8a03870b18a0b03f6 Mon Sep 17 00:00:00 2001 From: kaitranntt Date: Thu, 18 Dec 2025 04:47:44 -0500 Subject: [PATCH] fix(cli): allow ccs copilot as profile by routing only known subcommands MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changed copilot command routing logic to only intercept known subcommands (auth, status, models, start, stop, enable, disable, help). When user runs bare 'ccs copilot' without subcommands, it now falls through to profile detection and executes Claude with the Copilot API backend. This allows: - `ccs copilot auth` → command handler (authenticate) - `ccs copilot status` → command handler (show status) - `ccs copilot` → profile execution (run Claude with Copilot) --- src/ccs.ts | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/ccs.ts b/src/ccs.ts index e2cd448d..96a68692 100644 --- a/src/ccs.ts +++ b/src/ccs.ts @@ -339,8 +339,21 @@ async function main(): Promise { } // Special case: copilot command (GitHub Copilot integration) - if (firstArg === 'copilot') { - // `ccs copilot [subcommand]` - route to copilot command handler + // Only route to command handler for known subcommands, otherwise treat as profile + const COPILOT_SUBCOMMANDS = [ + 'auth', + 'status', + 'models', + 'start', + 'stop', + 'enable', + 'disable', + 'help', + '--help', + '-h', + ]; + if (firstArg === 'copilot' && args.length > 1 && COPILOT_SUBCOMMANDS.includes(args[1])) { + // `ccs copilot ` - route to copilot command handler const { handleCopilotCommand } = await import('./commands/copilot-command'); const exitCode = await handleCopilotCommand(args.slice(1)); process.exit(exitCode);