opencode/packages/web/src/content/docs/ide.mdx

49 lines
1.9 KiB
Plaintext
Raw Normal View History

2025-07-23 04:27:52 +08:00
---
2025-07-23 04:50:56 +08:00
title: IDE
2025-10-04 01:46:56 +08:00
description: The OpenCode extension for VS Code, Cursor, and other IDEs
2025-07-23 04:27:52 +08:00
---
2025-10-04 01:46:56 +08:00
OpenCode integrates with VS Code, Cursor, or any IDE that supports a terminal. Just run `opencode` in the terminal to get started.
2025-07-23 04:27:52 +08:00
---
2025-07-23 07:02:28 +08:00
## Usage
2025-07-23 04:27:52 +08:00
2025-10-04 01:46:56 +08:00
- **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**: Automatically share your current selection or tab with OpenCode.
2025-07-23 07:02:28 +08:00
- **File Reference Shortcuts**: Use `Cmd+Option+K` (Mac) or `Alt+Ctrl+K` (Linux/Windows) to insert file references. For example, `@File#L37-42`.
2025-07-23 04:27:52 +08:00
---
## Installation
2025-10-04 01:46:56 +08:00
To install OpenCode on VS Code and popular forks like Cursor, Windsurf, VSCodium:
2025-07-23 04:27:52 +08:00
1. Open VS Code
2. Open the integrated terminal
2025-07-23 04:46:40 +08:00
3. Run `opencode` - the extension installs automatically
2025-07-23 04:27:52 +08:00
2025-09-23 04:16:53 +08:00
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](/docs/tui/#editor-setup).
2025-09-23 04:01:27 +08:00
2025-07-23 04:27:52 +08:00
---
### Manual Install
2025-10-04 01:46:56 +08:00
Search for **OpenCode** in the Extension Marketplace and click **Install**.
2025-07-23 04:27:52 +08:00
---
### Troubleshooting
2025-07-23 05:13:53 +08:00
If the extension fails to install automatically:
2025-07-23 04:27:52 +08:00
2025-07-23 04:46:40 +08:00
- Ensure youre running `opencode` in the integrated terminal.
- Confirm the CLI for your IDE is installed:
- For VS Code: `code` command
- For Cursor: `cursor` command
- For Windsurf: `windsurf` command
- For VSCodium: `codium` command
- If not, run `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)
- Ensure VS Code has permission to install extensions