ide.mdx 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. ---
  2. title: IDE
  3. description: The OpenCode extension for VS Code, Cursor, and other IDEs
  4. ---
  5. OpenCode integrates with VS Code, Cursor, or any IDE that supports a terminal. Just run `opencode` in the terminal to get started.
  6. ---
  7. ## Usage
  8. - **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.
  9. - **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.
  10. - **Context Awareness**: Automatically share your current selection or tab with OpenCode.
  11. - **File Reference Shortcuts**: Use `Cmd+Option+K` (Mac) or `Alt+Ctrl+K` (Linux/Windows) to insert file references. For example, `@File#L37-42`.
  12. ---
  13. ## Installation
  14. To install OpenCode on VS Code and popular forks like Cursor, Windsurf, VSCodium:
  15. 1. Open VS Code
  16. 2. Open the integrated terminal
  17. 3. Run `opencode` - the extension installs automatically
  18. 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).
  19. ---
  20. ### Manual Install
  21. Search for **OpenCode** in the Extension Marketplace and click **Install**.
  22. ---
  23. ### Troubleshooting
  24. If the extension fails to install automatically:
  25. - Ensure you’re running `opencode` in the integrated terminal.
  26. - Confirm the CLI for your IDE is installed:
  27. - For VS Code: `code` command
  28. - For Cursor: `cursor` command
  29. - For Windsurf: `windsurf` command
  30. - For VSCodium: `codium` command
  31. - 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)
  32. - Ensure VS Code has permission to install extensions