opencode in the terminal to get started.
Features
- Quick Launch: Use keyboard shortcuts to open OpenCode instantly in a split terminal view
- New Session: Start multiple OpenCode sessions with dedicated shortcuts
- Context Awareness: Automatically share your current selection or tab with OpenCode
- File Reference Shortcuts: Quickly insert file references into OpenCode prompts
Usage
Keyboard Shortcuts
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 UI.Context Awareness
OpenCode automatically shares your current selection or active tab with the AI, providing relevant context for your requests without manual copying and pasting.Installation
To install OpenCode on VS Code and popular forks like Cursor, Windsurf, VSCodium:
If on the other hand you want to use your own IDE when you run
/editor or /export from the TUI, you’ll need to set export EDITOR="code --wait". Learn more.
Manual Install
Search for OpenCode in the Extension Marketplace and click Install.Supported IDEs
OpenCode supports the following IDEs:- VS Code - The standard Visual Studio Code editor
- Cursor - AI-first code editor built on VS Code
- Windsurf - Collaborative code editor
- VSCodium - Open-source builds of VS Code without Microsoft branding/telemetry
Troubleshooting
If the extension fails to install automatically:Verify CLI installation
Confirm the CLI for your IDE is installed:
- For VS Code:
codecommand - For Cursor:
cursorcommand - For Windsurf:
windsurfcommand - For VSCodium:
codiumcommand
Cmd+Shift+P (Mac) or Ctrl+Shift+P (Windows/Linux) and search for “Shell Command: Install ‘code’ command in PATH” (or the equivalent for your IDE).Editor Setup for TUI
If you want to use a specific editor when running/editor or /export from the OpenCode TUI, set the EDITOR environment variable:
--wait flag tells the editor to wait until the file is closed before returning control to OpenCode.
FAQ
Can I use OpenCode without the extension?
Can I use OpenCode without the extension?
Yes, you can run
opencode in any terminal. The extension provides additional features like keyboard shortcuts and context awareness, but it’s not required.Does OpenCode work with other IDEs besides VS Code?
Does OpenCode work with other IDEs besides VS Code?
OpenCode works in any terminal, so you can use it with any IDE that has terminal support. The VS Code extension provides enhanced integration for VS Code and compatible editors.
Can I customize the keyboard shortcuts?
Can I customize the keyboard shortcuts?
Yes, you can customize keyboard shortcuts in your IDE’s keyboard shortcuts settings. Search for “OpenCode” in the keyboard shortcuts editor.
How do I update the OpenCode extension?
How do I update the OpenCode extension?
The extension updates automatically through your IDE’s extension marketplace. You can also manually check for updates in the Extensions view.
Can I use OpenCode in remote development environments?
Can I use OpenCode in remote development environments?
Yes, OpenCode works in remote development environments like GitHub Codespaces, GitPod, and VS Code Remote containers.