Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>OpenCode AINew to Visual Studio Code? Get it now.
OpenCode AI

OpenCode AI

doomsec

|
666 installs
| (1) | Free
OpenCode sessions, remote tunnels, commit drafts, and inline suggestions in VS Code.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

OpenCode AI

An unofficial OpenCode integration for VS Code and VSCodium. Downloads and manages its own OpenCode V2 runtime, with no separate OpenCode installation required. No Copilot dependency or Microsoft AI account is needed.

Features

  • Dedicated Projects and Sessions tabs in the OpenCode sidebar, with search, pagination, live execution status, and animated running indicators. Session and approval events update the visible sidebar automatically; a 10-second poll remains as a fallback.
  • Expand any project in the Projects tab to inspect and resume all active sessions across multiple windows or worktrees for that project.
  • Star a project to pin it into the collapsible Favorites section at the top. Favorites persist across restarts.
  • Click a session to resume it in the right-hand Secondary Side Bar OpenCode terminal panel, keeping the center editor and bottom terminal panel untouched. Choose Reuse or New once; change the saved preference later in settings.
  • Choosing a project opens its folder and starts an OpenCode terminal for it: immediately when the folder is already open, otherwise as the reloaded window loads.
  • The OpenCode sidebar opens automatically by default whenever a window starts.
  • Generate an editable type(scope): description commit message from staged changes, or unstaged tracked changes when nothing is staged.
  • Navigate through a file's Git commit history using the back (←) and forward (→) buttons in the editor title bar, opening a read-only diff view with commit author and timestamp in the top header.
  • Opt in to automatic inline suggestions. Preview ghost text and accept it with the editor's standard Tab binding.
  • Choose independent commit-message and inline-completion models, or inherit the OpenCode server's default.
  • A separate, opt-in Remote sidebar with OpenCode and Ports tabs, QR codes, copyable URLs, and saved reconnects through OpenTunnel.
  • Projects show eight entries by default, with active-session projects first. Show all expands the list; search always includes every project.

Setup

  1. Install OpenCode AI by doomsec, or install a VSIX from releases/.
  2. Open a trusted local project folder. The first launch reads the stable V2 version from OpenCode's update feed and downloads the platform archive and SHA256SUMS from the matching anomalyco/opencode GitHub release. It checks the archive checksum and executable version before installation. No npm registry access is needed for runtime installs or updates.
  3. Select the OpenCode activity-bar icon. Connect your model provider in the OpenCode TUI if you have not already done so.
  4. For inline completion, click OpenCode inline: off in the status bar, or run OpenCode: Toggle inline suggestions.

Managed mode uses a separate loopback service registration and executable. It shares your normal OpenCode configuration, provider accounts, and session data, not a separate private workspace. System mode can reuse your existing service. Neither mode restarts your manually started service. Closing an editor terminal does not delete its backend session.

VSCodium users can install the same VSIX manually. Public releases use Microsoft's Marketplace, not Open VSX.

Terminal shortcuts

On macOS, Cmd+Enter inserts a newline, Cmd+Backspace deletes to the start of the line, and Cmd+Left/Right moves to the start/end of the line. Cmd+A reaches OpenCode's input selection when Kitty mode is active; in legacy applications it selects terminal output. Cmd+C copies terminal selections; Cmd+V pastes. Ctrl+V remains available to OpenCode for clipboard and image attachments.

Cmd+P and Cmd+Shift+P still open VS Code's Quick Open and Command Palette while the terminal is focused. Ctrl+P remains OpenCode's command palette.

The terminal follows the application's Kitty keyboard mode for modified keys, including Shift+Enter and Ctrl+Enter. Keyboard state survives switching between Side and Center panels. Native Ctrl+V paste on Windows/Linux uses the physical key so it also works with non-Latin layouts.

Commit messages

Select the OpenCode action in Source Control or run OpenCode: Generate commit message with OpenCode. Staged changes take priority. With nothing staged, the draft describes unstaged tracked files. Untracked files must be staged first.

The result goes into the existing Git commit box. Nothing is staged or committed automatically. Existing drafts require replacement confirmation, and edits made while generation is running are preserved. Staging changes during a request discards the stale result.

Diffs up to 32 MiB are read locally. The model receives a bounded excerpt and file summary; lockfiles, generated output, minified files, and binary contents are omitted. Very large summaries are shortened and report the omitted file count. This is not a byte-to-token guarantee for every model. Known credential filenames are rejected, and Git external diff/text-conversion programs are not run.

If a saved commit model has disappeared from the server's catalog, generation uses the OpenCode default and warns you. The saved preference is not overwritten. Generation is cancellable, including connection setup, with a 120-second default deadline.

Inline completion

Inline requests are disabled by default. Enabling them sends bounded code around the cursor to your configured OpenCode model and may incur model usage costs. Known credential files and Git internals are excluded.

Requests are debounced and canceled when superseded. Responses for changed documents or cursor positions are discarded. Nothing is inserted until you accept a suggestion. IntelliSense selections are extended using their native replacement ranges.

Use OpenCode: Select inline-completion model to choose a fast model. Commit drafts use OpenCode: Select commit-message model. These preferences stay in VS Code settings and do not change global OpenCode configuration.

OpenCode's current one-shot API uses the server's base configuration. Per-request token limits are not exposed by that API. The extension bounds context and response size and applies request timeouts, but model billing and generation limits remain controlled by OpenCode and its provider.

Remote access and public ports

