From e80fdd055f4b841b0fd2fc0ef715ab8f00393ec5 Mon Sep 17 00:00:00 2001 From: Manikandan Sundararajan <10191300+itsrainingmani@users.noreply.github.com> Date: Wed, 14 Jan 2026 19:01:51 -0500 Subject: [PATCH 1/3] feat: add choco, scoop to opencode uninstall --- packages/opencode/src/cli/cmd/uninstall.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/opencode/src/cli/cmd/uninstall.ts b/packages/opencode/src/cli/cmd/uninstall.ts index 62210d57586..117871a35b9 100644 --- a/packages/opencode/src/cli/cmd/uninstall.ts +++ b/packages/opencode/src/cli/cmd/uninstall.ts @@ -133,6 +133,8 @@ async function showRemovalSummary(targets: RemovalTargets, method: Installation. bun: "bun remove -g opencode-ai", yarn: "yarn global remove opencode-ai", brew: "brew uninstall opencode", + choco: "choco uninstall opencode", + scoop: "scoop uninstall opencode", } prompts.log.info(` ✓ Package: ${cmds[method] || method}`) } @@ -182,12 +184,17 @@ async function executeUninstall(method: Installation.Method, targets: RemovalTar bun: ["bun", "remove", "-g", "opencode-ai"], yarn: ["yarn", "global", "remove", "opencode-ai"], brew: ["brew", "uninstall", "opencode"], + choco: ["choco", "uninstall", "opencode"], + scoop: ["scoop", "uninstall", "opencode"], } const cmd = cmds[method] if (cmd) { spinner.start(`Running ${cmd.join(" ")}...`) - const result = await $`${cmd}`.quiet().nothrow() + const result = + method === "choco" + ? await $`echo Y | choco uninstall opencode -y -r`.quiet().nothrow() + : await $`${cmd}`.quiet().nothrow() if (result.exitCode !== 0) { spinner.stop(`Package manager uninstall failed`, 1) prompts.log.warn(`You may need to run manually: ${cmd.join(" ")}`) From 0dbd6bad945f65ff21e4c0c1218f0249aad247a7 Mon Sep 17 00:00:00 2001 From: Manikandan Sundararajan <10191300+itsrainingmani@users.noreply.github.com> Date: Wed, 14 Jan 2026 19:45:14 -0500 Subject: [PATCH 2/3] warn users if they try to choco uninstall in non-elevated command shell --- packages/opencode/src/cli/cmd/uninstall.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/opencode/src/cli/cmd/uninstall.ts b/packages/opencode/src/cli/cmd/uninstall.ts index 117871a35b9..ad8469bc764 100644 --- a/packages/opencode/src/cli/cmd/uninstall.ts +++ b/packages/opencode/src/cli/cmd/uninstall.ts @@ -197,7 +197,15 @@ async function executeUninstall(method: Installation.Method, targets: RemovalTar : await $`${cmd}`.quiet().nothrow() if (result.exitCode !== 0) { spinner.stop(`Package manager uninstall failed`, 1) - prompts.log.warn(`You may need to run manually: ${cmd.join(" ")}`) + if ( + method === "choco" && + result.stdout.toString("utf8").includes("not running from an elevated command shell") + ) { + prompts.log.warn(`You may need to run '${cmd.join(" ")}' from an elevated command shell`) + } else { + prompts.log.warn(`You may need to run manually: ${cmd.join(" ")}`) + } + errors.push(`Package manager: exit code ${result.exitCode}`) } else { spinner.stop("Package removed") From 53b9939fc71e7a050974ec3141ead1d6f530fb32 Mon Sep 17 00:00:00 2001 From: Manikandan Sundararajan <10191300+itsrainingmani@users.noreply.github.com> Date: Wed, 14 Jan 2026 23:00:22 -0500 Subject: [PATCH 3/3] merge redundant package manager uninstall failed messages --- packages/opencode/src/cli/cmd/uninstall.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/opencode/src/cli/cmd/uninstall.ts b/packages/opencode/src/cli/cmd/uninstall.ts index ad8469bc764..704d3572bbb 100644 --- a/packages/opencode/src/cli/cmd/uninstall.ts +++ b/packages/opencode/src/cli/cmd/uninstall.ts @@ -196,7 +196,7 @@ async function executeUninstall(method: Installation.Method, targets: RemovalTar ? await $`echo Y | choco uninstall opencode -y -r`.quiet().nothrow() : await $`${cmd}`.quiet().nothrow() if (result.exitCode !== 0) { - spinner.stop(`Package manager uninstall failed`, 1) + spinner.stop(`Package manager uninstall failed: exit code ${result.exitCode}`, 1) if ( method === "choco" && result.stdout.toString("utf8").includes("not running from an elevated command shell") @@ -205,8 +205,6 @@ async function executeUninstall(method: Installation.Method, targets: RemovalTar } else { prompts.log.warn(`You may need to run manually: ${cmd.join(" ")}`) } - - errors.push(`Package manager: exit code ${result.exitCode}`) } else { spinner.stop("Package removed") }