Tool pages / OpenCode

OpenCode CLI 2.0.26: latest version, renamed packages and gotchas

Latest: OpenCode 2.0.26, released (release notes).

Last verified 2026-10-10 against 2.0.26. Page updated . Also as Markdown and JSON.

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 version

npm (npm 12 blocks the postinstall unless you allow it):

npm i -g --allow-scripts=@opencode/cli @opencode/cli@latest
opencode --version   # opencode v2.0.26

npm 11 and older:

npm i -g @opencode/cli@latest

Install script (macOS, Linux):

curl -fsSL https://opencode.ai/install | bash

Homebrew (the project's tap; the core formula updates less often):

brew install anomalyco/tap/opencode

Pin a version:

npm i -g --allow-scripts=@opencode/cli @opencode/cli@2.0.26

OpenCode key facts

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 --remote to 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)

  • Native Vercel AI Gateway support with prompt caching, routing, and BYOK. (source)
  • Sessions awaiting input or child subagent approvals surfaced at the top of the TUI open menu. (source)
  • Each /btw question opens in its own side-panel tab and remains open across reloads until closed. (source)

OpenCode 2.0.23 (2026-10-05 05:26 UTC)

  • ACP protocol reports compaction with standard session updates. (source)
  • Support disable-model-invocation in skill frontmatter. (source)
  • Support Homebrew Core installations in opencode upgrade. (source)

OpenCode 2.0.22 (2026-10-02 04:21 UTC)

  • Expose session compaction and session removal in plugin APIs. (source)
  • Support parent session creation for plugins. (source)
  • Self-describing MCP error classification across providers. (source)

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 api
  • opencode auth
  • opencode auth export
  • opencode auth import
  • opencode auth list
  • opencode auth login
  • opencode auth logout
  • opencode auth switch
  • opencode debug agents
  • opencode mini
  • opencode pair
  • opencode plugin add
  • opencode plugin check
  • opencode plugin list
  • opencode plugin remove
  • opencode plugin update
  • opencode reload
  • opencode service
  • opencode service get
  • opencode service restart
  • opencode service set
  • opencode service start
  • opencode service status
  • opencode service stop
  • opencode service unset
  • opencode session export
  • opencode session import

Commands removed:

  • opencode agent
  • opencode agent create
  • opencode agent list
  • opencode attach
  • opencode completion
  • opencode db
  • opencode db path
  • opencode debug agent
  • opencode debug file
  • opencode debug file list
  • opencode debug file read
  • opencode debug file search
  • opencode debug info
  • opencode debug lsp
  • opencode debug lsp diagnostics
  • opencode debug lsp document-symbols
  • opencode debug lsp symbols
  • opencode debug rg
  • opencode debug rg files
  • opencode debug rg search
  • opencode debug scrap
  • opencode debug skill
  • opencode debug snapshot
  • opencode debug snapshot diff
  • opencode debug snapshot patch
  • opencode debug snapshot track
  • opencode debug startup
  • opencode debug v2
  • opencode debug wait
  • opencode export
  • opencode github
  • opencode github install
  • opencode github run
  • opencode import
  • opencode mcp auth list
  • opencode mcp debug
  • opencode pr
  • opencode providers
  • opencode providers list
  • opencode providers login
  • opencode providers logout
  • opencode web
CommandFlags addedFlags 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 providers became opencode auth, opencode db was removed, the old opencode attach command is absent, and export/import moved under opencode session and opencode auth.
  • Top-level and run commands gained --standalone and --server for connecting to running services, while --pure was 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 --help output 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.

CommandFlags addedFlags removed
opencode--autonone
opencode completion--autonone
opencode run--auto--interactive--dangerously-skip-permissions
  • --auto replaces --dangerously-skip-permissions in opencode run help and arrives on the top-level TUI command; run -i, --interactive comes back. The old name and --yolo are still accepted as hidden aliases (PR #34641).

What breaks when upgrading OpenCode, and how do I migrate?

VersionChangeMigration
2.0.0The 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.0opencode 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.0opencode 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.0opencode 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.12opencode 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 --version
Error: @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/null
ERROR
  Unrecognized flag: --definitely-not-a-flag in command opencode run

Fix: 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 providers
Error: 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 migrate
ERROR
  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/null
ERROR
  Unrecognized flag: -p in command opencode

  Did you mean this?
    -c
    -s

Fix: -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/null
ERROR
  Unrecognized flag: --interactive in command opencode run

Fix: --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 --remote through OpenTunnel; Word/Excel/PowerPoint file previews. (source)
  • 2.0.24: Native Vercel AI Gateway support; /btw side-panel tabs; unblock sessions awaiting input. (source)

2026-09: 1.18.26 to 2.0.21 (30 releases)

  • 2.0.0 (2026-09-11): OpenCode V2 overhaul; npm package @opencode/cli; SUBCOMMANDS tree. (source)
  • 1.18.34: macOS CLI binaries signed with a Developer ID and re-signed after local compile for macOS 27+. (source)

2026-08: 1.18.11 to 1.18.25 (15 releases)

  • 1.18.19: native OpenAI and Anthropic passthroughs for Cloudflare AI Gateway models. (source)
  • 1.18.20: opencode run answers permission requests from subagents. (source)

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)

  • 1.16.0 removed opencode db migrate; 1.17.0 added fff file search and non-interactive mcp add --url/--header/--env. (source)
  • 1.17.10 added --mini and dropped run --interactive/--replay/--demo; 1.17.12 renamed --dangerously-skip-permissions to --auto. (source)

2026-05: 1.14.31 to 1.15.13 (35 releases)

  • 1.14.51: experimental background subagents. (source)
  • 1.15.6: TUI diff viewer and shell mode in run; opencode login defaults to console.opencode.ai. (source)

Sources

Last verified: 2026-10-10.