DSH 的 Git 状态徽章:侧边栏工作区行徽章与输入行徽章,显示当前会话工作区的 git 状态,通过 SSE 事件驱动保持实时。
安装
# npm 包(预构建)
dsh plugin --profile web add dsh-git-badge
# GitHub 源码(首次需按提示配置 allowBuilds 构建授权后重试)
dsh plugin --profile web add github:Kevin-McIsaac/dsh-workspace-git-badge#path:/dsh-git-badge
装任何插件都等于在你的机器上跑第三方代码,权限和你本人一样大——能读你的文件、用你的凭据、访问网络,工具审批管不到它。GitHub 来源的插件还会在安装时执行构建脚本——pnpm 默认拦截,所以安装可能停在 ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED 或 ERR_PNPM_IGNORED_BUILDS;dsh 会打印出需要添加的确切键名,把它加进该 profile 的 pnpm-workspace.yaml 的 allowBuilds 下,重跑一次即可装上。放行构建本身就是一次信任判断:请只安装可信来源,并尽量锁定 commit(github:owner/repo#sha)。
README
该插件的 README 只有英文版本。
Git status badges for DeepSeek Harness:
- Input-row chip —
✚ main ↑0 ↓2 ✎3next to the access picker, showing the git state of the workspace the current conversation is attached to. The leading glyph is the action the node half picked; with no action the chip starts at the branch name. Works on every install. - Hover card — rest a pointer on the chip for what won't fit: the file breakdown (
✎3split into staged / unstaged / untracked), the last ten commits, and the stash. Fetched only on hover, so the everyday badge pays nothing for it. Works on every install. - PR / CI token —
✚ main ↑0 ↓2 PR#142 ✓when the branch has a GitHub pull request, read through your ownghCLI (the plugin never handles a credential). The token links to the PR — it opens in a new tab, and underlines when you hover or focus it. Invisible whenghcannot answer: not installed, not logged in, no GitHub remote, offline or rate-limited all render the unchanged chip, and a token with no URL to link to stays plain text. - Worktree-aware — a session can enter a linked
git worktreeor another repository. DSH records the session's working directory (working_directorycommits the change), and the badge describes that checkout — its branch, counts and PR/CI token (chore/global-skills-tiering ↑0 ↓2 PR#391 ✓rather thanmain). A compact full-colour tree between the branch name and the sync suffix marks a linked worktree; the hover card names the tree in aworktreerow and adds anown checkoutrow with the workspace's own directory, so the main checkout's branch and dirty state stay one hover away. The projection is a host fact, so no registration file, TTL or worktree guess is involved. A projection change pushes a refresh over SSE, so the chip follows within about one second. A workspace-targeted row always reports the checkout the registry owns. - Sidebar session-row action glyph — each session row shows the ONE thing that conversation needs from you:
resume,resolve,sync,pull,update,push,merge,commit,review,fix CI, orin syncwhen there is nothing to do. The node half is the single authority: it ranks the rules and attaches arowTokenand itsrowSeverityto every status response, so the chip, the picker and the row cannot drift. It is triage rather than status:mergeappears only when GitHub itself reportsmergeStateStatus: CLEAN, and every waiting state (draft, blocked, checks still running) stays silent. The token renders as a single coloured icon, in the row's 16px leading cell and at the head of the input chip: red for a conflict, a paused operation or a failing build, amber for a requested review, green formerge, quiet blue for routine sync, and amber for thein syncdisc when commits are not yet merged. It appears only when the session is idle — while a turn is running upstream shows its own status dots there, because the checkout is still moving and a suggestion would describe a state that is about to change. With nothing to do the node emitsin sync, so a session is never iconless: a disc in both surfaces, green when the branch is the default branch or its work is merged, amber when commits are not yet merged. The same hover card explains it. Hovering the row opens the row's usual hover card, which renders the action as a label/value row — the icon, the word and the reason (↑ push — no upstream configured) — beside the checkout and the pull request. No patch and no install step: the glyph rides upstream's ownsidebar.session.row.leadingseat, and the explanation ridessidebar.session.row.hover, so both work on a pristine install. - Nothing on workspace rows. A workspace cannot know which worktree its conversations are using, so a per-workspace badge could only guess or report the main checkout. The token is on the session row for that reason.
There is no drawn status mark: the leading icon is the node half's action token, and its colour is the severity. The same icon leads the input chip and the session row's 16px cell. Four tokens are drawn arrows, the idle verdict is a drawn disc, and the rest are text glyphs. The card's worktree row names a linked checkout.
Event-driven freshness: working trees are watched and updates push over SSE — badges flip within ~1s of any commit, stage, or edit, including inside a linked worktree the session entered. One git status --porcelain=v2 per sample, shared by every surface pointing at the same checkout, plus at most one gh read per repository-and-branch per ~20s. The status API takes no path: the caller passes a session id (chip and sidebar rows) or a workspace id, and the server resolves the directory itself.
Diagrams, the hover card's full field list and a walkthrough for git newcomers live in the repo README — this file is the npm-facing summary.
Install
dsh plugin --profile web add dsh-git-badge
Restart the web process, refresh the browser. Requires Node ≥ 20, DSH 0.2.1 or newer, and git on PATH. gh, on PATH and authenticated, is optional — it only enables the PR/CI token.
No seam patch and no CLI. The badge reads DSH's own workingDirectory
projection, so it follows the checkout a session entered without a registration
step. The /gh skill is registered at runtime, not copied into your home.
Sidebar technical details
Both surfaces ride upstream seats: the status icon on
sidebar.session.row.leading (a 16px, idle-only cell), the hover card on
sidebar.session.row.hover.
Changelog
See CHANGELOG.md.
License
MIT
链接
同类插件
zhu1090093659/dsh-web#packages/dsh-git-graph★ 9959
输入框上方提供 Git 分支选择器,并把分支泳道与提交历史画成图谱,沿着时间线找到任意变更。作者已将其退役并改用官方 workspace-changes 插件;已发布的 npm 包仍可安装,但不再开发。
Akimiya-z/codex-guard#dsh★ 132
在 DeepSeek Harness 内做提交前的 Pull Request 卫生检查:扫描当前改动中的 TODO 残留、硬编码密钥与非规范提交信息。
Cerbur/clutch-dsh#clutch-dsh-worktree★ 38
为 DSH Web UI 增加按 Git Worktree 组织 Session 的视角,同时继续由 DSH 管理原始 Project 和 Session 数据。
xbzbing/dsh-git-panel★ 33
DSH Web GUI 里的 IDE 风格 Git 面板:常驻标签页含三栏总览(分支/标签列表、可搜索的提交历史图、含变更文件树与提交信息的提交详情)与变更记录页(统计条、带逐文件暂存/取消/丢弃的未提交列表、含 amend 的提交框);并排差异带懒加载 highlight.js 语法高亮、块间上下文按需展开与词级行内高亮,图片文件以变更前/后双图对照;另在输入框提供 zsh 风格分支标记。所有 git 命令以 argv 数组经宿主 subprocess 执行、cwd 锁定仓库根。
DamonKoy/dsh-web-ui#dsh-git-graph★ 30
dsh web GUI 会话头部栏的 Git 分支选择器与提交图。
PerryLink/dsh-github★ 28
官方级 GitHub CI 集成:composite action.yml、轮询 PR 评审机器人(幂等行内评论 + status-check 门禁)以及 PR/issue 工具,所有写入走人工审批门。
社区评论
评论公开保存在 GitHub Discussions。加载评论会连接 GitHub 和 Giscus;发表内容需要 GitHub 账号。