Conversation
umputun
left a comment
There was a problem hiding this comment.
thx for the OpenCode integration, nice to see revdiff working with other tools.
the main issue is that revdiff.ts reimplements all the terminal detection logic (tmux, kitty, wezterm, cmux, ghostty, iTerm2, emacs vterm) that already lives in launch-revdiff.sh. every time we fix smth in the bash launcher (like the tmux -T compat fix we just merged), the TS version would be out of sync.
I'd suggest making the tool a thin wrapper around the existing launcher script instead. smth like:
const launcher = await $`which launch-revdiff.sh || echo ""`.text();
// or ship the script alongside the tool and call it directly
const result = await $`${launcher} ${ref}`.text();the launcher already handles all terminals, sentinel polling, cleanup, and annotation capture. the TS tool just needs to call it and return stdout.
also a few bugs in the current TS if you keep it as-is:
- Ghostty block doesn't set working directory, revdiff would open in the wrong dir
- iTerm2 uses
current sessioninstead of targeting by$ITERM_SESSION_IDUUID, may hit the wrong pane - emacs vterm uses
terminstead ofvterm-mode, won't work
There was a problem hiding this comment.
Pull request overview
Adds an OpenCode integration alongside existing AI-tool integrations, allowing users to launch the revdiff TUI from OpenCode and return any annotations back into chat.
Changes:
- Document OpenCode setup in the main README.
- Add OpenCode tool + slash-command configuration files under
plugins/opencode/. - Update
CLAUDE.mdto describe the newplugins/integration directory.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Documents how to install/copy the OpenCode configs. |
| plugins/opencode/tools/revdiff.ts | Implements the OpenCode tool that launches revdiff via terminal overlays and returns annotations. |
| plugins/opencode/README.md | Provides detailed installation instructions for the OpenCode integration. |
| plugins/opencode/commands/revdiff.md | Adds a /revdiff command recipe that invokes the tool and applies annotations. |
| CLAUDE.md | Documents plugins/ as the location for third-party AI integrations. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Updated OpenCode integration instructions and removed setup script details.
umputun
left a comment
There was a problem hiding this comment.
much better now with the tool wrapping launch-revdiff.sh instead of reimplementing terminal detection, thx.
couple things I noticed:
-
revdiff-plan-review.ts:111-if (!annotations!) return;has a redundant non-null assertion after the negation. same on line 115 withannotations!. should be justif (!annotations) return;andannotationswithout! -
README.md:127-See 'plugins/opencode/README.md'should be a proper markdown link -
tools/revdiff.tsusesBun.$directly whilerevdiff-plan-review.tsimports{ $ } from "bun". minor inconsistency but worth picking one style
…joris/revdiff into feat/opencode-config-docs
umputun
left a comment
There was a problem hiding this comment.
lgtm, thx for addressing the previous feedback. the tool wrapping launch-revdiff.sh is the right approach.
couple minor things to clean up when you get a chance:
-
setup.sh-realpath --relative-toisn't available on macOS default coreutils. the|| echofallback works but produces stderr noise on every copy. smth like${src#$REPO_ROOT/}would be cleaner -
setup.sh- whenopencode.jsondoesn't exist, it just warns. could create a minimal{"plugin": ["./plugins/revdiff-plan-review.ts"]}so setup is fully automated -
revdiff-plan-review.ts- several silentcatch {}blocks (isInstalled,launchReview,getLastPlanContent,injectAnnotations). at least aconsole.errorwould help debugging when smth breaks
revdiff OpenCode integration
Prerequisites
PATHFiles
Installation
The script creates the target directories if needed, copies all files, marks the shell scripts as executable, and registers the plan-review plugin in
~/.config/opencode/opencode.json. Or manually:Then register the plan-review plugin in
~/.config/opencode/opencode.json:{ "plugin": ["./plugins/revdiff-plan-review.ts"] }Restart OpenCode after installing — tools and commands are loaded at startup.