feat: migrate to OpenCode 2
PR Checks / hadolint (pull_request) Successful in 12s
PR Checks / build-test (pull_request) Successful in 3m14s

OpenCode 2 publishes its CLI as @opencode/cli (opencode-ai stops at
1.19.x), so install that package and pin it to 2.0.32.

Also fix what the v2 migration invalidates:
- renovate.json: track @opencode/cli instead of opencode-ai, otherwise
  the pin is never bumped.
- opencode-attach: `opencode attach` no longer exists in v2. Point the
  client at the server with `--server <url>` instead (appended after a
  subcommand when one is given); auth still comes from
  OPENCODE_SERVER_PASSWORD / OPENCODE_PASSWORD.
- README/AGENTS: v2 package name, entrypoint, serve defaults, API
  surface (/global/health is gone, everything lives under authenticated
  /api/*), and removal of OPENCODE_SERVER_USERNAME (the username is
  always `opencode` in v2).

The entrypoint stays ["opencode"] on purpose: existing deployments pass
`serve ...` at runtime, and OpenCode 2 is invoked the same way.
This commit is contained in:
OpenCode Cabillot committed 2026-10-17 19:28:14 +00:00
1 parent 82cfa4af95
commit c2c0a81547
5 files changed
+65 -37

No files matched your search

+1 -1
View File
@@ -16,7 +16,7 @@ RUN apt-get update && \
npm install -g --no-fund --no-audit --ignore-scripts n2-soul@9.0.9 && \
npm install -g --no-fund --no-audit --allow-scripts=better-sqlite3 better-sqlite3@12.11.1 && \
rm -rf /usr/local/lib/node_modules/n2-soul/node_modules/better-sqlite3 && \
npm install -g --no-fund --no-audit --allow-scripts=opencode-ai opencode-ai@1.19.0 && \
npm install -g --no-fund --no-audit --allow-scripts=@opencode/cli @opencode/cli@2.0.32 && \
npm cache clean --force && \
chown -R 1000:1000 /usr/local/lib/node_modules/n2-soul/