Tool pages / OpenCode
OpenCode CLI 2.0.26: latest version, renamed packages and gotchas
Latest: OpenCode 2.0.26, released (release notes).
The latest OpenCode CLI (opencode, npm @opencode/cli, repo anomalyco/opencode) is 2.0.26, released 2026-10-08 19:43 UTC. Upgrade with opencode upgrade, npm i -g @opencode/cli@latest or brew install anomalyco/tap/opencode. OpenCode 2.0 moved its npm package from opencode-ai to @opencode/cli and redesigned the CLI into a subcommand tree (27 commands added, 42 removed in our diff); providers is now auth, db is gone, and unknown flags now print explicit errors. On npm 12, add --allow-scripts=@opencode/cli or the binary refuses to start.
How do I install or upgrade to OpenCode 2.0.26?
Built-in updater:
opencode upgrade # latest
opencode upgrade 2.0.26 # a specific versionnpm (npm 12 blocks the postinstall unless you allow it):
npm i -g --allow-scripts=@opencode/cli @opencode/cli@latest
opencode --version # opencode v2.0.26npm 11 and older:
npm i -g @opencode/cli@latestInstall script (macOS, Linux):
curl -fsSL https://opencode.ai/install | bashHomebrew (the project's tap; the core formula updates less often):
brew install anomalyco/tap/opencodePin a version:
npm i -g --allow-scripts=@opencode/cli @opencode/cli@2.0.26OpenCode key facts
- Latest release: 2.0.26 on 2026-10-08 19:43 UTC (GitHub tag
v2.0.26; npm@opencode/clipublish 19:43 UTC). Previous release: 2.0.25 on 2026-10-08 09:16 UTC. - OpenCode 2.0 moved its npm package from
opencode-ai(stops at 1.18.35) to@opencode/cli.npm i -g @opencode/cliinstalls 2.0.26. - Our sandbox diff found 27 commands added and 42 removed between 1.18.35 (62 help pages) and 2.0.26 (47 help pages):
opencode providersbecameopencode auth,opencode dbwas removed, and subcommands use a newSUBCOMMANDStree. - Unknown flags now print an explicit error (
ERROR Unrecognized flag: ... in command opencode ...). - npm 12 blocks lifecycle scripts by default;
@opencode/clineeds its postinstall, so install with--allow-scripts=@opencode/cli. opencode pair --remote(added in 2.0.25) shares the background service over OpenTunnel; 2.0.26 assigns unguessable 16-hex-character subdomains to prevent enumeration.- Two projects are called OpenCode. This page tracks anomalyco/opencode (npm
@opencode/cli, formerlyopencode-ai, MIT). The Go project opencode-ai/opencode was continued as Crush (charmbracelet/crush).
What changed in the last 5 OpenCode releases?
OpenCode 2.0.26 (2026-10-08 19:43 UTC)
- Remote access through OpenTunnel uses a 16-character random hex subdomain to prevent host enumeration in certificate transparency logs. (source)
- Google Cloud credential setup for Vertex AI added to
/connect. (source) - Reviewed V2 release notes saved in root CHANGELOG.md and led with highlights. (source)
- Transcript links clicked in the TUI open correctly, including across wrapped rows. (source)
OpenCode 2.0.25 (2026-10-08 09:16 UTC)
- Run
opencode pair --remoteto expose the background service through OpenTunnel with a one-time remote pairing link. (source) - Local, read-only previews for Word, Excel, and PowerPoint files in the file viewer. (source)
- AWS profile and SSO authentication for Amazon Bedrock in
/connect. (source) - Microsoft Entra ID authentication through Azure CLI for Azure models. (source)
OpenCode 2.0.24 (2026-10-06 03:01 UTC)
OpenCode 2.0.23 (2026-10-05 05:26 UTC)
OpenCode 2.0.22 (2026-10-02 04:21 UTC)
Which OpenCode commands and flags were added or removed?
OpenCode 1.18.35 → 2.0.26
27 commands added, 42 removed, 20 commands with flags added or removed; 20 help pages changed in any way.
Method: bin/tool-snapshot ran --help for every opencode subcommand of both versions in a throwaway Linux sandbox (62 and 47 help pages), then bin/tool-diff compared them. Hidden flags do not appear in --help.
Commands added:
opencode apiopencode authopencode auth exportopencode auth importopencode auth listopencode auth loginopencode auth logoutopencode auth switchopencode debug agentsopencode miniopencode pairopencode plugin addopencode plugin checkopencode plugin listopencode plugin removeopencode plugin updateopencode reloadopencode serviceopencode service getopencode service restartopencode service setopencode service startopencode service statusopencode service stopopencode service unsetopencode session exportopencode session import
Commands removed:
opencode agentopencode agent createopencode agent listopencode attachopencode completionopencode dbopencode db pathopencode debug agentopencode debug fileopencode debug file listopencode debug file readopencode debug file searchopencode debug infoopencode debug lspopencode debug lsp diagnosticsopencode debug lsp document-symbolsopencode debug lsp symbolsopencode debug rgopencode debug rg filesopencode debug rg searchopencode debug scrapopencode debug skillopencode debug snapshotopencode debug snapshot diffopencode debug snapshot patchopencode debug snapshot trackopencode debug startupopencode debug v2opencode debug waitopencode exportopencode githubopencode github installopencode github runopencode importopencode mcp auth listopencode mcp debugopencode propencode providersopencode providers listopencode providers loginopencode providers logoutopencode web
| Command | Flags added | Flags removed |
|---|---|---|
opencode | --completions--server--standalone--wizard | --agent--cors--fork--hostname--mdns--mdns-domain--mini--model--no-replay--port--pure--replay-limit |
opencode acp | --completions--login--wizard | --cors--cwd--hostname--mdns--mdns-domain--port--pure |
opencode debug | --completions--wizard | --pure |
opencode debug config | --completions--wizard | --pure |
opencode debug paths | --completions--wizard | --pure |
opencode mcp | --completions--wizard | --pure |
opencode mcp add | --completions--global--wizard | --pure |
opencode mcp auth | --completions--wizard | --pure |
opencode mcp list | --completions--wizard | --pure |
opencode mcp logout | --completions--wizard | --pure |
opencode models | --completions--server--standalone--wizard | --pure--refresh--verbose |
opencode plugin | --completions--wizard | --force--global--pure |
opencode run | --completions--server--standalone--wizard | --attach--command--dir--interactive--password--port--pure--share--username--variant |
opencode serve | --completions--service--stdio--wizard | --mdns--mdns-domain--pure |
opencode session | --completions--wizard | --pure |
opencode session delete | --completions--server--standalone--wizard | --pure |
opencode session list | --completions--server--standalone--wizard | --pure |
opencode stats | --all--completions--cost--full--json--limit--server--standalone--wizard--year | --pure |
opencode uninstall | --completions--wizard | --keep-config--keep-data--pure |
opencode upgrade | --completions--wizard | --pure |
- Major 2.0 release overhaul. OpenCode reorganised its command tree into SUBCOMMANDS:
opencode providersbecameopencode auth,opencode dbwas removed, the oldopencode attachcommand is absent, andexport/importmoved underopencode sessionandopencode auth. - Top-level and
runcommands gained--standaloneand--serverfor connecting to running services, while--purewas dropped from every command.
OpenCode 1.18.34 → 1.18.35
0 commands added, 0 removed, 0 commands with flags added or removed; 0 help pages changed in any way.
Method: bin/tool-snapshot ran --help for every opencode subcommand of both versions in a throwaway Linux sandbox (62 and 62 help pages), then bin/tool-diff compared them. Hidden flags do not appear in --help.
- The last two releases of the 1.18 line. Their
--helpoutput is identical: 1.18.35 changed provider behaviour (xAI tool-result images) and the stats pages, not the command line.
OpenCode 1.17.20 → 1.18.35
0 commands added, 0 removed, 0 commands with flags added or removed; 0 help pages changed in any way.
Method: bin/tool-snapshot ran --help for every opencode subcommand of both versions in a throwaway Linux sandbox (62 and 62 help pages), then bin/tool-diff compared them. Hidden flags do not appear in --help.
- The last two minor versions of 1.x (latest patch of each). All 62 help pages are byte-identical, so the whole 1.18 line (36 releases, 2026-07-14 to 2026-10-06) did not change a command or a visible flag.
OpenCode 1.17.11 → 1.17.12
0 commands added, 0 removed, 3 commands with flags added or removed; 3 help pages changed in any way.
Method: bin/tool-snapshot ran --help for every opencode subcommand of both versions in a throwaway Linux sandbox (62 and 62 help pages), then bin/tool-diff compared them. Hidden flags do not appear in --help.
| Command | Flags added | Flags removed |
|---|---|---|
opencode | --auto | none |
opencode completion | --auto | none |
opencode run | --auto--interactive | --dangerously-skip-permissions |
--autoreplaces--dangerously-skip-permissionsinopencode runhelp and arrives on the top-level TUI command;run -i, --interactivecomes back. The old name and--yoloare still accepted as hidden aliases (PR #34641).
What breaks when upgrading OpenCode, and how do I migrate?
| Version | Change | Migration |
|---|---|---|
| 2.0.0 | The npm package was renamed from opencode-ai to @opencode/cli. opencode-ai is pinned at 1.18.35 and does not receive 2.x updates. | npm i -g opencode-ai → npm i -g @opencode/cli (with --allow-scripts=@opencode/cli on npm 12). |
| 2.0.0 | opencode providers was replaced by opencode auth. Running opencode providers now attempts to treat providers as a project directory path. | opencode providers list|login|logout → opencode auth list|login|logout. |
| 2.0.0 | opencode db and opencode attach are absent from the 2.0.26 CLI. | Manage the background server with opencode service and generate pairing links with opencode pair. |
| 2.0.0 | opencode run lost --interactive, --command, --attach, --share and --dir. Passing unknown flags now exits with an explicit error. | Pass prompts directly as opencode run "...". For the minimal interactive interface, use opencode mini. |
| 1.17.12 | opencode run --dangerously-skip-permissions was renamed --auto (also added to the top-level TUI command). | opencode run --dangerously-skip-permissions "..." → opencode run --auto "...". |
What OpenCode errors did we reproduce, and how do I fix them?
npm 12 installs `@opencode/cli` but the binary refuses to start (OpenCode 2.0.26)
npm i -g npm@12.2.0
npm i -g @opencode/cli@2.0.26
opencode --versionError: @opencode/cli's postinstall script was not run.
This occurs when installation scripts are disabled.
Run the package postinstall script or reinstall with scripts enabled.Fix: npm i -g --allow-scripts=@opencode/cli @opencode/cli@latest (verified: opencode --version prints opencode v2.0.26), or npm config set allow-scripts=@opencode/cli --location=user once. (source)
Unknown flags fail with an explicit error and exit 1 (OpenCode 2.0.26)
opencode run --definitely-not-a-flag "hi" </dev/nullERROR
Unrecognized flag: --definitely-not-a-flag in command opencode runFix: Check your flags against opencode <cmd> --help or the surface diff above. Removed flags like --interactive or --dir are rejected by OpenCode 2.0. (source)
`opencode providers` fails with ENOENT: providers treated as directory (OpenCode 2.0.26)
opencode providersError: ENOENT: no such file or directory, chdir '/root' -> 'providers'
at chdir (unknown)
at <anonymous> (/$bunfs/root/chunk-pq6tevb3.js:96:6417)Fix: opencode providers was replaced by opencode auth in 2.0. Use opencode auth list, opencode auth login, or opencode auth logout. (source)
`opencode db migrate` fails with Unexpected positional argument (OpenCode 2.0.26)
opencode db migrateERROR
Unexpected positional argument: "migrate"Fix: opencode db was removed in 2.0; db is treated as a directory argument and migrate as an unexpected second positional. (source)
`opencode -p "..."` fails with Unrecognized flag: -p (OpenCode 2.0.26)
opencode -p "say hi" </dev/nullERROR
Unrecognized flag: -p in command opencode
Did you mean this?
-c
-sFix: -p is the archived Go opencode-ai/opencode's prompt flag. In this OpenCode, run a prompt non-interactively with opencode run "say hi". (source)
`opencode run --interactive` fails with Unrecognized flag: --interactive (OpenCode 2.0.26)
opencode run --interactive "hi" </dev/nullERROR
Unrecognized flag: --interactive in command opencode runFix: --interactive was removed from run in 2.0. For the minimal interactive interface, run opencode mini. (source)
OpenCode release history by month
2026-10: 1.18.35 to 2.0.26 (6 releases to 2026-10-10)
- 2.0.26: Random hex OpenTunnel route; Google Cloud Vertex credentials; batch diff optimizations. (source)
- 2.0.25:
opencode pair --remotethrough OpenTunnel; Word/Excel/PowerPoint file previews. (source) - 2.0.24: Native Vercel AI Gateway support;
/btwside-panel tabs; unblock sessions awaiting input. (source)
2026-09: 1.18.26 to 2.0.21 (30 releases)
2026-08: 1.18.11 to 1.18.25 (15 releases)
2026-07: 1.17.13 to 1.18.10 (19 releases)
- 1.18.0 (2026-07-14): Desktop v2 migration completed; CLI help unchanged from 1.17.20. (source)
2026-06: 1.16.0 to 1.17.12 (16 releases)
2026-05: 1.14.31 to 1.15.13 (35 releases)
Sources
- @opencode/cli on the npm registry (dist-tags, publish times) (read 2026-10-10)
- opencode-ai on the npm registry (dist-tags, publish times) (read 2026-10-10)
- anomalyco/opencode releases (GitHub API) (read 2026-10-10)
- anomalyco/opencode tags (GitHub API) (read 2026-10-10)
- OpenCode 2.0.26 release notes (read 2026-10-10)
- OpenCode 2.0.25 release notes (read 2026-10-10)
- PR #53962: random route for remote access (read 2026-10-10)
- PR #53964: write reviewed V2 release notes to CHANGELOG.md (read 2026-10-10)
- PR #53969: lead V2 release notes with highlights (read 2026-10-10)
- PR #53837: pair remotely through OpenTunnel (read 2026-10-10)
- PR #53305: preview Word, Excel and PowerPoint files (read 2026-10-10)
- PR #53626: add AWS profile setup for Bedrock (read 2026-10-10)
- PR #53794: connect Azure through Azure CLI (read 2026-10-10)
- PR #52643: add native Vercel AI Gateway language models (read 2026-10-10)
- PR #53435: surface sessions awaiting input (read 2026-10-10)
- PR #53270: keep each /btw answer in its own tab (read 2026-10-10)
- anomalyco/opencode repository (stars, licence) (read 2026-10-10)
- opencode-ai/opencode (archived Go project, continued as Crush) (read 2026-10-10)
- npm CLI 12.0.0 release notes (lifecycle scripts blocked by default) (read 2026-10-10)
Last verified: 2026-10-10.