Embeds Git graph, branch management, uncommitted changes panel, and code diff directly into the DeepSeek Harness chat page, allowing users to view version history and perform read/write operations without switching contexts during AI-assisted coding.
- Language
- HTML
- License
- MIT
- Branch
- main
Install
$ dsh plugin --profile web add github:1841220388zzzcccxxx-star/dsh-git-graphRun the command above in your terminal to install this plugin via the dsh CLI. You can switch Profile in the top-right corner. New to dsh? Read the beginner tutorial
Install via your agent
Install the DeepSeek Harness plugin 1841220388zzzcccxxx-star/dsh-git-graph for me: review the repository at https://github.com/1841220388zzzcccxxx-star/dsh-git-graph first, then run the install command and verify the plugin loads successfully.
Paste this instruction to the DSH Web GUI assistant — it will install and verify for you.
One-sentence Positioning
Embed Git commit graph, branch management, file diff, and VSCode-style uncommitted changes panel within DeepSeek Harness chat interface, allowing AI programming without switching to external Git clients to view version history and perform read/write operations.
Core Capabilities
- Browse commit history: GitHub-style commit list with collapsible branch groups, local/remote branches color-coded, Ctrl+click to compare two commits, Ctrl+F to search, Ctrl+B to collapse all branch groups, ↑↓/j/k to navigate, Enter for details, Esc to close, etc.
- View uncommitted changes: Always visible at top of graph, three file groups: staged / modified / untracked (including raw content for untracked files), line count per file +/- with syntax-highlighted diff, collapsible panel and grouping
- Manage file changes: Single-line stage / unstage / discard, checkboxes for batch stage selected / unstage selected / discard selected / ignore selected / commit selected, commit dialog includes "✨ AI-generated commit message" candidate
- Remote and branch operations: Top bar ⬇ pull / ⬆ push, local branches can 🔄 switch / 🗑 delete (only after merge, HEAD protected), remote branch group header always shows "synced" / "included" status
- Browse any repository: Top bar "📂 Open" or empty state "Open folder" to navigate disk directories and select Git repositories, added paths persisted via localStorage, persist across refreshes for continued browsing
- One-click auto-update: Silently check GitHub latest version when opening graph, new version shows "🔄 New version vX.Y" in top bar, auto-download and replace after confirmation (backup old version, rollback on failure), restart dsh web to take effect; 8 built-in themes (🌸 Sakura / 🌊 Ocean / 🌲 Forest / 🌙 Night / 🍬 Candy / 💼 Business / ✨ Galaxy / 🤖 Tech)
Technical Implementation
- Language: JavaScript (Node
type: module, pure ESM) - Key Dependencies: Only Node built-in modules
node:child_process,node:fs,node:path,node:os,node:url,node:net, plus host-provided React and slots services - Architecture Pattern: Host-half / Client-half dual-end plugin—server
index.jsregisters/git-graphprefixed routes viainject: ['webServer']providing git API (graph / branches / workstatus / workfile / gitop / show / diff / filelog / remoteinfo / checkupdate / autoupdate / listdir / addrepo / repos, etc.), clientclient.jsregisters "Git Graph" tab underconversation.viewslot viainject: ['slots'](label="Git 图谱", order=20), tab embeds iframe loadingweb/index.html - Entry Files: Server
index.js, clientclient.js, UIweb/index.html(3414 lines inline script, zero external build artifacts)
Use Cases
For developers who want to view commit history, switch branches, stage/revert changes, or push to remote without leaving the current page while having AI write code in DSH. When an Agent generates changes for you and you need to visually review every file's diff before merging to main, see who last modified the same line, confirm no leftover untracked files—this panel is more efficient than repeatedly switching to SourceTree / GitHub Desktop.
Prerequisites & Compatibility
| Dependency | Minimum Version | Description |
|---|---|---|
| DeepSeek Harness | >=0.0.1 (dsh.plugin.json engines.dsh) | Only declares minimum version; plugin uses webServer service (index.js:20 inject: ['webServer']) and slots service (client.js:44), host needs these injection points |
| Node.js | Not declared | Source doesn't specify engines.node in package.json; syntax uses ESM and top-level await, runtime needs Node ≥ 14+ (recommend ≥ 18) |
| System Git | Any version | index.js:26 calls git CLI directly via execFile('git', ...), must be findable in system PATH |
| Platform | macOS / Windows / Linux | Reveal operation calls explorer / open / xdg-open based on platform branch (index.js:673-675), rest of logic is cross-platform consistent |
| Native Modules | None | All Node built-in modules used, no node-gyp / prebuilt binaries |
Installation
dsh plugin --profile web add github:1841220388zzzcccxxx-star/dsh-git-graph
Configuration
| Config | Type | Description | Default |
|---|---|---|---|
repo | String (path) | Optional initial whitelist: single repository absolute path allowed for graph. If configured and valid Git repo, appears in repository dropdown | Not configured |
repos | String array (paths) | Optional initial whitelist: same as repo but supports multiple; if configured, appears in repository dropdown | Not configured |
Both are optional, works without configuration—use top bar "📂 Open" or empty state "Open folder" button to browse and add Git repositories from any path anytime, added paths persisted in browser localStorage (key
gg2-repos, re-registered to server on each load viarepos?add=).
FAQ
Q: Where to find it in the chat page after installation?
A: Open any chat page, a "Git 图谱" tab will appear next to "轨迹" tab, click to enter this plugin's visual interface.
Q: Can I use it without writing config.repo/config.repos?
A: Yes. These two fields are optional whitelists, writing or not doesn't affect basic functionality; without configuration the graph follows current conversation's Git workspace, to view other repositories use top bar "📂 Open" or empty state "Open folder" to manually add.
Q: Must have Git installed on system?
A: Yes, required. Server calls git CLI directly via execFile('git', ...) (index.js:26), without git any API will fail and return git's error message.
Q: Large repositories lag? How to load more?
A: Default 200 commits per page, tens of thousands won't lag. "Load More" button at bottom, click to pull next page on demand; total count displayed in status bar via git rev-list --all --count in real-time.
Q: What credentials needed for push/pull?
A: Uses your global git config (SSH key, git credential helper, HTTPS token, etc.). Plugin doesn't manage credentials, authentication failures return git's stderr as-is.
Q: Will auto-update overwrite and break current version?
A: No. Before update creates .bak-<ts> backup at same level as plugin directory before replacement, any step failure rolls back from backup; automatically cleans up historical backups after success, keeping only latest.
Q: How to uninstall?
A: dsh plugin --profile web remove github:1841220388zzzcccxxx-star/dsh-git-graph, then restart dsh web. Configured whitelist is just initial accessible set, not persisted to plugin directory, cleared on uninstall.
Q: Will write operations like revert, push, delete branch accidentally trigger?
A: No direct execution. All destructive actions show confirmation dialog in client first, destructive writes require checking "Confirm" button before going to server; server then validates path must be within repository, validation failure returns path-outside-repo.
Learning Curve
Beginner — Install and use, top bar buttons and right-click menus are translations of common Git client actions; only need to glance at README or AGENTS.md for a few concepts like path whitelist, auto-update trigger logic.
Known Issues & Limitations
- Git must be installed on system: All data from
execFile('git', ...); completely unusable without git - Update requires manual restart of dsh web: Auto-update only replaces disk files, running process still holds old code; AGENTS.md / README / autoupdate comments explicitly require restart
- Large file diff gets truncated: Server
MAX_DIFF_CHARS = 240000(index.js:17), single file diff / commit patch exceeding that length truncated and returnstruncated: trueflag - Windows schema false positive: Write operation path validation relies on forward/back slash normalization (
replace(/\\/g, '/')), if repository itself not on standard drive path may need to restart before accessing - Remote operations may fail with credentials: push / pull / fetch carry no credential handling, fully depend on user's git global config; non-fast-forward or auth errors echo git error as-is
- Write operations depend on client confirmation: Server doesn't gate safety checks for dangerous operations like "discard all changes" / "force push", confirmation UI all in client; custom clients / reverse calls need to handle confirmation flow themselves
🌏 中文 · English
🧭 一句话定位:DSH 生态里开箱即用的 Git 可视化工具。 在 DeepSeek Harness 对话界面内直接嵌入 GitHub 风格的提交历史图、分支管理、代码 Diff 与 VSCode 风格未提交改动面板——AI 开发时不用再切到别的 Git 客户端。
DeepSeek Harness(DSH)Web GUI 的嵌入式 Git 仓库图谱可视化插件。
在对话界面里直接查看、浏览、管理 git 仓库:提交历史图、分支过滤、提交详情、文件 diff、工作区状态、右键 git 操作,全部内嵌在 harness 界面中,无需离开当前对话。提交图一目了然,未提交改动像 VSCode 一样分组展示,一眼看清"改了什么、谁改的、要不要提交"。
适合谁:用 DeepSeek Harness / DSH 做 AI 编程、Agent 开发的开发者;想在同一个界面里同时看清提交历史、分支、工作区改动的 Git 用户;需要比命令行更直观的 Git 可视化工具的开发者与团队。
🔍 搜索关键词:DSH 插件 · DeepSeek Harness 插件 · Git 可视化 · Git 图谱 · 提交历史图 · 分支管理 · 代码 Diff · VSCode 风格改动面板 · Git 效率工具 · AI 编程助手
🛠 本项目由 AI 辅助开发(AI-assisted development)。
📸 效果预览
✨ 功能
- 提交历史图:GitHub 风格提交列表,分支分组折叠、分支着色(本地与远程分支各有独立分组)
- 跟随当前对话:打开哪个对话就显示哪个对话工作区的 git 仓库,切换对话自动跟随;非 git 仓库的对话显示空态提示
- 📂 打开文件夹(v0.11):不局限于当前对话工作区——点击顶栏「打开」或在空态中点「打开文件夹」,可浏览磁盘(驱动器 → 目录逐层进入,带 git 标记),选择任意文件夹(如另一个工作区的仓库 B)查看其版本管理;添加过的仓库持久保存,顶部下拉随时切换,刷新后仍可继续查看
- 分支过滤:勾选 = 显示该分支 · 不勾 = 完全隐藏(全部不勾选则列表为空)
- 提交详情:提交信息、文件变更列表、单文件 diff、两次提交对比(Ctrl+点击)、📜 文件历史(查看单个文件的所有历史提交)
- 未提交改动(VSCode 风格,常驻图谱顶部):已暂存 / 更改 / 未跟踪三组文件列表、状态徽标(A/M/D/R/U/?)、每文件 +/− 行数、点击行展开单文件 diff(语法高亮)、重命名
旧 → 新、未跟踪文件直接显示内容;☑ 分组开关可单独隐藏某组,面板与分组均可点击折叠;每行可 暂存/取消暂存/还原,顶栏 全部暂存/提交,勾选复选框可批量 暂存选中/取消暂存选中/还原选中/忽略选中/提交选中(破坏性操作执行前弹确认框);提交对话框内可 ✨ AI 生成提交信息(依据 diff 自动生成候选,可编辑) - 右键菜单:复制哈希/消息、查看详情、🏷️ 打标签(可改名/删除)、🌿 从提交新建分支、🌐 打开 GitHub 提交页、复制仓库路径、在文件管理器中打开
- 远程/分支操作:顶栏
⬇ 拉取(git fetch)与⬆ 推送(git push 当前分支,确认后执行);分支组头右键——本地分支可 🔄 切换 / ⬆ 推送 / 🗑️ 删除(已合并才可删,HEAD 受保护),远程分支可 ⬇ 拉取 / 复制远程分支名 - 远程分支可见:远程分支组头始终显示(即使与本地完全同步),并标注「已同步」/「已包含」状态
- 自动更新:打开图谱时静默检查 GitHub 最新版本,发现新版本顶栏显示「🔄 新版本 vX.Y」,一键点击自动下载并替换插件文件(自动备份旧版,失败自动回滚),重启后生效
- 状态记忆:分支过滤、☑ 分组开关、面板/分组折叠状态、主题自动保存,刷新后保留(v0.8 起键统一为
gg2-*,首次打开分支默认全部展开) - 多仓库切换:图谱页头部下拉快速切换多个仓库
- 大仓库优化:提交列表分页加载(200 条/页 + 加载更多),上万提交也不卡
- 键盘快捷键:
Ctrl+F搜索、Ctrl+/快捷键面板、Ctrl+B折叠/展开全部分支组、↑↓/j/k导航、Enter详情、Esc关闭 - 自动刷新:页面可见时每 5 秒监听工作区改动与新增提交,自动更新统计与列表
- 主题系统:自动跟随 / 深色 / 浅色,外加 8 种风格方案(与拾光记同款)——🌸 樱花(飘落花瓣)、🌊 海洋(波浪/气泡/鱼群)、🌲 森林(树木/落叶/萤火虫/蝴蝶)、🌙 夜空(星星/月亮/流星)、🍬 糖果(彩虹/彩带/棒棒糖)、💼 商务(几何/玻璃浮块)、✨ 星河(繁星/月亮/流星/地球)、🤖 科技(电路/齿轮/芯片),每种风格自带专属动态背景(海洋/科技/商务/糖果元素密度更高)
- 挂载位置:会话页内「Git 图谱」标签(位于「轨迹」标签旁)
📦 安装
1. 把插件加入 profile
编辑你的 DSH web profile 的 package.json,添加依赖:
{
"dependencies": {
"dsh-git-graph": "file:./plugins/git-graph"
}
}
(plugins/git-graph 为本插件源码所在目录,按实际路径调整。)
2. 挂载 bundle
在 profile 的 cordis.patch.yml 中加入:
- insert:
- id: git-graph
name: dsh-git-graph
config:
repo: "C:/path/to/your/repo"
config.repo/config.repos是可选的初始可访问仓库白名单;不配置也能用——图谱页顶栏「📂 打开」可随时浏览并添加任意文件夹的 Git 仓库(v0.11),添加过的仓库会记住。运行中被会话工作区发现的仓库也会自动加入可访问集合。
3. 安装并重启
pnpm install
# 然后重启 dsh web(或直接使用一键重启脚本)
打开 http://127.0.0.1:3080 ,在任意会话页内点「Git 图谱」标签(位于「轨迹」标签旁)即可查看。
🖱️ 使用
| 操作 | 说明 |
|---|---|
| 会话页「Git 图谱」标签 | 在该对话内查看图谱(跟随当前对话工作区) |
| 📂 打开 / 空态「打开文件夹」 | 浏览磁盘选择任意 Git 仓库(如其他工作区的文件夹 B),添加后显示其版本管理(v0.11) |
| 顶部仓库下拉 | 切换仓库;旁边小字显示当前仓库完整路径 |
| 分支组标题 | 点击折叠 / 展开该分支 |
| ☑ 分支过滤 | 勾选 = 显示该分支,不勾 = 完全隐藏 |
| 图谱顶部「未提交改动」区块 | 已暂存/更改/未跟踪一览(含未跟踪文件),点击行展开 diff;☑ 分组可隐藏某组;点击顶栏或组标题折叠;行内「暂存/取消暂存/还原」,顶栏「全部暂存/提交」,勾选复选框批量 暂存/取消暂存/还原/忽略/提交 |
| 提交行 | 点击查看详情,Ctrl+点击与另一提交对比 |
| 提交行右键 | 复制 / 查看详情 / 打标签 / 从提交新建分支 / 打开 GitHub 提交页 / 复制仓库路径 / 打开文件夹 |
| 提交详情里的 📜 | 查看该文件的历史提交 |
| 底部状态栏「未提交改动」 | 点击滚动到顶部改动区块 |
| ↻ 刷新 | 重新加载仓库数据 |
🛠️ 开发
git-graph/
├── index.js # 服务端:git API(graph/branches/workstatus/workfile/diff/...)
├── client.js # 客户端插件:会话页「Git 图谱」标签
├── web/index.html # 图谱界面(iframe 内独立页面)
├── package.json # 插件清单(dsh.client.inject + bundle patch)
└── cordis.patch.yml # profile 挂载点
修改后同步到 DSH 部署目录(node_modules/dsh-git-graph/):
.\sync-deploy.ps1
服务端(index.js)改动需重启 dsh web;页面(web/index.html)改动刷新即生效。
📄 开源协议
🙏 致谢
- DeepSeek Harness —— 插件运行平台
Read the usage guide →
Install steps, key points, FAQ and compatibility for this plugin — auto-derived from indexed fields.
Listing badge
[](https://deepseek-plugin.org/plugins/1841220388zzzcccxxx-star/dsh-git-graph)Paste this markdown into your GitHub README to link back to this listing. The badge only states the listing — not a security endorsement.