OpenCode Review
A VS Code extension that integrates OpenCode AI directly into your editor for seamless code review. Like GitHub Copilot, but powered by OpenCode.
What's New in v2.0
- Direct SDK Integration - No more terminal commands! Connect directly to OpenCode server
- Chat Interface - Ask OpenCode to make changes through a chat UI
- Auto-Diff Detection - Changes are detected automatically after prompting
- Session Management - Create and manage OpenCode sessions
- Real-time Status - See connection and processing status live
Features
- Chat with OpenCode - Describe changes you want, OpenCode makes them
- Inline Code Review - Green/red gutter decorations showing changed lines
- Accept/Reject Changes - Per-file, per-hunk, or bulk operations
- Side-by-side Diff - View full diff comparison
- CodeLens Integration - Accept/Reject buttons directly in the editor
- State Persistence - Sidebar remembers your session
Installation
From VS Code Marketplace
- Open VS Code
- Go to Extensions panel (Ctrl+Shift+X)
- Search "OpenCode Review"
- Click Install
From .vsix file
code --install-extension opencode-review-2.0.0.vsix
Prerequisites
- OpenCode installed
- OpenCode server running (the extension can start it for you)
Quick Start
- Click the OpenCode icon in the sidebar
- Click "Connect" or "Start Server"
- Type your prompt in the chat input
- Press Ctrl+Enter or click Send
- Review changes in the Review tab
- Accept or Reject changes
How It Works
┌─────────────────────────────────────────────────────────────┐
│ Sidebar - Chat Tab │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ [Connect] [Start Server] │ │
│ ├─────────────────────────────────────────────────────┤ │
│ │ │ │
│ │ You: Add error handling to the login function │ │
│ │ │ │
│ │ OpenCode: I've added try-catch blocks... │ │
│ │ │ │
│ ├─────────────────────────────────────────────────────┤ │
│ │ [Describe changes...] [Send] │ │
│ └─────────────────────────────────────────────────────┘ │
│ ● Connected │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ Sidebar - Review Tab │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ ● 2 pending ● 1 accepted ● 0 rejected │ │
│ │ [Accept All] [Reject All] [Clear] │ │
│ ├─────────────────────────────────────────────────────┤ │
│ │ ▶ src/index.ts +12 -3 [Accept] [Reject] │ │
│ │ ▶ src/utils.ts +5 -2 [Accept] [Reject] │ │
│ └─────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ Editor - Inline Review │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ 1 function login() { │ │
│ │ 2 try { │ │
│ │ 3 ● const user = await authenticate(); │ │
│ │ 4 ● return { success: true, user }; │ │
│ │ 5 } catch (error) { │ │
│ │ 6 ● return { success: false, error }; │ │
│ │ 7 } │ │
│ │ 8 } │ │
│ │ [✓ Accept] [✗ Reject] │ │
│ └─────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────┘
Commands
| Command |
Description |
OpenCode: New Prompt |
Open the sidebar panel |
OpenCode: Accept Change |
Accept change in active file |
OpenCode: Reject Change |
Reject change in active file |
OpenCode: Accept All Changes |
Accept all pending changes |
OpenCode: Reject All Changes |
Reject all pending changes |
OpenCode: View Diff |
Open side-by-side diff view |
Configuration
| Setting |
Default |
Description |
opencodeReview.opencodePath |
opencode |
Path to the opencode CLI binary |
Architecture
┌─────────────────────────────────────────────────────────────┐
│ VS Code Extension │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ Sidebar Provider (Webview) │ │
│ │ - Chat UI │ │
│ │ - Review UI │ │
│ └─────────────────────────────────────────────────────┘ │
│ │ │
│ ▼ │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ OpenCode Service (SDK) │ │
│ │ - createOpencodeClient() │ │
│ │ - session.create() │ │
│ │ - session.prompt() │ │
│ │ - session.diff() │ │
│ └─────────────────────────────────────────────────────┘ │
│ │ │
│ ▼ │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ Review Manager │ │
│ │ - Inline decorations (green/red) │ │
│ │ - CodeLens (Accept/Reject buttons) │ │
│ │ - WorkspaceEdit (apply changes) │ │
│ └─────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ OpenCode Server │
│ - AI-powered code generation │
│ - Session management │
│ - Diff generation │
└─────────────────────────────────────────────────────────────┘
| Feature |
OpenCode Review |
GitHub Copilot |
Git |
| AI-powered changes |
✅ |
✅ |
❌ |
| Inline review |
✅ |
✅ |
✅ |
| Accept/Reject per hunk |
✅ |
✅ |
❌ |
| Chat interface |
✅ |
✅ |
❌ |
| Session management |
✅ |
❌ |
❌ |
| OpenCode integration |
✅ |
❌ |
❌ |
License
MIT
| |