dsh-git-branch: Read-only display of Git branch in the dialog box toolbar

Preface

DeepSeek Harness (DSH) adopts an “everything is a plugin” architecture. During agent development or interaction, developers often need to confirm which Git branch they are currently on. The dsh-git-branch plugin injects this information directly into the tool row of the chat interface, avoiding disruption to the conversation flow caused by switching windows.

What is this

This is a DSH client plugin used to display the current project’s Git branch in read-only mode within the tool row of the chat interface. When the directory is not a Git repository, nothing is rendered in this area—no placeholders or errors.

  • Plugin Name: hellohupc/dsh-git-branch
  • Maintainer: helloHupc
  • License: MIT

Core Features

  1. Fixed Position: Renders in the tool row of the chat interface, immediately following the permission selector.
    • Layout example: [+ Command] [Permission ▾] [Branch Icon + Branch Name]
  2. Read-only Display: Only displays current branch information; provides no interaction or selection capabilities.
  3. Smart Hiding: Completely hides the component when the directory is not a Git repository, Git is not installed, or the detection times out (5 seconds).
  4. Branch Type Support:
    • Normal Branch: Displays the branch icon and branch name.
    • Detached HEAD: Displays the branch icon and the short hash of the HEAD.
    • Uncommitted Repository: Displays the default branch name.
  5. Zero Polling: No background scheduled polling is performed. Reading is triggered only when the session’s working directory changes, the conversation ends, or the tab becomes visible again.

Installation and Activation

The plugin is provided as a DSH bundle and becomes effective automatically upon installation.

Prerequisites:
* DSH version must be 0.2.0-rc.2 or newer.
* The git executable must be included in the Host process’s PATH environment variable.

Installation Steps:

  1. Open the DSH Web interface.
  2. Navigate to Settings → Plugins.
  3. Click Add Plugin.
  4. Enter the following in the target address bar:
    • Remote repository URL: https://github.com/helloHupc/dsh-git-branch
    • Or the path to the local checkout directory.
  5. Save settings. DSH will automatically load the bundle and register the route.

Typical Usage

Once installed, the Git branch information of the current project is visible in the tool row of the chat interface. This information is obtained by the Host process via route detection and involves no file writing or credential operations.

Use Cases and Notes

  • Use Cases: Developers who need to quickly verify the current working branch; users who wish to keep the conversation interface clean and avoid clutter.
  • Security Description: This plugin exposes repository information via a local HTTP carrier. Route access is restricted by DSH’s Host defense line, allowing access only from loopback addresses or trusted Hosts, and rejecting cross-site requests.
  • Dependency Description: The plugin does not rely on complex build steps or runtime libraries; it only requires git in the system environment.

Conclusion

dsh-git-branch provides a lightweight, low-invasive way to integrate version control information into the DSH conversation interface. It achieves data acquisition through Host route detection, ensuring information real-time accuracy while avoiding the resource consumption caused by polling.

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

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

Xiaoye