Skip to content

installer: /install silently downgrades existing v2 CLI to v1 #54084

Closed

Description

@isramontoro

Description

The legacy https://opencode.ai/install script silently replaces an existing OpenCode v2 CLI with v1 in the same ~/.opencode/bin/opencode path. On Linux x64, it printed Installed version: opencode v2.0.26. followed by Installing opencode version: 1.18.35. After installation, opencode --version returned 1.18.35.

The v2 installation guide correctly uses https://opencode.ai/v2/install, but a user following the older install command can unintentionally downgrade a working v2 installation. The legacy script resolves GitHub's v1 releases/latest and overwrites the binary without a major-version check. Please prevent the silent replacement, or require explicit confirmation and point v2 users to /v2/install.

Plugins

A local v2 plugin was installed; plugin choice does not affect the installer.

OpenCode version

2.0.26 before running the legacy installer; 1.18.35 afterward.

Steps to reproduce

  1. Install OpenCode v2.0.26 with curl -fsSL https://opencode.ai/v2/install | bash.
  2. Confirm opencode --version reports opencode v2.0.26.
  3. Run curl -fsSL https://opencode.ai/install | bash.
  4. Observe the installer announce v1.18.35 and opencode --version report 1.18.35 after it finishes.

Operating System

Linux x86_64 (WSL2).

Terminal

zsh.

Activity

  1. opencode-agent commented on Oct 9, 2026

    @opencode-agent
    Contributor

    Thanks for the clear report, I could reproduce this on Linux x64 in a clean home directory:

    1. curl -fsSL https://opencode.ai/v2/install | bash → opencode --version reports opencode v2.0.26
    2. curl -fsSL https://opencode.ai/install | bash → prints Installed version: opencode v2.0.26. then Installing opencode version: 1.18.35, with no prompt or warning
    3. opencode --version now reports 1.18.35 at the same ~/.opencode/bin/opencode path

    The legacy script only checks whether the installed version is exactly the one it's about to install. It takes that version from the latest GitHub release, which is currently v1, so it overwrites a newer v2 install. The script below reproduces it in a throwaway $HOME.

    The latest v2 branch (ee0e614) also has a related problem: README.md and the docs pages (index.mdx, windows-wsl.mdx) still show https://opencode.ai/install instead of /v2/install, so following them leads to the same downgrade. Related: #52609 (point the v2 readme to the v2 installs).

    Until this is addressed, re-running curl -fsSL https://opencode.ai/v2/install | bash restores v2.

    Reproduction script (repro.sh)
    #!/usr/bin/env bash
    # Reproduces anomalyco/opencode#54084: the legacy https://opencode.ai/install
    # script replaces an existing v2 CLI with v1 without any warning.
    # Runs in a throwaway HOME so the real installation is untouched.
    set -euo pipefail
    export HOME=$(mktemp -d)
    export SHELL=/bin/bash
    export PATH="$HOME/.opencode/bin:/usr/bin:/bin"
    cd "$HOME"
    
    echo "== 1. install v2 via /v2/install"
    curl -fsSL https://opencode.ai/v2/install | bash -s -- --no-modify-path
    echo "which: $(command -v opencode)"
    echo "version: $(opencode --version)"
    
    echo
    echo "== 2. run legacy /install"
    curl -fsSL https://opencode.ai/install | bash -s -- --no-modify-path
    
    echo
    echo "== 3. after legacy installer"
    echo "which: $(command -v opencode)"
    echo "version: $(opencode --version)"

    Run it: bash repro.sh

  2. intrepid37 commented on Oct 18, 2026

    @intrepid37

    Confirming this also affects Ubuntu 24.04 LTS on ARM64 (aarch64), observed on October 18, 2026.

    I had OpenCode v2.0.32 installed and working with T3 Code (which requires OpenCode >=2.0.18). Running the legacy installer:

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

    produced:

    Installed version: opencode v2.0.32.
    
    Installing opencode version: 1.19.3
    ■■■・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・   6%^C
    

    I interrupted it at approximately 6%, before it could replace v2. Subsequent opencode --version checks still reported v2.0.32.

    Expected: Detect that the installed binary belongs to a newer major release and refuse the downgrade (or request explicit confirmation and link to https://opencode.ai/v2/install).

    Actual: The legacy installer identifies the installed v2 version but starts installing v1.19.3 without a major-version warning.

    This provides an ARM64 reproduction of the cross-major installer issue already documented above on Linux x64. It is particularly disruptive for integrations that now require v2, such as T3 Code. Thanks for looking into it!

  3. rekram1-node commented on Oct 18, 2026

    @rekram1-node
    Contributor

    The READMEs now point at the V2 installer and V2 package-manager installs (#56839).

    https://opencode.ai/install is the legacy OpenCode 1 installer, so running it installs V1 and replaces an existing V2 binary. That's expected. The V1 docs at opencode.ai/docs document V1, so their install instructions use that V1 installer. If you want to stay on V2, follow the V2 docs instead, or use the V2 installer:

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

    Once installed, opencode upgrade keeps you on V2. Other V2 install methods are listed in the V2 docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions