dsh-git-idea: Git operations in DSH sessions with IDEA-style

Introduction

When working with models in DeepSeek Harness (DSH), you often have to switch to a terminal or external IDE to see branches, uncommitted changes, and commit history in your workspace. While models can run git commands via bash, there lacks a visual VCS interface bound to the current session workspace on the UI side. Published by community maintainer mays-hi, dsh-git-idea is categorized as a client plugin: it provides a Git chip next to the “Permission Mode” in the Web session input box, where hovering shows branch switching options and clicking opens an IDEA-style VCS panel, with a settings page attached; it does not register any model tools to DSH, nor inject prompts. The current version is 0.3.0, requires DSH >=0.1.5-rc.1 (engines.dsh), has @deepseek-ai/cordis ^4.0.2 as peer dependency, and is licensed under MIT. Repository: https://github.com/mays-hi/dsh-git-idea; Community directory: https://www.skillhub.cn/plugins/mays-hi/dsh-git-idea (independent site, with no official affiliation to DeepSeek/High-Flyer).

What is This

dsh-git-idea brings IntelliJ IDEA’s VCS interactions into DSH Web sessions: branch names with uncommitted file counts, branch switcher, history with commit graph and changes, diffs and commit details, repository switcher for multi-repo workspaces, and a settings page for managing commit identity and git paths. The panel follows sessions rather than being bound to the browser window; each session in the same page corresponds to its own workspace. When DSH’s official create_worktree migrates a session to a linked worktree, the chip and panel will follow that worktree’s Git state and show the worktree identity in the UI — the plugin doesn’t create, delete, or migrate worktrees, only reads existing layouts.

Unlike “registering another set of git tools for the model”, this plugin deliberately doesn’t occupy model tool slots: git operations can still be performed by the model via shell, while humans use the UI for viewing, staging, committing, pulling/pushing, and other common workflows.

Core Features

Git Chip Next to Input Box

Action Result
View Shows current branch; displays count badge when there are uncommitted changes. When not in a repository, clearly states the reason (e.g., “not a repository”, “no git”, “directory does not exist”). While checking change counts, shows hollow numbers or … to avoid confusion with the “switching branch” spinner
Hover Branch switcher card: check out branches; switch the currently viewed repository when multiple Git repos exist in the workspace (can be disabled in settings)
Click Open or collapse the VCS panel

VCS Panel

The top bar switches between “Changes/History” tabs and provides re-read, fetch, pull, push (buttons only show symbols, names are in aria-label); the middle shows the current branch name, clickable to open the switcher; there’s also a repository chip for multi-repo workspaces. The left panel shows the branch tree (HEAD/local/remote); the middle panel shows the working tree on the Changes page, or the commit list and commit graph on the History page; the right panel shows patches, commit details, or commit messages with a commit button. Panel size is draggable and remembered.

Common workflows include: on the Changes page, check files and write commit messages then “Stage All and Commit” or “Stage All”; check out, create branches, merge in the branch tree or switcher; cherry-pick, revert, tag commits on the History page; perform fetch/pull/push via the top bar. During merge conflicts, the top bar indicates the number of conflicting files and provides continue, skip, abort operations.

Settings Page

Configure commit identity (user.name / user.email, equivalent to git config), git executable location, and network-related parameters. If commit identity is not configured locally, git commit will be rejected; the panel explains this in the commit area and provides example commands for git config --global user.name / user.email.

Platform Differences (Important Before Use)

  • DSH Desktop (dsh-app://app): Panel RPC is proxied through the Electron main process, with authentication following the Host’s connection.requestRejection rules; older versions may incorrectly require Origin, potentially causing blank desktop panels.
  • Windows: The plugin’s backend scripts are POSIX sh; when DSH’s shell is PowerShell, it will attempt to execute scripts through Git for Windows’ bundled usr/bin/sh.exe. If sh.exe is not found, behavior remains unchanged from before adaptation, and the settings page will indicate “shell for reading commands” related issues.

Installation and Activation

Requires DSH >=0.1.5-rc.1. Installation methods from the official README are as follows (all require --profile web):

dsh plugin --profile web add dsh-git-idea                    # npm
dsh plugin --profile web add github:mays-hi/dsh-git-idea      # GitHub
dsh plugin --profile web add /path/to/dsh-git-idea            # local directory

Restart dsh web after installation. If ERR_PNPM_ADDING_TO_ROOT appears, add -w before the package name.

If an older dynamic plugin bridge is still running (<DSH_HOME>/dsh-git-idea), it should be disabled first, otherwise there will be two chips and two panels competing for the same UI position.

Typical Usage

Below follows the interaction sequence described in the README for easy reproduction in Web sessions with the plugin installed.

  1. Confirm workspace is within a Git repository
    Open a session and select a project directory containing .git. The Git chip next to the input box should display the branch name; if there are changes, show the number of files waiting to be committed.

  2. Hover over the chip to switch branches
    Move the pointer over the chip, search or select branches in the card and check them out. For multi-repo workspaces, you can select the repository to view at the top of the list (only changes which repository the UI reads, not moving the session directory).

  3. Click the chip to open the panel — Commit
    Switch to the “Changes” page, check files in the tree to include in the commit; fill in the commit message in the right panel, use “Stage All and Commit (N items)” or first “Stage All”. To commit only specific files, only check the corresponding items; clicking the checkbox again will unstage them.

  4. View history and diffs
    Switch to the “History” page, select a branch in the left branch tree, select a commit in the middle list; view details and file lists in the right panel, click on file rows to open diffs. “Load More” at the bottom of the list loads 200 entries per click; supports literal/regex search and filters by branch, author, time, path, etc.

  5. Sync with remote
    Use ⇣ (fetch), ↓ (pull), ↑ (push) in the top bar. When the current branch has no upstream, the panel provides a one-click suggestion to set upstream; for local repositories without configured remote, buttons will explain why the operation wasn’t performed and suggest commands to run, rather than failing silently.

  6. Configure commit identity (before first commit)
    Fill in “dsh-git-idea Config → Commit Identity” on the settings page, or execute in terminal:

git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"

Use Cases and Notes

Suitable for: Developers who frequently modify code in DSH Web sessions, want branches and changes visible at a glance, and don’t want to switch between IDE or terminal for daily git operations; sessions already using or planning to use DSH create_worktree and need to continue using the same VCS UI on linked worktrees.

Notes:

  • The plugin runs with the current dsh process permissions; before installation, please review the source code and MIT license yourself, and assess whether you trust the maintainer and npm/GitHub distribution channels.
  • Does not register tools for the model: automated git still depends on the model’s built-in shell; this plugin primarily serves human UI operations and status reading.
  • Checking the entire working tree changes in large repositories may take several seconds to about 8–10 seconds; the chip uses numeric status rather than prolonged spinning to indicate “checking”.
  • Community directory page statistics like stars may change; refer to the repository README and package.json for versions and dependencies.

Conclusion

dsh-git-idea embeds an IDEA-style Git panel next to the DSH session input area, using chips + panel to cover branches, changes, history, diffs, and common sync operations, aligned with worktree awareness, while maintaining the “zero model tool” boundary. For installation instructions and complete behavioral details, refer to the GitHub README: https://github.com/mays-hi/dsh-git-idea; Community index: https://www.skillhub.cn/plugins/mays-hi/dsh-git-idea.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye