mirror of
https://github.com/tiennm99/ccs.git
synced 2026-08-09 18:24:54 +00:00
fix(cli): allow ccs copilot as profile by routing only known subcommands
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)
This commit is contained in:
+15
-2
@@ -339,8 +339,21 @@ async function main(): Promise<void> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Special case: copilot command (GitHub Copilot integration)
|
// Special case: copilot command (GitHub Copilot integration)
|
||||||
if (firstArg === 'copilot') {
|
// Only route to command handler for known subcommands, otherwise treat as profile
|
||||||
// `ccs copilot [subcommand]` - route to copilot command handler
|
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 <subcommand>` - route to copilot command handler
|
||||||
const { handleCopilotCommand } = await import('./commands/copilot-command');
|
const { handleCopilotCommand } = await import('./commands/copilot-command');
|
||||||
const exitCode = await handleCopilotCommand(args.slice(1));
|
const exitCode = await handleCopilotCommand(args.slice(1));
|
||||||
process.exit(exitCode);
|
process.exit(exitCode);
|
||||||
|
|||||||
Reference in New Issue
Block a user