Skip to content

Support opencode v2 #50937

Closed
Closed

Description

@andreclaudino

Description

The extension currently runst opencode --port <port>, but the new v2 opencode client does not support it.

Plugins

No response

OpenCode version

No response

Steps to reproduce

  1. Install opencode v2
    curl -fsSL https://opencode.ai/v2/install | bash
  2. Click the extension button.

Screenshot and/or share link

Image

Operating System

Ubuntu 24.04

Terminal

Vscode Integrated terminal

Activity

  1. devharshthakur commented on Sep 26, 2026

    @devharshthakur

    at lest gives us a vscode extension setting to tweak the command ourselves for such cases

  2. devharshthakur commented on Sep 26, 2026

    @devharshthakur

    Workaround for the v2 incompatibility, until the extension ships a fix (or a configurable command, as suggested above).

    The extension launches the TUI with vscode.window.createTerminal(...) + sendText("opencode --port <port>"), i.e. it types the command into an interactive shell, so a shell function in ~/.zshrc can rewrite it. It has to be a function, not an alias: alias expansion only replaces the first word, so alias opencode='opencode serve' would also mangle every opencode run … / opencode api … call.

    # ~/.zshrc — workaround for sst-dev.opencode (v0.0.13) on opencode v2
    opencode() {
      if [[ "$1" == "--port" ]]; then
        shift 2   # v2 removed --port; attach to the shared background service
      fi
      command opencode "$@"
    }

    Verified on opencode v2.0.18 (macOS, zsh, extension v0.0.13):

    A setting to override the launched command (previous comment) plus a shared-service/--standalone choice would be the proper fix.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions