Commit Graph
1 Commits
Author SHA1 Message Date
yetone 4e85cac01d agent: OpenCode installs as OpenCode 2 (@opencode/cli, opencode.ai/v2/install) (math_milian)
math_milian on Discord: magpie's npm command for OpenCode installs
OpenCode 1, and OpenCode 2 isn't installed that way. On 2026-11-05
opencode-ai's latest is 1.19.5 and it has no 2.x; OpenCode 2 is
@opencode/cli (2.2.5, anomalyco/opencode's README), and
opencode.ai/install refuses a 2.x ("not an OpenCode 1 release") and
points to opencode.ai/v2/install.

- Install: opencode.ai/v2/install on a Mac or Linux, then
  npm install -g --allow-scripts=@opencode/cli @opencode/cli. Air's
  "OpenCode isn't installed" notice says the same, in every language.
- Update: an install from either package is updated within it (npm,
  bun, pnpm by where it sits; brew's opencode or anomalyco/tap's
  opencode-v2). An installer copy in ~/.opencode/bin is offered its
  own line's newest: OpenCode 2 @opencode/cli's, OpenCode 1
  opencode-ai's, since OpenCode 1's opencode upgrade runs the v1-only
  installer. An unreadable version promises none.
- An existing opencode-ai install isn't moved to OpenCode 2: its
  config differs, and npm needs --force over the other package's bin.

Run (mote): gofmt -l, go vet ./internal/agent, GOOS=linux/windows go
vet, go test ./internal/agent -run 'Install|UpdateCLI|HowInstalled|Mend|
Npm|Bun|Pnpm|Shim|Scripts|CLI|OpenCode|Air' ok; node --test i18n-keys,
i18n-en-no-cjk, agent-air-own, agent-notice-lang, agent-cli-missing: 82
pass. Real, sandbox HOME on mote: curl -fsSL opencode.ai/v2/install |
bash gave ~/.opencode/bin/opencode and opencode2, "opencode v2.2.5";
`opencode upgrade 2.2.4` from there went to v2.2.4 (magpie's target
form); npm 10.9.4 and 11.21.2 with magpie's exact command gave v2.2.5,
opencode2 too; `opencode acp` is in 2.2.5 for Air.
Broken by hand: opencode-ai first in npm turns TestInstallCommands red;
without the line hook TestUpdateCLIOpenCodeKeepsItsLine/1.19.4 is
offered 2.2.5 and TestUpdateCLIOpenCodeTakesVersion goes red.
Not tried: Windows npm install for real, Homebrew's opencode-v2 tap,
moving a real opencode-ai user to OpenCode 2.
2026-11-05 11:50:13 +08:00