Skip to main content

dsh-ui-web/packages/dsh-git-graph

34Stars2Forks0Issues0Watchers

Provides a git branch selector and Git commit graph panel for DSH Web dialogs, with the host process actually executing git switch/create.

Evidence5/5methodologySourceInstallMaintenanceDSH versionSecurity scan
Machine-auditedInstall commandRepo verifieddsh-plugin topicLicenseREADMEAI wiki

ⓘ This plugin is a sub-package of the CAPTAIN1275/dsh-ui-web monorepo — stars and activity count the whole repository.

Language
TypeScript
License
Apache-2.0
Branch
main
dsh-plugindsh-plugin-marketdsh-plugins

Install

cmdweb profile
$ dsh plugin --profile web add @captain1275/dsh-client-ui-git-graph

Run 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 CAPTAIN1275/dsh-ui-web/packages/dsh-git-graph for me: review the repository at https://github.com/CAPTAIN1275/dsh-ui-web 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.

At a Glance

Adds a git branch selector and Git commit graph panel above the input box for DSH Web; git operations execute on the real working tree in the host process, while the UI runs in the browser.

Core Features

  • Displays a branch capsule above the conversation input box, showing the current branch name (including uncommitted changes count)
  • Popup searchable local branch list, one-click switch to any local branch
  • Create and immediately switch to a new branch (based on current HEAD)
  • Open Git graph panel to view commit history across branches/tags/remotes in topological order, with pagination support
  • Receive workspace branch status changes in real-time via SSE, auto-refresh after external git operations
  • Switch guard: rejects unresolved conflicts, ongoing git operations, or target branch checked out by another worktree

Technical Implementation

  • Language: TypeScript + React (TSX)
  • Key Dependencies: @deepseek-ai/dsh-host-webserver, @deepseek-ai/dsh-subprocess, @deepseek-ai/dsh-workspace, @deepseek-ai/dsh-client-ui-slots, @deepseek-ai/dsh-client-ui-primitives, @deepseek-ai/cordis
  • Architecture: cordis dual-sided plugin, host half (git service + /git/* HTTP routes + SSE push) + browser half (React components + route client); activated via cordis.patch.yml as profile bundle, browser side declares injection of @deepseek-ai/dsh-client-locale, @deepseek-ai/dsh-client-runtime, @deepseek-ai/dsh-client-ui-conversation
  • Entry Points: src/index.ts (host main), src/client/index.ts (browser main), src/invariant.ts (invariant exports)

Use Cases

For users in DSH Web who frequently switch branches for comparative experiments, want to casually view the current repository's commit graph, and don't want to leave the IDE to type command-line commands. For example, when debugging on feature/x branch, wanting to switch to main to see if a certain change exists, but too lazy to open a terminal; also hoping to review recent merge history through a graphical commit graph.

Prerequisites & Compatibility

DependencyMin VersionDescription
DSH (peerDependencies)^0.1.0-rc.6Requires host-webserver, subprocess, workspace, client-ui-conversation and other official SDKs
Node^22.19.0 or >=24.0.0Declared by package.json engines
WorkspaceMust be a registered DSH workspaceHost routes use realpath to compare with workspaceRegistry as security boundary
System gitBinary availableInvokes git commands via ctx.subprocess, requires git in machine PATH

Installation

dsh plugin --profile web add github:CAPTAIN1275/dsh-ui-web/packages/dsh-git-graph

Configuration

No additional configuration required. Host routes are hardcoded to only accept registered workspace paths; git operation directory comes from current session's cwd; branch capsule automatically appears only inside git repositories.

FAQ

Q: Will switching branches affect other sessions?

A: Yes. Switching operates on the disk working tree at workspace root (git switch --no-guess <branch>); all sessions in the same workspace see the new branch; the plugin does not separately change working directory for existing sessions.

Q: What to do when errors like "unresolved conflicts" pop up during switching?

A: This is the host's guard at work. Open terminal at repository root to run git status to handle conflicts, rebase/cherry-pick, or switch to another clean branch; the plugin rejects switching when workspace has unresolved conflicts or ongoing operations.

Q: Clicked switch button but nothing happened?

A: Common causes: target branch doesn't exist (already deleted), typo in branch name with duplicate branch, target branch checked out by another worktree. The capsule displays corresponding Chinese/English error messages; first run git branch -a in terminal to confirm branch name.

Q: What happens when workspace is not a git repository?

A: Branch capsule simply hides, doesn't render placeholder controls; plugin won't mistakenly report "non-repository" errors; after switching to a git directory, it appears on next refresh.

Q: How far back can Git graph panel view history?

A: By default fetches the most recent 200 commits at once (/git/graph endpoint limit), pagination adds 100 more when "Load More" appears at bottom; returns hasMore=true when exceeding limit. Panel only shows refs visible to current repository (local branches + tags + remotes), does not modify history.

Q: Will uninstalling affect existing git state?

A: No. Plugin is just UI + routing layer; git operations go directly through git binary; uninstalling only removes branch capsule and graph panel, working tree remains unchanged.

Getting Started Difficulty

Beginner — one-line install command, no configuration needed; switching and creating branches follow native git semantics; as long as workspace is already a git repository, the branch capsule will appear.

Known Issues & Limitations

  • Branch capsule only appears when workspace is a git repository; opening DSH Web in non-repository directories won't show capsule
  • Browser side accesses git via host's /git/* routes; paths must hit registered workspaces (realpath verification), arbitrary directories cannot directly execute git
  • Switching is workspace-level, no "switch branch for single session" capability; existing sessions won't change cwd
  • Git graph panel commit info is based on last fetch; external repository changes reflected via SSE polling every 2 seconds (see src/host/routes.ts:34)
  • Request body size limit 1 MiB (src/host/routes.ts:38-39), oversized requests are destroyed directly without parsing

Read the usage guide →

Install steps, key points, FAQ and compatibility for this plugin — auto-derived from indexed fields.

Listing badge

Listed on deepseek-plugin.org
[![Listed on deepseek-plugin.org](https://img.shields.io/badge/listed_on-deepseek--plugin.org-007EC6)](https://deepseek-plugin.org/plugins/CAPTAIN1275/dsh-ui-web/packages/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.

← Back to plugin directory