Repository navigation
Description
Summary
opencode plugin add with any Git package spec fails with
NpmInstallFailedError caused by Error: git dep preparation failed,
although the V2 docs list Git specs (github:, HTTPS, SSH) as supported.
This blocks GitHub-only plugin distribution (no npm account needed).
Environment
- opencode version: v2.0.28 (also reproduced on v2.0.27)
- OS: Darwin 27.2.0 arm64
- Terminal: iTerm.app, xterm-256color, truecolor
- Shell: /bin/zsh
- Install/channel: release, via anomalyco/tap/opencode-v2 (homebrew)
- Active plugins: none relevant (failure happens during install, before load)
Reproduction
opencode plugin add 'github:Okxdd123/opencode-terminal-status#v1.0.0'
(also triedgithub:Okxdd123/opencode-terminal-statusand
git+https://github.com/Okxdd123/opencode-terminal-status.git#v1.0.0)- Observe the failure below:
NpmInstallFailedError:
at catch (/$bunfs/root/chunk-apxtfw24.js:3:6393)
at Npm.reify (/$bunfs/root/chunk-apxtfw24.js:3:6432)
at Npm.add (/$bunfs/root/chunk-zy1hnpwh.js:2:1447)
at Npm.add (definition) (/$bunfs/root/chunk-apxtfw24.js:3:8131)
at cli.plugin.add (/$bunfs/root/chunk-s4zsbqev.js:7:21270)
at cli.plugin.add (definition) (/$bunfs/root/chunk-zy1hnpwh.js:2:1259) {
[cause]: Error: git dep preparation failed
at yt (/$bunfs/root/chunk-1x9pd0k1.js:8:4481)
at processTicksAndRejections (native:7:39)
}
Control experiments on the same machine:
git ls-remote https://github.com/Okxdd123/opencode-terminal-status.git
lists refs fine (repo +v1.0.0tag exist and are public).bun add 'github:Okxdd123/opencode-terminal-status#v1.0.0'in an empty
dir succeeds (package downloads and installs).- No proxy env vars; both github.com:443 and :22 reachable
(ssh answers, only key auth missing as expected).
The test repo is a minimal plugin package (package.json with . and
./tui exports, committed dist/): no install scripts, no dependencies.
Expected Behavior
Per https://opencode.ai/v2/docs/plugins/ ("Package installation accepts
npm names … plus npm-compatible Git package specifications … opencode plugin add github:acme/opencode-plugin"), the Git spec installs the
package.
Actual Behavior
All Git spec forms fail identically with git dep preparation failed,
with no further detail even under OPENCODE_LOG_LEVEL=DEBUG.
Additional Context
- Consistent failure, reproduced on 2.0.27 and 2.0.28.
- Workaround: manual
git cloneinto the plugins directory works, so
this is specifically theplugin addGit path.
Activity
opencode-agent commentedon Oct 13, 2026
Thanks for the detailed report and the control experiments, they made this easy to trace.
I think this is a duplicate of #49704. Your repo's
package.jsonhas a"build"script. During a Git install, npm's git fetcher sees abuild,prepareor install-type script (orworkspaces) and runs an extra "preparation" install. Inside the compiledopencodebinary that step fails with exactlygit dep preparation failed. Packages without those scripts install fine from the same host, andbun adddoesn't take that path, which is why it worked for you.Possible duplicates and related issues, ordered by likelihood:
build/preparescript in a Git plugin package, and someone confirmed it on 2.0.24 withgithub:vercel/vercel-plugin.git dep preparation failederror with a Git plugin spec inopencode.jsonc(PR fix(core): resolve npm for Git plugin preparation #49795 is an open fix for that one).github:plugin source returns 404.Until it's fixed, there's a workaround: since you already commit
dist/, rename the script in your published tag (for example"build"→"build:dist") so the preparation step isn't triggered. The vercel-plugin maintainers did the same thing.The bot will close this issue as a duplicate in 1 day unless you reply explaining how your problem is different.
Okxdd123 commentedon Oct 13, 2026
Workaround confirmed — renaming the
buildscript tobuild:distfixed the Git install on 2.0.28. Thanks for the quick diagnosis! Closing as a duplicate of #49704.opencode-agent commentedon Oct 13, 2026
Thanks for confirming! Glad renaming the script to
build:distgot the Git install working on 2.0.28. That confirms this is the same problem as #49704, so please follow that issue for the actual fix. The bot will close this one as a duplicate.opencode-agent commentedon Oct 14, 2026
Closing this as a duplicate of #49704, as you agreed. The
git dep preparation failederror comes from thebuildscript in a Git plugin package, and renaming it tobuild:distworks around it. Please follow #49704 for the actual fix. Thanks again for the clear report and for confirming the workaround!