A Visual Studio Code extension that integrates opencode V2 directly into your development workflow.
Prerequisites
This extension requires the opencode CLI (V2) to be installed on your system. Visit opencode.ai for installation instructions.
Features
Quick Launch: Use Cmd+Esc (Mac) or Ctrl+Esc (Windows/Linux) to open opencode in a split terminal view, or focus an existing terminal session if one is already running.
New Session: Use Cmd+Shift+Esc (Mac) or Ctrl+Shift+Esc (Windows/Linux) to start a new opencode terminal session, even if one is already open. You can also click the opencode button in the editor title bar.
Context Awareness: Automatically share your current selection or tab with opencode.
File Reference Shortcuts: Use Cmd+Option+K (Mac) or Ctrl+Alt+K (Linux/Windows) to insert file references. For example, @File#L37-42.
How it works (V2)
Opencode V2 uses a client-server architecture: the TUI connects to one shared background service instead of starting a server per terminal. This extension opens the TUI in a VS Code terminal and types @file references into it — no local ports or passwords to manage. If you point the extension at an explicit password-protected server, set the credentials via the opencode.terminalEnv setting.
Extension Settings
opencode.command: opencode binary to run (default: opencode).
opencode.serverUrl: explicit server URL, e.g. http://127.0.0.1:4096. Empty means use the shared background service (recommended).
opencode.extraArgs: extra args appended to the TUI command.
opencode.terminalEnv: extra env for the terminal, e.g. {"OPENCODE_SERVER_PASSWORD": "..."}.
opencode.attachDelayMs: delay before typing file context into a new terminal (default: 600).
Support
This is an early release. If you encounter issues or have feedback, please create an issue.
Development
Open the vscode-extension directory in VS Code (do not open from the repo root).
npm install — install dependencies.
Press F5 to start debugging — this launches a new VS Code window with the extension loaded.
npm run compile — type-check and bundle to dist/; node scripts/make-icons.mjs regenerates the marketplace icon.