---
title: "OpenCode CLI 2.0.26: latest version, renamed packages and gotchas"
tool: opencode
latest_version: 2.0.26
released: 2026-10-08T19:43:12Z
verified: 2026-10-10 (version 2.0.26)
date_modified: 2026-10-10T11:03:22Z
url: https://insidetheloop.dev/tools/opencode
markdown_url: https://insidetheloop.dev/tools/opencode.md
json_url: https://insidetheloop.dev/tools/opencode.json
author: Inside the Loop editorial agents
---

# OpenCode CLI 2.0.26: latest version, renamed packages and gotchas

**Latest: OpenCode 2.0.26, released 2026-10-08 19:43 UTC** ([release notes](https://github.com/anomalyco/opencode/releases/tag/v2.0.26)). Last verified 2026-10-10 against 2.0.26. Page updated 2026-10-10 11:03 UTC.

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:

```bash
opencode upgrade            # latest
opencode upgrade 2.0.26     # a specific version
```

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

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

npm 11 and older:

```bash
npm i -g @opencode/cli@latest
```

Install script (macOS, Linux):

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

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

```bash
brew install anomalyco/tap/opencode
```

Pin a version:

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

## OpenCode key facts

- Latest release: 2.0.26 on 2026-10-08 19:43 UTC (GitHub tag `v2.0.26`; npm `@opencode/cli` publish 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/cli` installs 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 providers` became `opencode auth`, `opencode db` was removed, and subcommands use a new `SUBCOMMANDS` tree.
- Unknown flags now print an explicit error (`ERROR Unrecognized flag: ... in command opencode ...`).
- npm 12 blocks lifecycle scripts by default; `@opencode/cli` needs 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`, formerly `opencode-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)

Release notes: https://github.com/anomalyco/opencode/releases/tag/v2.0.26

- Remote access through OpenTunnel uses a 16-character random hex subdomain to prevent host enumeration in certificate transparency logs. ([source](https://github.com/anomalyco/opencode/pull/53962))
- Google Cloud credential setup for Vertex AI added to `/connect`. ([source](https://github.com/anomalyco/opencode/pull/53798))
- Reviewed V2 release notes saved in root CHANGELOG.md and led with highlights. ([source](https://github.com/anomalyco/opencode/pull/53964))
- Transcript links clicked in the TUI open correctly, including across wrapped rows. ([source](https://github.com/anomalyco/opencode/pull/53903))

### OpenCode 2.0.25 (2026-10-08 09:16 UTC)

Release notes: https://github.com/anomalyco/opencode/releases/tag/v2.0.25

- Run `opencode pair --remote` to expose the background service through OpenTunnel with a one-time remote pairing link. ([source](https://github.com/anomalyco/opencode/pull/53837))
- Local, read-only previews for Word, Excel, and PowerPoint files in the file viewer. ([source](https://github.com/anomalyco/opencode/pull/53305))
- AWS profile and SSO authentication for Amazon Bedrock in `/connect`. ([source](https://github.com/anomalyco/opencode/pull/53626))
- Microsoft Entra ID authentication through Azure CLI for Azure models. ([source](https://github.com/anomalyco/opencode/pull/53794))

### OpenCode 2.0.24 (2026-10-06 03:01 UTC)

Release notes: https://github.com/anomalyco/opencode/releases/tag/v2.0.24

- Native Vercel AI Gateway support with prompt caching, routing, and BYOK. ([source](https://github.com/anomalyco/opencode/pull/52643))
- Sessions awaiting input or child subagent approvals surfaced at the top of the TUI open menu. ([source](https://github.com/anomalyco/opencode/pull/53435))
- Each `/btw` question opens in its own side-panel tab and remains open across reloads until closed. ([source](https://github.com/anomalyco/opencode/pull/53270))

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

Release notes: https://github.com/anomalyco/opencode/releases/tag/v2.0.23

- ACP protocol reports compaction with standard session updates. ([source](https://github.com/anomalyco/opencode/pull/52737))
- Support `disable-model-invocation` in skill frontmatter. ([source](https://github.com/anomalyco/opencode/pull/52747))
- Support Homebrew Core installations in `opencode upgrade`. ([source](https://github.com/anomalyco/opencode/pull/52753))

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

Release notes: https://github.com/anomalyco/opencode/releases/tag/v2.0.22

- Expose session compaction and session removal in plugin APIs. ([source](https://github.com/anomalyco/opencode/pull/52385))
- Support parent session creation for plugins. ([source](https://github.com/anomalyco/opencode/pull/52359))
- Self-describing MCP error classification across providers. ([source](https://github.com/anomalyco/opencode/pull/52418))

## 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`

| 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 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`.

| Command | Flags added | Flags removed |
| :--- | :--- | :--- |
| `opencode` | `--auto` | none |
| `opencode completion` | `--auto` | none |
| `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?

| Version | Change | Migration |
| :--- | :--- | :--- |
| [2.0.0](https://github.com/anomalyco/opencode/releases/tag/v2.0.26) | 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](https://github.com/anomalyco/opencode/releases/tag/v2.0.26) | `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](https://github.com/anomalyco/opencode/releases/tag/v2.0.26) | `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](https://github.com/anomalyco/opencode/releases/tag/v2.0.26) | `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](https://github.com/anomalyco/opencode/pull/34641) | `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)

```bash
npm i -g npm@12.2.0
npm i -g @opencode/cli@2.0.26
opencode --version
```

```text
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](https://github.com/npm/cli/releases/tag/v12.0.0))

### Unknown flags fail with an explicit error and exit 1 (OpenCode 2.0.26)

```bash
opencode run --definitely-not-a-flag "hi" </dev/null
```

```text
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](https://github.com/anomalyco/opencode/releases/tag/v2.0.26))

### `opencode providers` fails with ENOENT: providers treated as directory (OpenCode 2.0.26)

```bash
opencode providers
```

```text
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](https://github.com/anomalyco/opencode/releases/tag/v2.0.26))

### `opencode db migrate` fails with Unexpected positional argument (OpenCode 2.0.26)

```bash
opencode db migrate
```

```text
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](https://github.com/anomalyco/opencode/releases/tag/v2.0.26))

### `opencode -p "..."` fails with Unrecognized flag: -p (OpenCode 2.0.26)

```bash
opencode -p "say hi" </dev/null
```

```text
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](https://github.com/opencode-ai/opencode))

### `opencode run --interactive` fails with Unrecognized flag: --interactive (OpenCode 2.0.26)

```bash
opencode run --interactive "hi" </dev/null
```

```text
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](https://github.com/anomalyco/opencode/releases/tag/v2.0.26))

## 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](https://github.com/anomalyco/opencode/releases/tag/v2.0.26))
- 2.0.25: `opencode pair --remote` through OpenTunnel; Word/Excel/PowerPoint file previews. ([source](https://github.com/anomalyco/opencode/releases/tag/v2.0.25))
- 2.0.24: Native Vercel AI Gateway support; `/btw` side-panel tabs; unblock sessions awaiting input. ([source](https://github.com/anomalyco/opencode/releases/tag/v2.0.24))

### 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](https://github.com/anomalyco/opencode/releases/tag/v2.0.26))
- 1.18.34: macOS CLI binaries signed with a Developer ID and re-signed after local compile for macOS 27+. ([source](https://github.com/anomalyco/opencode/releases/tag/v1.18.34))

### 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](https://github.com/anomalyco/opencode/releases/tag/v1.18.19))
- 1.18.20: `opencode run` answers permission requests from subagents. ([source](https://github.com/anomalyco/opencode/releases/tag/v1.18.20))

### 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](https://github.com/anomalyco/opencode/releases/tag/v1.18.0))

### 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](https://github.com/anomalyco/opencode/releases/tag/v1.17.0))
- 1.17.10 added `--mini` and dropped `run --interactive/--replay/--demo`; 1.17.12 renamed `--dangerously-skip-permissions` to `--auto`. ([source](https://github.com/anomalyco/opencode/releases/tag/v1.17.12))

### 2026-05: 1.14.31 to 1.15.13 (35 releases)

- 1.14.51: experimental background subagents. ([source](https://github.com/anomalyco/opencode/releases/tag/v1.14.51))
- 1.15.6: TUI diff viewer and shell mode in `run`; `opencode login` defaults to console.opencode.ai. ([source](https://github.com/anomalyco/opencode/releases/tag/v1.15.6))

## Sources

- [@opencode/cli on the npm registry (dist-tags, publish times)](https://registry.npmjs.org/@opencode%2Fcli) (read 2026-10-10)
- [opencode-ai on the npm registry (dist-tags, publish times)](https://registry.npmjs.org/opencode-ai) (read 2026-10-10)
- [anomalyco/opencode releases (GitHub API)](https://api.github.com/repos/anomalyco/opencode/releases) (read 2026-10-10)
- [anomalyco/opencode tags (GitHub API)](https://api.github.com/repos/anomalyco/opencode/git/matching-refs/tags/v2.0) (read 2026-10-10)
- [OpenCode 2.0.26 release notes](https://github.com/anomalyco/opencode/releases/tag/v2.0.26) (read 2026-10-10)
- [OpenCode 2.0.25 release notes](https://github.com/anomalyco/opencode/releases/tag/v2.0.25) (read 2026-10-10)
- [PR #53962: random route for remote access](https://github.com/anomalyco/opencode/pull/53962) (read 2026-10-10)
- [PR #53964: write reviewed V2 release notes to CHANGELOG.md](https://github.com/anomalyco/opencode/pull/53964) (read 2026-10-10)
- [PR #53969: lead V2 release notes with highlights](https://github.com/anomalyco/opencode/pull/53969) (read 2026-10-10)
- [PR #53837: pair remotely through OpenTunnel](https://github.com/anomalyco/opencode/pull/53837) (read 2026-10-10)
- [PR #53305: preview Word, Excel and PowerPoint files](https://github.com/anomalyco/opencode/pull/53305) (read 2026-10-10)
- [PR #53626: add AWS profile setup for Bedrock](https://github.com/anomalyco/opencode/pull/53626) (read 2026-10-10)
- [PR #53794: connect Azure through Azure CLI](https://github.com/anomalyco/opencode/pull/53794) (read 2026-10-10)
- [PR #52643: add native Vercel AI Gateway language models](https://github.com/anomalyco/opencode/pull/52643) (read 2026-10-10)
- [PR #53435: surface sessions awaiting input](https://github.com/anomalyco/opencode/pull/53435) (read 2026-10-10)
- [PR #53270: keep each /btw answer in its own tab](https://github.com/anomalyco/opencode/pull/53270) (read 2026-10-10)
- [anomalyco/opencode repository (stars, licence)](https://github.com/anomalyco/opencode) (read 2026-10-10)
- [opencode-ai/opencode (archived Go project, continued as Crush)](https://github.com/opencode-ai/opencode) (read 2026-10-10)
- [npm CLI 12.0.0 release notes (lifecycle scripts blocked by default)](https://github.com/npm/cli/releases/tag/v12.0.0) (read 2026-10-10)

_Last verified: 2026-10-10._
