From d7326e1eeb8a2edb7eeebab7fd513d8ed9869515 Mon Sep 17 00:00:00 2001 From: sisyphus-dev-ai Date: Wed, 14 Jan 2026 02:24:52 +0000 Subject: [PATCH] feat(installer): add GitHub Copilot support with priority-based fallback Add GitHub Copilot as a fallback provider option in the installer. Native providers (Claude/ChatGPT/Gemini) have priority over Copilot. - Add hasCopilot field to InstallConfig and DetectedConfig types - Add --copilot flag support for both TUI and non-TUI modes - Add Copilot prompt in interactive installer (after Gemini) - Update model selection logic to use Copilot fallback when native providers unavailable - Update configuration summary to display Copilot status Addresses #762 Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus --- src/cli/install.ts | 32 ++++++++++++++++++++++++++++---- src/cli/types.ts | 3 +++ 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/src/cli/install.ts b/src/cli/install.ts index 58452118..f1c16f69 100644 --- a/src/cli/install.ts +++ b/src/cli/install.ts @@ -38,6 +38,7 @@ function formatConfigSummary(config: InstallConfig): string { lines.push(formatProvider("Claude", config.hasClaude, claudeDetail)) lines.push(formatProvider("ChatGPT", config.hasChatGPT)) lines.push(formatProvider("Gemini", config.hasGemini)) + lines.push(formatProvider("GitHub Copilot", config.hasCopilot, "fallback provider")) lines.push("") lines.push(color.dim("─".repeat(40))) @@ -46,8 +47,8 @@ function formatConfigSummary(config: InstallConfig): string { lines.push(color.bold(color.white("Agent Configuration"))) lines.push("") - const sisyphusModel = config.hasClaude ? "claude-opus-4-5" : "glm-4.7-free" - const oracleModel = config.hasChatGPT ? "gpt-5.2" : (config.hasClaude ? "claude-opus-4-5" : "glm-4.7-free") + const sisyphusModel = config.hasClaude ? "claude-opus-4-5" : (config.hasCopilot ? "github-copilot/claude-opus-4.5" : "glm-4.7-free") + const oracleModel = config.hasChatGPT ? "gpt-5.2" : (config.hasCopilot ? "github-copilot/gpt-5.2" : (config.hasClaude ? "claude-opus-4-5" : "glm-4.7-free")) const librarianModel = "glm-4.7-free" const frontendModel = config.hasGemini ? "antigravity-gemini-3-pro-high" : (config.hasClaude ? "claude-opus-4-5" : "glm-4.7-free") @@ -130,6 +131,12 @@ function validateNonTuiArgs(args: InstallArgs): { valid: boolean; errors: string errors.push(`Invalid --gemini value: ${args.gemini} (expected: no, yes)`) } + if (args.copilot === undefined) { + errors.push("--copilot is required (values: no, yes)") + } else if (!["no", "yes"].includes(args.copilot)) { + errors.push(`Invalid --copilot value: ${args.copilot} (expected: no, yes)`) + } + return { valid: errors.length === 0, errors } } @@ -139,10 +146,11 @@ function argsToConfig(args: InstallArgs): InstallConfig { isMax20: args.claude === "max20", hasChatGPT: args.chatgpt === "yes", hasGemini: args.gemini === "yes", + hasCopilot: args.copilot === "yes", } } -function detectedToInitialValues(detected: DetectedConfig): { claude: ClaudeSubscription; chatgpt: BooleanArg; gemini: BooleanArg } { +function detectedToInitialValues(detected: DetectedConfig): { claude: ClaudeSubscription; chatgpt: BooleanArg; gemini: BooleanArg; copilot: BooleanArg } { let claude: ClaudeSubscription = "no" if (detected.hasClaude) { claude = detected.isMax20 ? "max20" : "yes" @@ -152,6 +160,7 @@ function detectedToInitialValues(detected: DetectedConfig): { claude: ClaudeSubs claude, chatgpt: detected.hasChatGPT ? "yes" : "no", gemini: detected.hasGemini ? "yes" : "no", + copilot: detected.hasCopilot ? "yes" : "no", } } @@ -201,11 +210,26 @@ async function runTuiMode(detected: DetectedConfig): Promise { console.log(` ${SYMBOLS.bullet} ${err}`) } console.log() - printInfo("Usage: bunx oh-my-opencode install --no-tui --claude= --chatgpt= --gemini=") + printInfo("Usage: bunx oh-my-opencode install --no-tui --claude= --chatgpt= --gemini= --copilot=") console.log() return 1 } diff --git a/src/cli/types.ts b/src/cli/types.ts index 88767963..39214e79 100644 --- a/src/cli/types.ts +++ b/src/cli/types.ts @@ -6,6 +6,7 @@ export interface InstallArgs { claude?: ClaudeSubscription chatgpt?: BooleanArg gemini?: BooleanArg + copilot?: BooleanArg skipAuth?: boolean } @@ -14,6 +15,7 @@ export interface InstallConfig { isMax20: boolean hasChatGPT: boolean hasGemini: boolean + hasCopilot: boolean } export interface ConfigMergeResult { @@ -28,4 +30,5 @@ export interface DetectedConfig { isMax20: boolean hasChatGPT: boolean hasGemini: boolean + hasCopilot: boolean }