Repository navigation
feat(core): support git plugin packages - #45110
Merged
Merged
Conversation
This was referenced Aug 26, 2026
jinhuang712
pushed a commit
to jinhuang712/opencode
that referenced
this pull request
Sep 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
OpenCode can load npm plugins, but
opencode2 plugin addrejects Git repositories and unnamed Git packages cannot be reliably recovered from the package cache. Teams therefore cannot install private or in-repository plugins directly, even though Arborist already supports these package sources.What Changes
Git sources may use hosted shortcuts, HTTPS or SSH URLs, branches, full commit hashes, and npm repository-subdirectory selectors. Arborist installs the selected package and its declared dependencies; existing Git credentials handle private repositories.
Package Resolution
flowchart LR A[Git or npm package spec] --> B[Validate npm-compatible source] B --> C[Arborist installs package and dependencies] C --> D[Resolve actual package entrypoint] D --> E[Register plugin in OpenCode]Unnamed Git repositories are resolved by their actual package manifests, and Git cache entries use stable hashed paths instead of embedding repository URLs.
Scope
Installation and package resolution only. Explicit updates and plugin-management controls follow in stacked PRs.
Verification
The complete core suite passes: 2,289 tests passed, 16 skipped, zero failures. Five CLI plugin tests also pass. Coverage includes real local Git repositories, unnamed and named packages, dependency installation, and monorepo subdirectories. The normal pre-push hook additionally typechecked the complete workspace.
Stack