dsh-git-graph-sidebar
English | 中文
A Git browsing plugin for DeepSeek Harness (DSH): a branch chip in the composer, plus a Repository graph tab inside dsh-better-sidebar that lists every Git repository below the current workspace directory and draws the selected repository's commit graph as an SVG lane canvas.

What it does
Repository graph tab (better-sidebar)
The tab works from the session's working directory and treats that directory as a container: everything Git-shaped below it is reachable without registering each repository as a separate DSH workspace.
- Multi-repository discovery — the workspace root itself, plus repositories nested up to 3 levels below it. Each entry carries its current branch, short head, dirty-file count and conflict count.
- Repository tree — the root, the intermediate directories and each repository, so the level relationship between them is visible rather than implied by a path.
- SVG commit graph — one row per commit, one colored lane per branch line, curved edges where a commit's parent sits on another lane, merge commits drawn as diamonds, ref badges and relative timestamps.
- Zoom — rows are two lines by default;
−/+fold them into compact single-line rows or open them up. - Pinned commit card — click a row for the full hash, subject, author, time and parent count.
- Refresh — re-scans on demand. The host caches a scan for 60 s.
Branch chip (composer)
The chip that ships with the upstream plugin is unchanged: on a blank conversation it lets you switch or create a branch, and it opens the interactive commit-graph dialog and the worktree manager. Branch operations run in the host process; the chip hides itself on active sessions.
Requirements
| Item | Value |
|---|---|
| DSH | >=0.2.1-rc.2 <0.3.0-0 |
| Node (host runtime) | ^22.19.0 || >=24.0.0 |
dsh-better-sidebar |
needed for the tab only — without it the plugin still loads and the chip keeps working |
Install
Grab the prebuilt bundle from the latest release — dsh-git-graph-sidebar.tgz, no build step needed — then install it as a plugin bundle:
Desktop app (the
desktopprofile is owned by the Electron app, so the CLI refuses it): install the.tgzfrom the app's plugin page.CLI-managed profile:
dsh plugin --profile <profile> add github:Athosoo/dsh-git-graph-sidebar # or from the downloaded tarball dsh plugin --profile <profile> add ./dsh-git-graph-sidebar.tgz
Restart DSH after installing. The host half registers its /git/* HTTP routes at startup, so a page refresh alone is not enough for a first install, and an upgraded build is not picked up until the process restarts.
The tab needs dsh-better-sidebar installed; without it everything else — the branch chip, the graph dialog, worktrees — keeps working and only the sidebar tab is absent.
Repository discovery rules
| Rule | Value |
|---|---|
| Scan depth | 3 levels below the working directory (a repository found at a level is not descended into) |
| Upper bound | 200 repositories per scan, then the result is flagged as truncated |
| Skipped directory names | node_modules, dist, build, out, coverage, target, vendor — plus every dot-directory |
| Repository marker | a .git entry (directory, file or symlink — so worktrees and submodules are both detected) |
| Per-entry status budget | 5 s; an entry whose git status did not return in time is still listed, without branch metadata |
| Cache | 60 s per base path, shared between concurrent requests; the tab's refresh button bypasses it |
HTTP routes
Registered by the host half under /git; all of them answer JSON ({ok:true,value} / {ok:false,error}), except /git/events, which is a server-sent event stream.
| Route | Purpose |
|---|---|
/git/repos |
multi-repository discovery for a path ({path, refresh?}) |
/git/status |
branch, head, dirty/untracked/conflict counts |
/git/branches |
branch list with the current one marked |
/git/graph |
commit list with parents and refs ({path, limit?}) |
/git/switch |
switch branch |
/git/create-branch |
create and switch |
/git/worktrees |
worktree list |
/git/worktree-add |
create a worktree |
/git/worktree-remove |
remove a worktree |
/git/events |
change notifications (polled by the UI) |
Every route resolves the requested path with realpath and rejects it unless it lands inside a registered workspace. Nested repository directories are accepted; anything outside a workspace gets workspace-unknown.
Known limitations
- The tab is read-only. Branch switching and worktree operations stay in the chip's dialog; they are not wired into the tab yet.
- Do not install this alongside
@linxin666/dsh-client-ui-git-graph. Both halves own the/gitroute prefix, and two registrations of the same prefix conflict. Install one or the other. - Repositories deeper than 3 levels are not listed, and a repository inside a skipped directory name (
node_modules,dist, …) is not listed either, by design. - The host half is a build output.
lib/index.jsis edited directly (the added parts sit in marked//#regionblocks);lib/client.jsis generated by splicingsrc/client/graph/SidebarTab.jsinto it. See DEVELOPMENT.md.
Development
npm run build # splice src/client/graph/SidebarTab.js into lib/client.js
npm run check # node --check on both bundles
npm run validate # every t("…") key exists in both locale dictionaries
npm run preview # render the tab to preview/*.html without a running DSH
npm run preview writes standalone HTML files (dark and light theme) that show the tab with sample repositories and commits, so layout changes can be checked in a browser without installing anything.
Attribution and license
Apache-2.0 — see LICENSE and NOTICE.
This is a fork of @linxin666/dsh-client-ui-git-graph 0.4.8 by linxin666, also Apache-2.0. The branch chip, the commit-graph dialog, the worktree manager and the host git service come from that project. Changes in this fork: renamed package, workspace gate widened from exact-path match to inside-a-workspace, added the /git/repos discovery route, added the better-sidebar tab (repository tree, SVG canvas, zoom, pinned commit card) and its locale keys.
No comments yet. Be the first to write one.