You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
VS Code extension (sst-dev.opencode 0.0.13) fails on OpenCode v2: Unrecognized flag --port #51512
After upgrading the OpenCode CLI from v1 to v2 (opencode v2.0.18), opening OpenCode from the VS Code extension (sst-dev.opencode v0.0.13, latest on the Marketplace as of 2025-12-28) fails immediately with:
ERROR
Unrecognized flag: --port in command opencode
Root cause
The v2 CLI dropped the --port / --hostname flags that existed in v1 (server binding is now handled through the background service/serve subcommand architecture instead of top-level flags). The VS Code extension's bundled dist/extension.js still constructs its CLI invocation using the v1-style --port <n> flag, which v2's argument parser rejects outright.
Steps to reproduce
Install/upgrade to OpenCode CLI v2 (curl -fsSL https://opencode.ai/v2/install | bash)
Have sst-dev.opencode v0.0.13 installed in VS Code
Open a project in VS Code and launch OpenCode via the extension
Observe the Unrecognized flag: --port error at startup
Expected
The extension should either:
Detect the CLI major version and adapt its launch invocation accordingly, or
Drop --port and use v2's service/serve connection model (e.g. --server <url> / background service) when talking to a v2 CLI.
Environment
OS: macOS (darwin 27.0.0)
OpenCode CLI: v2.0.18 (installed via curl installer)
Extension: sst-dev.opencode 0.0.13 (VS Code Marketplace, last updated 2025-12-28)
Confirmed duplicate — same root cause as #49085 (sdks/vscode/src/extension.ts still passing --port, which v2's CLI no longer accepts) and #50530. Closing in favor of #49085 which has assignee + more detail. Thanks for triaging.
Activity
github-actions commentedon Sep 26, 2026
This issue might be a duplicate of existing issues. Please check:
--portflag when launched from an editor extension.Unrecognized flag: --porterror after upgrading to CLI v2.xxl4tomxu98 commentedon Sep 28, 2026
Confirmed duplicate — same root cause as #49085 (sdks/vscode/src/extension.ts still passing --port, which v2's CLI no longer accepts) and #50530. Closing in favor of #49085 which has assignee + more detail. Thanks for triaging.
xxl4tomxu98 commentedon Oct 12, 2026
I still don't think the issue had been resolved. If you think there is already a solution please paste a link here or explain. @jlongster