dsh-cc/dsh-cc--packages-compat-cc-plugin-manager ↗★ 1
@dsh-cc/plugin-manager
管理 Claude Code 插件状态文件,与官方 CLI 保持字节级一致。 适合需在会话内管理 CC 插件市场与安装状态的用户。
安裝
此插件尚未提供可驗證的 bundle,或相容性檢查未通過。請先閱讀倉庫說明。 閱讀完整 README ↗
說明文件
閱讀完整 README ↗@dsh-cc/plugin-manager
English | 中文
Manage Claude Code plugin state in-session: marketplaces, installs, per-scope enablement — reading and writing the same on-disk files (and byte shapes) as the real claude plugin CLI, so the two stay interoperable.
State root: dual-home (compat-read ~/.claude, write ~/.dsh)
Plugin state is dual-home:
- Write root —
$DSH_HOME/~/.dsh. Every mutation (install / uninstall / enable / disable / update / marketplace add / remove / update) writes only under the dsh home (plugins/{known_marketplaces.json, installed_plugins.json, marketplaces/, cache/}and~/.dsh/settings.jsonfor user-scopeenabledPlugins/extraKnownMarketplaces). Per-repo project/local scope files (/.claude/...) stay exactly where Claude Code keeps them. - Read root —
$CLAUDE_CONFIG_DIR/~/.claude, fully visible. Existing Claude-home state simply keeps working; nothing migrates and nothing is ever deleted from the Claude home. - Per-key dsh-wins merge. When both homes carry the same key (marketplace name or plugin id), the dsh entry wins; claude-only keys pass through. A dsh
known_marketplaces.jsonvalue ofnullis a private tombstone that hides a claude-only marketplace. A dshinstalled_plugins.jsonentry list — including an empty list — shadows the claude list for that id.
Consequences:
- One-way fork. dsh-cc sees both homes; real Claude Code sees only its own. A plugin claimed by dsh is invisible to the
claudeCLI until installed there. - Takeover staleness. Once dsh-cc writes an id into the dsh
installed_plugins.json, later claude-side changes to that id become invisible to dsh-cc — dsh manages what it has touched. CLAUDE_CONFIG_DIRno longer relocates writes. With$CLAUDE_CONFIG_DIRset, writes follow$DSH_HOME(previously they followedCLAUDE_CONFIG_DIR); users who used it as a relocation knob should setDSH_HOMEinstead.- Legacy single-root. A caller passing only
claudeHome(nodshHome) keeps the pre-dual-home behavior byte-identically: that directory is both the read and the write root.
The resolution chain is: explicit dshHome → explicit claudeHome (legacy single-root) → resolveDshHome() ($DSH_HOME → ~/.dsh). Resolution happens before deps are built, so a no-options production caller always resolves dual-home.
Surface
createCcPluginManager({ claudeHome?, dshHome?, cwd?, runGit? }) returns a manager with list, install, uninstall, enable, disable, update, listMarketplaces, addMarketplace, removeMarketplace, updateMarketplaces. Mutations resolve against the merged view; every operation re-reads both homes, so a real-CC change appears on the very next operation (except for taken-over ids, above). Claude-owned material (marketplace clones, cache dirs) is never deleted, moved, or orphan-marked; marketplace updates of claude-owned git entries are served by promote-on-write (a fresh clone into the dsh home, the claude entry untouched).
Known limits and deferred work
- No interactive menu UI, trust dialogs,
details/eval/init/prune/tag/validatesubcommands,managedscope, or orphan sweeping (CC-shape parity scope:docs/plans/2026-09-06-plugin-management.md). extraKnownMarketplacesuser-scope declarations write to~/.dsh/settings.json; removing one that exists only in the claude file is a no-op for dsh-cc's own view (nothing reads it) and leaves the claude file untouched.- No bulk migration command (
/plugin migrate); revisit on user demand.