OpenCode — VSCode Integration
Setup
1. Install OpenCode CLI
bash
npm install -g opencode-ai2. Authenticate
bash
opencode auth login https://ai.camer.digital/opencodeBrowser opens for authentication. Login, return to terminal, select model.
3. Install the VS Code Extension
Automatic:
- Open the VS Code integrated terminal (Ctrl+`)
- Run:
opencode - The extension installs automatically
Manual:
- Open Extensions (Ctrl+Shift+X)
- Search:
OpenCode - Click Install
Configuration
Add to your shell profile (~/.bashrc or ~/.zshrc) so VS Code is used as the editor for OpenCode diffs:
bash
export EDITOR="code --wait"Usage
Keyboard Shortcuts
| Action | Windows / Linux | macOS |
|---|---|---|
| Open OpenCode | Ctrl+Esc | Cmd+Esc |
| New session | Ctrl+Shift+Esc | Cmd+Shift+Esc |
| File reference | Alt+Ctrl+K | Cmd+Option+K |
Examples
Initialize project context:
/initAsk about a file:
Explain authentication in @src/auth/login.tsPlan / Build mode:
- Press Tab to switch to Plan
- Describe the feature
- Press Tab to switch to Build
- Type
Go ahead
Troubleshooting
Extension not installing automatically:
- Run
opencodeinside the integrated terminal - If prompted, install the
codecommand in PATH via the VS Code command palette
opencode command not found:
bash
export PATH="$HOME/.local/bin:$PATH"