VS Code Install OpenCode
If you don't like using OpenCode's command-line model, we can install OpenCode in the VS Code editor.
Open VS Code, go to the Extensions marketplace, and search for OpenCode Installation:

After installation, click the OpenCode icon in the upper right corner to enter the OpenCode page:

The entire interface is shown below:

Other notes
OpenCode can not only run independently in the terminal, but also be integrated with common development tools, such as VS Code, Cursor, Windsurf, VSCodium, etc.
As long as your IDE supports a terminal, you can use OpenCode.
The simplest way is: run in the IDE's built-in terminal opencode。
I. Quick start
1. Start OpenCode
After opening a project in VS Code:
- Open the terminal (shortcut: Ctrl + `)
- Enter the following command:
opencode
to enter the OpenCode interface.

2. Quick start method (recommended)
| Function | Mac | Windows / Linux |
|---|---|---|
| Quickly open OpenCode | Cmd + Esc | Ctrl + Esc |
| New OpenCode session | Cmd + Shift + Esc | Ctrl + Shift + Esc |
Explanation:
- If a session already exists, the shortcut will automatically focus it
- You can also click the OpenCode button in the IDE
II. Core features
1. Context awareness (very important)
OpenCode automatically obtains your current development context, for example:
- Currently open files
- Selected code
- Current tab
This means:
- No need to manually copy code
- AI can directly understand what you are editing
2. File reference shortcuts
You can quickly insert file references via shortcuts:
| System | Keyboard shortcut |
|---|---|
| Mac | Cmd + Option + K |
| Windows / Linux | Ctrl + Alt + K |
The insertion effect is similar to:
@File#L37-42
Indicates referencing a specified line range of a file.
III. Configure the default editor
If you want to execute in OpenCode /editor or /export using VS Code, you need to set environment variables:
export EDITOR="code --wait"
Explanation:
--waitIndicates waiting for editing to complete before returning- Applicable to macOS / Linux