Skip to content

feat(plugin): add opencli-plugin.json manifest and monorepo plugin support#475

Merged
jackwener merged 2 commits intojackwener:mainfrom
ByteYue:feat/plugin-manifest-monorepo
Mar 26, 2026
Merged

feat(plugin): add opencli-plugin.json manifest and monorepo plugin support#475
jackwener merged 2 commits intojackwener:mainfrom
ByteYue:feat/plugin-manifest-monorepo

Conversation

@ByteYue
Copy link
Copy Markdown
Collaborator

@ByteYue ByteYue commented Mar 26, 2026

Summary

Adds opencli-plugin.json manifest support and monorepo plugin capability, enabling a single repository to host multiple plugins.

New Features

  • opencli-plugin.json manifest — declare plugin name, version, description, and opencli compatibility range
  • Monorepo support — a single repo can declare multiple sub-plugins via the plugins field
  • Symlink-based architecture — monorepo cloned once to ~/.opencli/monorepos/, sub-plugins appear as symlinks in ~/.opencli/plugins/
  • Version compatibility — built-in semver range checking (>=, ^, ~, compound ranges)
  • github:user/repo/subplugin syntax — install specific sub-plugins from a monorepo
  • Smart cleanup — uninstalling the last sub-plugin auto-removes the monorepo clone

Changes

File Change
src/plugin-manifest.ts [NEW] Manifest types, read/validate, semver compatibility
src/plugin-manifest.test.ts [NEW] 25 unit tests
src/plugin.ts Monorepo install/update/uninstall, enhanced parseSource, listPlugins
src/plugin.test.ts 11 new monorepo tests (symlink, ref counting, metadata)
src/cli.ts Install/list handlers updated for monorepo output
docs/guide/plugins.md Monorepo plugin docs (EN)
docs/zh/guide/plugins.md Monorepo plugin docs (ZH)

Backward Compatibility

  • Plugins without opencli-plugin.json continue to work exactly as before
  • LockEntry adds an optional monorepo field (forward-compatible)
  • discovery.ts is unchanged — symlinks are transparent to flat scan

Test Results

Test Files  26 passed (26)
Tests       332 passed (332)

@ByteYue ByteYue requested a review from jackwener March 26, 2026 14:38
ByteYue and others added 2 commits March 26, 2026 23:42
…pport

- New : types, read/validate, semver compatibility
- Monorepo install: clone → symlink sub-plugins → postInstall per sub-plugin
- Monorepo uninstall: symlink cleanup with ref counting
- Monorepo update: git pull on repo root, refresh all sub-plugins
-  supports  syntax
-  reads manifest metadata, groups monorepo plugins
-  install/list handlers updated for monorepo output
- 60 unit tests (25 manifest + 35 plugin including 11 new monorepo tests)
- Docs updated (EN + ZH) with monorepo section
@jackwener jackwener force-pushed the feat/plugin-manifest-monorepo branch from 47e42b5 to d8c858f Compare March 26, 2026 15:52
@jackwener jackwener merged commit 31d3988 into jackwener:main Mar 26, 2026
23 checks passed
@jackwener jackwener mentioned this pull request Mar 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants