msyzzm/dsh-ccswitch-sync ↗★ 0

dsh-ccswitch-sync

Mirror CC Switch's DSH providers and MCP servers into the dsh-tui profile, and show how fresh the mirror is.

包名
dsh-ccswitch-sync
兼容性
待验证
版本
0.1.2
许可证
MIT
最近更新
2026年11月15日

同名包的其他仓库

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:msyzzm/dsh-ccswitch-sync

dsh-ccswitch-sync

中文 · npm · dsh-TUI · Plugin directory

Footer field: ccs 3p 3mcp 33m

/ccswitch output: providers, MCP servers, patch age

A dsh-TUI plugin that mirrors the DSH configuration CC Switch keeps in its own profile into the dsh-tui profile, and shows how fresh the mirror is in the footer.

CC Switch writes llm-pi-ai.providers and cc-switch-mcp-* rows into ~/.dsh/profiles/web/cordis.patch.yml (falling back to desktop). dsh-TUI runs its own profile, ~/.dsh/profiles/dsh-tui, so those providers and MCP servers never show up there. This plugin ports the CC Switch mirror into the plugin itself: the same text splice, executed from inside the TUI, with a footer field so you can see whether the mirror is current.

ccs 3p 4mcp 1m        ← 3 providers, 4 MCP servers, patch written 1 minute ago

Install

# from npm
dsh plugin --profile dsh-tui add dsh-ccswitch-sync

# or from a local checkout
dsh plugin --profile dsh-tui add link:/path/to/dsh-ccswitch-sync

Inside the terminal, /plugin install works too. Restart dsh-TUI after installing — a bundle is only composed when the process starts.

dsh plugin --profile dsh-tui remove dsh-ccswitch-sync

Use

/ccswitchProvider count, MCP count, patch age
/ccswitch syncMirror now (this rewrites the profile patch, see below)
footer field ccswitchSame counters, refreshed every 60s; left-tail/right-head/right-tail via the slot option

The footer field is a plugin field, so /settings → statusBar.pluginFields can hide it and statusBar.pluginFieldsOrder can place it per slot group. Turn the field off and the command still works.

When it syncs

It never syncs on its own. Installing, activating, reloading and switching sessions all leave the profile untouched:

  • /ccswitch sync — mirror once, now.
  • DSH_CCSWITCH_SYNC_ON_START=1 — opt in to mirroring once at activation.
  • No file watcher, no timer that writes. The only timer refreshes the footer text.

That default is deliberate. dsh-TUI profiles use patchReload: live, so writing cordis.patch.yml reloads the whole composition — and the row that runs this plugin lives in that same file. A mirror that fires on activation would reload the profile that just activated it. Doing it on demand keeps that reload a deliberate act.

How the mirror works

The managed rows go into one marked block at the end of the target patch:

# >>> cc-switch sync (managed) >>>
- id: llm-pi-ai
  config:
    providers: { ... }
- insert:
    - id: cc-switch-mcp-context7
      ...
# >> / # =24`, ESM only, zero runtime dependencies.
- Windows, macOS and Linux. All paths come from `DSH_HOME`/`~`, never from a hardcoded drive.

## Development

```sh
npm test                           # splicing (idempotency, markers, BOM) + file-level sync
node scripts/check-manifest.mjs    # dependency-free manifest shape check

The authoritative manifest validator is the Community v0.15 parser (@dsh-std/manifest); dsh-plugin.json here parses and projects cleanly under 0.1.1-rc.2.

Links

  • dsh-TUI: ·

  • Plugin admission and development guide:

  • Ecosystem organisation:

License

MIT.