refactor(cli): remove ChatGPT subscription check from installer
- Remove chatgpt option from CLI args and types - Remove ChatGPT prompt from TUI installer flow - Update config detection to not include hasChatGPT - Update related tests
This commit is contained in:
parent
3be387d9e3
commit
2c3f1bfd80
@ -206,7 +206,6 @@ describe("generateOmoConfig - v3 beta: no hardcoded models", () => {
|
|||||||
const config: InstallConfig = {
|
const config: InstallConfig = {
|
||||||
hasClaude: true,
|
hasClaude: true,
|
||||||
isMax20: false,
|
isMax20: false,
|
||||||
hasChatGPT: true,
|
|
||||||
hasGemini: false,
|
hasGemini: false,
|
||||||
hasCopilot: false,
|
hasCopilot: false,
|
||||||
}
|
}
|
||||||
@ -225,7 +224,6 @@ describe("generateOmoConfig - v3 beta: no hardcoded models", () => {
|
|||||||
const config: InstallConfig = {
|
const config: InstallConfig = {
|
||||||
hasClaude: true,
|
hasClaude: true,
|
||||||
isMax20: true,
|
isMax20: true,
|
||||||
hasChatGPT: true,
|
|
||||||
hasGemini: true,
|
hasGemini: true,
|
||||||
hasCopilot: true,
|
hasCopilot: true,
|
||||||
}
|
}
|
||||||
@ -243,7 +241,6 @@ describe("generateOmoConfig - v3 beta: no hardcoded models", () => {
|
|||||||
const config: InstallConfig = {
|
const config: InstallConfig = {
|
||||||
hasClaude: false,
|
hasClaude: false,
|
||||||
isMax20: false,
|
isMax20: false,
|
||||||
hasChatGPT: false,
|
|
||||||
hasGemini: false,
|
hasGemini: false,
|
||||||
hasCopilot: false,
|
hasCopilot: false,
|
||||||
}
|
}
|
||||||
|
|||||||
@ -587,7 +587,6 @@ export function detectCurrentConfig(): DetectedConfig {
|
|||||||
isInstalled: false,
|
isInstalled: false,
|
||||||
hasClaude: true,
|
hasClaude: true,
|
||||||
isMax20: true,
|
isMax20: true,
|
||||||
hasChatGPT: true,
|
|
||||||
hasGemini: false,
|
hasGemini: false,
|
||||||
hasCopilot: false,
|
hasCopilot: false,
|
||||||
}
|
}
|
||||||
|
|||||||
@ -24,26 +24,23 @@ program
|
|||||||
.description("Install and configure oh-my-opencode with interactive setup")
|
.description("Install and configure oh-my-opencode with interactive setup")
|
||||||
.option("--no-tui", "Run in non-interactive mode (requires all options)")
|
.option("--no-tui", "Run in non-interactive mode (requires all options)")
|
||||||
.option("--claude <value>", "Claude subscription: no, yes, max20")
|
.option("--claude <value>", "Claude subscription: no, yes, max20")
|
||||||
.option("--chatgpt <value>", "ChatGPT subscription: no, yes")
|
|
||||||
.option("--gemini <value>", "Gemini integration: no, yes")
|
.option("--gemini <value>", "Gemini integration: no, yes")
|
||||||
.option("--copilot <value>", "GitHub Copilot subscription: no, yes")
|
.option("--copilot <value>", "GitHub Copilot subscription: no, yes")
|
||||||
.option("--skip-auth", "Skip authentication setup hints")
|
.option("--skip-auth", "Skip authentication setup hints")
|
||||||
.addHelpText("after", `
|
.addHelpText("after", `
|
||||||
Examples:
|
Examples:
|
||||||
$ bunx oh-my-opencode install
|
$ bunx oh-my-opencode install
|
||||||
$ bunx oh-my-opencode install --no-tui --claude=max20 --chatgpt=yes --gemini=yes --copilot=no
|
$ bunx oh-my-opencode install --no-tui --claude=max20 --gemini=yes --copilot=no
|
||||||
$ bunx oh-my-opencode install --no-tui --claude=no --chatgpt=no --gemini=no --copilot=yes
|
$ bunx oh-my-opencode install --no-tui --claude=no --gemini=no --copilot=yes
|
||||||
|
|
||||||
Model Providers:
|
Model Providers:
|
||||||
Claude Required for Sisyphus (main orchestrator) and Librarian agents
|
Claude Required for Sisyphus (main orchestrator) and Librarian agents
|
||||||
ChatGPT Powers the Oracle agent for debugging and architecture
|
|
||||||
Gemini Powers frontend, documentation, and multimodal agents
|
Gemini Powers frontend, documentation, and multimodal agents
|
||||||
`)
|
`)
|
||||||
.action(async (options) => {
|
.action(async (options) => {
|
||||||
const args: InstallArgs = {
|
const args: InstallArgs = {
|
||||||
tui: options.tui !== false,
|
tui: options.tui !== false,
|
||||||
claude: options.claude,
|
claude: options.claude,
|
||||||
chatgpt: options.chatgpt,
|
|
||||||
gemini: options.gemini,
|
gemini: options.gemini,
|
||||||
copilot: options.copilot,
|
copilot: options.copilot,
|
||||||
skipAuth: options.skipAuth ?? false,
|
skipAuth: options.skipAuth ?? false,
|
||||||
|
|||||||
@ -39,7 +39,6 @@ function formatConfigSummary(config: InstallConfig): string {
|
|||||||
|
|
||||||
const claudeDetail = config.hasClaude ? (config.isMax20 ? "max20" : "standard") : undefined
|
const claudeDetail = config.hasClaude ? (config.isMax20 ? "max20" : "standard") : undefined
|
||||||
lines.push(formatProvider("Claude", config.hasClaude, claudeDetail))
|
lines.push(formatProvider("Claude", config.hasClaude, claudeDetail))
|
||||||
lines.push(formatProvider("ChatGPT", config.hasChatGPT))
|
|
||||||
lines.push(formatProvider("Gemini", config.hasGemini))
|
lines.push(formatProvider("Gemini", config.hasGemini))
|
||||||
lines.push(formatProvider("GitHub Copilot", config.hasCopilot, "fallback provider"))
|
lines.push(formatProvider("GitHub Copilot", config.hasCopilot, "fallback provider"))
|
||||||
|
|
||||||
@ -115,12 +114,6 @@ function validateNonTuiArgs(args: InstallArgs): { valid: boolean; errors: string
|
|||||||
errors.push(`Invalid --claude value: ${args.claude} (expected: no, yes, max20)`)
|
errors.push(`Invalid --claude value: ${args.claude} (expected: no, yes, max20)`)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.chatgpt === undefined) {
|
|
||||||
errors.push("--chatgpt is required (values: no, yes)")
|
|
||||||
} else if (!["no", "yes"].includes(args.chatgpt)) {
|
|
||||||
errors.push(`Invalid --chatgpt value: ${args.chatgpt} (expected: no, yes)`)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (args.gemini === undefined) {
|
if (args.gemini === undefined) {
|
||||||
errors.push("--gemini is required (values: no, yes)")
|
errors.push("--gemini is required (values: no, yes)")
|
||||||
} else if (!["no", "yes"].includes(args.gemini)) {
|
} else if (!["no", "yes"].includes(args.gemini)) {
|
||||||
@ -140,13 +133,12 @@ function argsToConfig(args: InstallArgs): InstallConfig {
|
|||||||
return {
|
return {
|
||||||
hasClaude: args.claude !== "no",
|
hasClaude: args.claude !== "no",
|
||||||
isMax20: args.claude === "max20",
|
isMax20: args.claude === "max20",
|
||||||
hasChatGPT: args.chatgpt === "yes",
|
|
||||||
hasGemini: args.gemini === "yes",
|
hasGemini: args.gemini === "yes",
|
||||||
hasCopilot: args.copilot === "yes",
|
hasCopilot: args.copilot === "yes",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function detectedToInitialValues(detected: DetectedConfig): { claude: ClaudeSubscription; chatgpt: BooleanArg; gemini: BooleanArg; copilot: BooleanArg } {
|
function detectedToInitialValues(detected: DetectedConfig): { claude: ClaudeSubscription; gemini: BooleanArg; copilot: BooleanArg } {
|
||||||
let claude: ClaudeSubscription = "no"
|
let claude: ClaudeSubscription = "no"
|
||||||
if (detected.hasClaude) {
|
if (detected.hasClaude) {
|
||||||
claude = detected.isMax20 ? "max20" : "yes"
|
claude = detected.isMax20 ? "max20" : "yes"
|
||||||
@ -154,7 +146,6 @@ function detectedToInitialValues(detected: DetectedConfig): { claude: ClaudeSubs
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
claude,
|
claude,
|
||||||
chatgpt: detected.hasChatGPT ? "yes" : "no",
|
|
||||||
gemini: detected.hasGemini ? "yes" : "no",
|
gemini: detected.hasGemini ? "yes" : "no",
|
||||||
copilot: detected.hasCopilot ? "yes" : "no",
|
copilot: detected.hasCopilot ? "yes" : "no",
|
||||||
}
|
}
|
||||||
@ -178,20 +169,6 @@ async function runTuiMode(detected: DetectedConfig): Promise<InstallConfig | nul
|
|||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
const chatgpt = await p.select({
|
|
||||||
message: "Do you have a ChatGPT Plus/Pro subscription?",
|
|
||||||
options: [
|
|
||||||
{ value: "no" as const, label: "No", hint: "Oracle will use fallback model" },
|
|
||||||
{ value: "yes" as const, label: "Yes", hint: "GPT-5.2 for debugging and architecture" },
|
|
||||||
],
|
|
||||||
initialValue: initial.chatgpt,
|
|
||||||
})
|
|
||||||
|
|
||||||
if (p.isCancel(chatgpt)) {
|
|
||||||
p.cancel("Installation cancelled.")
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
|
|
||||||
const gemini = await p.select({
|
const gemini = await p.select({
|
||||||
message: "Will you integrate Google Gemini?",
|
message: "Will you integrate Google Gemini?",
|
||||||
options: [
|
options: [
|
||||||
@ -223,7 +200,6 @@ async function runTuiMode(detected: DetectedConfig): Promise<InstallConfig | nul
|
|||||||
return {
|
return {
|
||||||
hasClaude: claude !== "no",
|
hasClaude: claude !== "no",
|
||||||
isMax20: claude === "max20",
|
isMax20: claude === "max20",
|
||||||
hasChatGPT: chatgpt === "yes",
|
|
||||||
hasGemini: gemini === "yes",
|
hasGemini: gemini === "yes",
|
||||||
hasCopilot: copilot === "yes",
|
hasCopilot: copilot === "yes",
|
||||||
}
|
}
|
||||||
@ -238,7 +214,7 @@ async function runNonTuiInstall(args: InstallArgs): Promise<number> {
|
|||||||
console.log(` ${SYMBOLS.bullet} ${err}`)
|
console.log(` ${SYMBOLS.bullet} ${err}`)
|
||||||
}
|
}
|
||||||
console.log()
|
console.log()
|
||||||
printInfo("Usage: bunx oh-my-opencode install --no-tui --claude=<no|yes|max20> --chatgpt=<no|yes> --gemini=<no|yes> --copilot=<no|yes>")
|
printInfo("Usage: bunx oh-my-opencode install --no-tui --claude=<no|yes|max20> --gemini=<no|yes> --copilot=<no|yes>")
|
||||||
console.log()
|
console.log()
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
@ -264,7 +240,7 @@ async function runNonTuiInstall(args: InstallArgs): Promise<number> {
|
|||||||
|
|
||||||
if (isUpdate) {
|
if (isUpdate) {
|
||||||
const initial = detectedToInitialValues(detected)
|
const initial = detectedToInitialValues(detected)
|
||||||
printInfo(`Current config: Claude=${initial.claude}, ChatGPT=${initial.chatgpt}, Gemini=${initial.gemini}`)
|
printInfo(`Current config: Claude=${initial.claude}, Gemini=${initial.gemini}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
const config = argsToConfig(args)
|
const config = argsToConfig(args)
|
||||||
@ -307,7 +283,7 @@ async function runNonTuiInstall(args: InstallArgs): Promise<number> {
|
|||||||
|
|
||||||
printBox(formatConfigSummary(config), isUpdate ? "Updated Configuration" : "Installation Complete")
|
printBox(formatConfigSummary(config), isUpdate ? "Updated Configuration" : "Installation Complete")
|
||||||
|
|
||||||
if (!config.hasClaude && !config.hasChatGPT && !config.hasGemini && !config.hasCopilot) {
|
if (!config.hasClaude && !config.hasGemini && !config.hasCopilot) {
|
||||||
printWarning("No model providers configured. Using opencode/glm-4.7-free as fallback.")
|
printWarning("No model providers configured. Using opencode/glm-4.7-free as fallback.")
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -328,11 +304,10 @@ async function runNonTuiInstall(args: InstallArgs): Promise<number> {
|
|||||||
console.log(color.dim("oMoMoMoMo... Enjoy!"))
|
console.log(color.dim("oMoMoMoMo... Enjoy!"))
|
||||||
console.log()
|
console.log()
|
||||||
|
|
||||||
if ((config.hasClaude || config.hasChatGPT || config.hasGemini || config.hasCopilot) && !args.skipAuth) {
|
if ((config.hasClaude || config.hasGemini || config.hasCopilot) && !args.skipAuth) {
|
||||||
printBox(
|
printBox(
|
||||||
`Run ${color.cyan("opencode auth login")} and select your provider:\n` +
|
`Run ${color.cyan("opencode auth login")} and select your provider:\n` +
|
||||||
(config.hasClaude ? ` ${SYMBOLS.bullet} Anthropic ${color.gray("→ Claude Pro/Max")}\n` : "") +
|
(config.hasClaude ? ` ${SYMBOLS.bullet} Anthropic ${color.gray("→ Claude Pro/Max")}\n` : "") +
|
||||||
(config.hasChatGPT ? ` ${SYMBOLS.bullet} OpenAI ${color.gray("→ ChatGPT Plus/Pro")}\n` : "") +
|
|
||||||
(config.hasGemini ? ` ${SYMBOLS.bullet} Google ${color.gray("→ OAuth with Antigravity")}\n` : "") +
|
(config.hasGemini ? ` ${SYMBOLS.bullet} Google ${color.gray("→ OAuth with Antigravity")}\n` : "") +
|
||||||
(config.hasCopilot ? ` ${SYMBOLS.bullet} GitHub ${color.gray("→ Copilot")}` : ""),
|
(config.hasCopilot ? ` ${SYMBOLS.bullet} GitHub ${color.gray("→ Copilot")}` : ""),
|
||||||
"🔐 Authenticate Your Providers"
|
"🔐 Authenticate Your Providers"
|
||||||
@ -354,7 +329,7 @@ export async function install(args: InstallArgs): Promise<number> {
|
|||||||
|
|
||||||
if (isUpdate) {
|
if (isUpdate) {
|
||||||
const initial = detectedToInitialValues(detected)
|
const initial = detectedToInitialValues(detected)
|
||||||
p.log.info(`Existing configuration detected: Claude=${initial.claude}, ChatGPT=${initial.chatgpt}, Gemini=${initial.gemini}`)
|
p.log.info(`Existing configuration detected: Claude=${initial.claude}, Gemini=${initial.gemini}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
const s = p.spinner()
|
const s = p.spinner()
|
||||||
@ -413,7 +388,7 @@ export async function install(args: InstallArgs): Promise<number> {
|
|||||||
}
|
}
|
||||||
s.stop(`Config written to ${color.cyan(omoResult.configPath)}`)
|
s.stop(`Config written to ${color.cyan(omoResult.configPath)}`)
|
||||||
|
|
||||||
if (!config.hasClaude && !config.hasChatGPT && !config.hasGemini && !config.hasCopilot) {
|
if (!config.hasClaude && !config.hasGemini && !config.hasCopilot) {
|
||||||
p.log.warn("No model providers configured. Using opencode/glm-4.7-free as fallback.")
|
p.log.warn("No model providers configured. Using opencode/glm-4.7-free as fallback.")
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -434,10 +409,9 @@ export async function install(args: InstallArgs): Promise<number> {
|
|||||||
|
|
||||||
p.outro(color.green("oMoMoMoMo... Enjoy!"))
|
p.outro(color.green("oMoMoMoMo... Enjoy!"))
|
||||||
|
|
||||||
if ((config.hasClaude || config.hasChatGPT || config.hasGemini || config.hasCopilot) && !args.skipAuth) {
|
if ((config.hasClaude || config.hasGemini || config.hasCopilot) && !args.skipAuth) {
|
||||||
const providers: string[] = []
|
const providers: string[] = []
|
||||||
if (config.hasClaude) providers.push(`Anthropic ${color.gray("→ Claude Pro/Max")}`)
|
if (config.hasClaude) providers.push(`Anthropic ${color.gray("→ Claude Pro/Max")}`)
|
||||||
if (config.hasChatGPT) providers.push(`OpenAI ${color.gray("→ ChatGPT Plus/Pro")}`)
|
|
||||||
if (config.hasGemini) providers.push(`Google ${color.gray("→ OAuth with Antigravity")}`)
|
if (config.hasGemini) providers.push(`Google ${color.gray("→ OAuth with Antigravity")}`)
|
||||||
if (config.hasCopilot) providers.push(`GitHub ${color.gray("→ Copilot")}`)
|
if (config.hasCopilot) providers.push(`GitHub ${color.gray("→ Copilot")}`)
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,6 @@ export type BooleanArg = "no" | "yes"
|
|||||||
export interface InstallArgs {
|
export interface InstallArgs {
|
||||||
tui: boolean
|
tui: boolean
|
||||||
claude?: ClaudeSubscription
|
claude?: ClaudeSubscription
|
||||||
chatgpt?: BooleanArg
|
|
||||||
gemini?: BooleanArg
|
gemini?: BooleanArg
|
||||||
copilot?: BooleanArg
|
copilot?: BooleanArg
|
||||||
skipAuth?: boolean
|
skipAuth?: boolean
|
||||||
@ -13,7 +12,6 @@ export interface InstallArgs {
|
|||||||
export interface InstallConfig {
|
export interface InstallConfig {
|
||||||
hasClaude: boolean
|
hasClaude: boolean
|
||||||
isMax20: boolean
|
isMax20: boolean
|
||||||
hasChatGPT: boolean
|
|
||||||
hasGemini: boolean
|
hasGemini: boolean
|
||||||
hasCopilot: boolean
|
hasCopilot: boolean
|
||||||
}
|
}
|
||||||
@ -28,7 +26,6 @@ export interface DetectedConfig {
|
|||||||
isInstalled: boolean
|
isInstalled: boolean
|
||||||
hasClaude: boolean
|
hasClaude: boolean
|
||||||
isMax20: boolean
|
isMax20: boolean
|
||||||
hasChatGPT: boolean
|
|
||||||
hasGemini: boolean
|
hasGemini: boolean
|
||||||
hasCopilot: boolean
|
hasCopilot: boolean
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user