Run OpenCode: Enable Remote sidebar, or check Remote sidebar in OpenCode settings. Remote is off by default. Enabling the sidebar does not publish anything.

  • OpenCode: choose Open remotely, then confirm. Scan the QR code or copy the private link. Anyone with that link can access the entire OpenCode service, including files and commands, not just the current project. Treat it like a password.
  • Ports: enter a local HTTP port and choose Share. This creates a public HTTPS URL with WebSocket support. The local application must provide its own authentication. Only 127.0.0.1 targets are supported; raw TCP databases and local HTTPS listeners are not supported by this UI.
  • Tunnels disconnect when the editor closes. Reconnect on reopen saves the address and reconnects when the same workspace reopens. Nothing stays running in the background while the editor is closed.
  • Disconnect closes and removes that tunnel, including its saved reconnect preference. Disable Remote sidebar closes all tunnels; saved ones can resume when Remote is enabled again. If address cleanup fails while offline, the tunnel is still closed and cleanup can be retried.

OpenTunnel terminates TLS on the machine running the extension, not at its relay. The OpenCode tunnel additionally uses a private fragment key and a secure browser cookie. The service credential never enters the sidebar. Tunnel identities and private access keys are stored in the editor's SecretStorage; QR codes are generated locally. Port URLs are public and have no added authentication.

Remote requires an editor extension host running Node 22 or newer. No separate OpenTunnel CLI is required. VS Code Remote/SSH workspaces are not supported by this feature.

First-time certificate provisioning can take a few minutes. If a connection fails, retry or check Output → OpenCode Remote for redacted diagnostics. Disconnect cancels setup and cleans up the reserved address.

Settings

Setting Default Purpose
opencode.runtime.mode managed Managed downloads and runs the extension's own OpenCode runtime. System uses opencode.executable when no service is running.
opencode.runtime.autoUpdate true Check once a day for a newer runtime and download it. Updates activate on the next editor start.
opencode.executable opencode System-mode executable name or absolute path, without shell arguments.
opencode.commit.timeoutSeconds 120 Maximum commit-generation time, including connection setup.
opencode.terminal.reuse ask Initial one-time Reuse/New setup; saves the selected behavior.
opencode.commit.model null Inherit OpenCode's default, or use { "providerID": "…", "id": "…", "variant": "…" }.
opencode.inline.model null Independent optional inline model reference.
opencode.inline.enabled false Opt in to automatic suggestions.
opencode.remote.enabled false Show Remote. Sharing still requires confirmation; only saved tunnels reconnect.

The managed runtime is stored under the extension's global storage, not in the workspace. It runs an isolated OpenCode service on a random local port, so it does not replace or depend on the user's own opencode service. Use OpenCode: Check for runtime updates from the command palette or the Runtime section of the OpenCode settings to update it manually.

Each editor window pins its runtime version. Downloads become available to newly opened or reloaded windows without replacing binaries or restarting services used by existing windows. Clean up old runtimes asks for confirmation before removing older versions and stopping their idle services. It keeps the newest two versions, versions pinned by open windows, and services with active sessions or terminals. Abandoned downloads older than a day are removed automatically. Only stable V2 runtimes are accepted; upgrading to another major requires an extension update. The TypeScript client is bundled with the extension and updates with the extension release.

Privacy and limitations

The extension has no analytics. Generation uses OpenCode's stateless text endpoint without tools or session-history entries. OpenCode's service credential remains in the extension host. Remote's QR code and copied private link carry a separate access key, revoked by disconnecting the tunnel.

This version targets local filesystem workspaces and a local OpenCode V2 service. It is not a browser extension or a client for external remote OpenCode servers. Project switching uses the editor's normal unsaved-file safeguards. Canonical /private projects are hidden from the project list without deleting them; their sessions remain available.

Development

Requires Node 22.18+ and VS Code 1.100+. A separate OpenCode installation is optional when the runtime is managed.

npm ci
npm run typecheck
npm test
npm run build

Press F5 in this folder to run an Extension Development Host. npm run verify:ai runs disposable Git, OpenCode, and VSCodium fixtures with a local model stub, not paid models. It checks live sidebar stage changes and sends edited multiline prompts through the real TUI in both panel modes. It does not change the shared service or reset the macOS Keychain.

npm run verify:runtime downloads and verifies the official platform runtime, starts a private service with isolated configuration and data, and resumes a synthetic session through the managed TUI with no system OpenCode on PATH. Both integration checks clean up only their own services.

node scripts/verify-keymap.mjs fetches the official V2 mapping and presses every bound alternative in an isolated editor, recording the terminal bytes and checking the two native VS Code pickers. Reports under test-results/keymap-current distinguish transport checks from actions. Set OPENCODE_FULL_KEYMAP_AUDIT=1 when running npm run verify:ai to also exercise editing actions in the real TUI. Unbound commands and context-specific actions are not treated as passing merely because their keys reach the PTY.

node scripts/verify-remote-relay.ts and node scripts/verify-remote-ui.mjs create temporary public OpenTunnel registrations for non-sensitive local test pages, then remove them. Run only with approval to use the public relay. The UI check uses an isolated VSCodium profile and captures Copy link without overwriting the system clipboard. runtime/ isolates OpenTunnel's Effect dependency from the older OpenCode client peer and manages the SDK's connection scopes and pending-registration cleanup; esbuild bundles both into the extension.

Attribution

The logo and pixel-loader artwork are adapted from OpenCode under its MIT license. OpenCode AI is maintained independently and is not affiliated with or endorsed by the OpenCode team. Third-party notices are included in the extension package.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft