Skip to content

feat(core): support git plugin packages - #45110

Merged
kitlangton merged 2 commits into
v2from
git-plugins
Aug 26, 2026
Merged

kitlangton merged 2 commits into
v2from
git-plugins

Conversation

@kitlangton

@kitlangton kitlangton commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

Why

OpenCode can load npm plugins, but opencode2 plugin add rejects 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

opencode2 plugin add github:acme/plugin
opencode2 plugin add git+ssh://[email protected]/acme/plugin.git#main
opencode2 plugin add "github:acme/monorepo#main::path:packages/plugin"

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]
Loading

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

# packages/core
bun run test
bun typecheck

# packages/cli
bun run test test/plugin-add.test.ts test/plugin-list.test.ts test/plugin-remove.test.ts
bun typecheck

# packages/util
bun typecheck

# packages/www
bun run check:generated
bun run build

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

  1. feat(core): support git plugin packages #45110 Git plugin installation (this PR)
  2. feat(core): refresh unpinned plugins on startup #45118 Explicit plugin updates
  3. feat(tui): add plugin update controls #45119 Plugin management UI and Drive demos

@kitlangton
kitlangton merged commit 4b71ae6 into v2 Aug 26, 2026
12 checks passed
@kitlangton
kitlangton deleted the git-plugins branch August 26, 2026 02:02
jinhuang712 pushed a commit to jinhuang712/opencode that referenced this pull request Sep 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant