dsh-git-branch-switcher
会话标题栏 Git 分支胶囊:显示当前工作区分支,并可在 Web 界面直接切换。
mixin-ai
@mixin-ai
⬇ 1
★ 0
main
安装
dsh plugin --profile web add github:mixin-ai/dsh-git-branch-switcher
需要可复现安装时,可在仓库后追加 #commit 固定提交。
会话标题栏 Git 分支胶囊:显示当前工作区分支,并可在 Web 界面直接切换。
该插件未提供要点说明,请参考仓库 README。
deepseek-harnessdsh-plugingit
- 安装并启动 DeepSeek Harness:
npx @deepseek-ai/dsh web - 在终端执行上面的安装命令(CLI 会解析插件并核验来源)
- 用 dsh plugins list 确认已安装,必要时重启 Harness 生效
插件以当前 dsh 进程的权限运行,安装时可能执行代码。请先通读仓库源码与许可证,确认无破坏性命令与越权访问;本站只做索引,不对第三方插件安全性作担保。
| 代码仓库 | github.com/mixin-ai/dsh-git-branch-switcher |
| 许可证 | MIT |
| 主要语言 | main |
| 下载量 | 1 |
| GitHub 星标 | 0 |
| 最近推送 | 2026-08-14 |
| 收录日期 | 2026-09-19 |
| 分类 | 开发与运行时 |
事实信息来自公开插件目录快照(2026-10-03),介绍文案由本站再加工。
以下为插件仓库 README 全文(原始内容,由公开目录抓取整理)。
# dsh-git-branch-switcher [English](#english) | [简体中文](#简体中文) ## English A DeepSeek Harness (DSH) Web plugin: a Git branch pill in the session header that shows the current branch of the session's workspace and lets you switch branches straight from the UI.  ### Features - Shows the current git branch in the top-right session header (only for git-managed workspaces) - Click the pill to open the branch panel: local branches, current one highlighted with ✓ - Click any branch to `git checkout` it; the pill updates immediately - Detached HEAD support: shows the short commit hash with an explanation - Auto-refresh every 30s (picks up terminal-side switches) plus a manual refresh button - Checkout failures (e.g. conflicting local changes) surface git's own error message - Theme-aware: all colors use the shell's `--dsw-*` tokens, light/dark ready - Sandbox-aware: git runs under the same sandbox policy as the session's shell ### Install ```sh dsh plugin --profile web add "github:mixin-ai/dsh-git-branch-switcher#main" ``` Then restart your Web profile: ```sh dsh --profile web ``` The plugin is now listed under Settings → Plugins and the branch pill appears in the session header. Alternative (source checkout): ```sh git clone https://github.com/mixin-ai/dsh-git-branch-switcher dsh web --patch ./dsh-git-branch-switcher/cordis.patch.yml ``` ### Usage 1. Open a session whose workspace is a git repository. 2. The branch pill appears at the top-right of the conversation header. 3. Click it → branch list → click a branch to switch. 4. The ↻ button re-reads the branch list. ### Architecture | Half | File | What it does | | --- | --- | --- | | Host | `lib/index.js` | `gitBranch` Typert Remote service (`status` / `branches` / `checkout`) running git through the `shell` service with the session's sandbox policy. Plain-JS Remote markers, no generated artifacts (SRC mode). | | Client | `lib/client.js` | Prebuilt `__ModuleLoader__` bundle mounting the Remote contribution and rendering the header pill (session-scoped `conversation.session.header.utilities` slot). | | Patch | `cordis.patch.yml` | Inserts the dual-face plugin row into the Web profile. | - The workspace directory comes from the session's `cwd` (`useSessions` standard slot prop), so it always tracks the open session. - Branch names are single-quote escaped for the shell and control characters are rejected — no command injection. - All side effects (Remote mount, slot registration, timers, CSS) belong to the plugin fiber and are removed on unload. ### Dynamic plugin variant `dynamic/` contains the same feature as an in-session dynamic Cordis Plugin (the form the DSH Web UI's plugin authoring flow runs). See `dynamic/README.md`. ### License MIT --- ## 简体中文 一个 DeepSeek Harness (DSH) Web 插件:在会话头部显示当前项目所在 git 分支的胶囊按钮,点击即可在界面里直接切换分支。 ### 功能 - 在会话头部右上角显示当前 git 分支(仅当项目由 git 管理时出现) - 点击胶囊弹出分支面板:本地分支列表,当前分支以 ✓ 高亮 - 点击任意分支即执行 `git checkout` 切换,胶囊立即更新 - 支持 detached HEAD:显示短提交哈希并给出说明 - 每 30 秒自动刷新(终端里切了分支也能同步)+ 面板内手动刷新按钮 - 切换失败(例如本地有冲突改动)时显示 git 原始报错 - 颜色全部使用主题 `--dsw-*` token,自动适配亮/暗主题 - 尊重沙箱策略:git 命令与会话 shell 使用同一套沙箱策略执行 ### 安装 ```sh dsh plugin --profile web add "github:mixin-ai/dsh-git-branch-switcher#main" ``` 然后重启 Web profile: ```sh dsh --profile web ``` 插件会出现在「设置 → 插件」中,分支胶囊显示在会话头部。 源码方式(patch 覆盖层): ```sh git clone https://github.com/mixin-ai/dsh-git-branch-switcher dsh web --patch ./dsh-git-branch-switcher/cordis.patch.yml ``` ### 使用 1. 打开一个工作区为 git 仓库的会话。 2. 会话头部右上角出现分支胶囊。 3. 点击胶囊 → 分支列表 → 点击分支即可切换。 4. ↻ 按钮重新读取分支列表。 ### 架构 | 半边 | 文件 | 职责 | | --- | --- | --- | | Host | `lib/index.js` | `gitBranch` Typert Remote 服务(`status` / `branches` / `checkout`),通过 `shell` 服务执行 git,沿用会话沙箱策略。纯 JS Remote 标记,无生成产物(SRC 模式)。 | | Client | `lib/client.js` | 预构建 `__ModuleLoader__` bundle:挂载 Remote 贡献并渲染头部胶囊(会话级 `conversation.session.header.utilities` 插槽)。 | | Patch | `cordis.patch.yml` | 将双面插件行插入 Web profile。 | - 项目目录取自会话的 `cwd`(`useSessions` 标准插槽属性),始终跟随当前打开的会话。 - 分支名经单引号 shell 转义并拒绝控制字符,不存在命令注入。 - 所有副作用(Remote 挂载、插槽注册、定时器、CSS)都归属插件 fiber,卸载时自动清理。 ### 动态插件版本 `dynamic/` 目录提供同功能的内存态动态 Cordis 插件源码(DSH Web UI 插件创作流程所用的形态),见 `dynamic/README.md`。 ### 许可证 MIT
数据来源:公开的 DeepSeek Harness 插件目录与各插件 GitHub 仓库。本站为独立第三方目录,与 DeepSeek、幻方(High-Flyer)及插件作者均无隶属或背书关系。