@xbzbing/dsh-git-panel: IDE-style Git Panel in DSH Web GUI

Introduction

When using DSH for local development or repository maintenance, it is common to want Git status, commit history, uncommitted changes, and diff review right at hand. In the past, these operations often required switching to a terminal or opening another IDE window.

@xbzbing/dsh-git-panel is a DSH Web GUI plugin that provides an IDE-style Git panel in the conversation workspace, supporting branch and commit history overview, committing and amending uncommitted changes, diff statistics, and a zsh-style branch marker on the left side of the input box. The plugin is maintained by xbzbing and licensed under MIT.

What This Is

This is a client-side plugin for the DSH Web GUI, with the objective of bringing common Git viewing and commit operations into the current session’s workspace.

It is suitable for people who want to do the following in one place:

  • View branches, tags, and commit history.
  • View changed files and diffs for a commit.
  • Manage uncommitted changes in the current workspace.
  • Stage, unstage, discard, commit, or amend.
  • Switch branches, create or delete tags, revert or reset commits.
  • Preview workspace files and view code, Markdown, HTML, and images.
  • See the current repository name and branch status near the input box.

The plugin works with the Git repository in the current workspace. If git is not installed, or the current directory is not a Git repository, only file browsing is available, with the current working directory as the root.

Core Features

Git Overview

The panel provides a branch and tag list, and a searchable commit history graph. After selecting a commit, you can view the corresponding changed file tree and commit message.

The commit history graph supports searching by commit message, commit hash, author, and date. Clicking a changed file allows you to view the diff for that file in this commit.

Change Records

The change records page handles changes in the current workspace that have not yet been committed.

Supported operations include:

  • Staging, unstaging, or discarding on a per-file basis.
  • Batch discarding selected changes.
  • Manual commit.
  • Amending the current commit.
  • Creating, applying, popping, or dropping a stash.
  • Viewing file counts and added/deleted line statistics.

These operations target local repository state and do not automatically trigger a push.

Common Git Operations

The panel also provides some commonly used Git operations:

  • Branch switching.
  • Tag creation and deletion.
  • Commit revert or reset.

These operations only modify the local repository and do not automatically push. Reset-type operations list the changes that will be discarded and require user confirmation.

AI-Generated Commit Messages

The plugin can generate commit messages based on current uncommitted changes and the repository’s existing commit style.

The model can be fixed and selected on the plugin details page. When generating commit messages, the diff content is sent to the provider of the user-selected model. Model calls are performed by the host; the plugin itself does not hold credentials.

Input Box Git Marker

On the left side of the input box, a zsh-style repository name and branch marker is displayed, for example in a form like <repository name> (<branch>).

The marker includes status colors and supports clicking to jump to the Git panel. This marker can be disabled on the plugin details page, or changed to show a status hint next to the Git tab.

File Browsing

The plugin can browse the workspace directory tree within the panel and preview the following file types:

  • Code files.
  • Markdown.
  • HTML.
  • Images.

If the current directory is not a Git repository, file browsing is still available, using the current working directory as the root.

Diff and Source Viewing

The diff viewer supports unified, side-by-side, before, and after views, and provides syntax highlighting, word-level change emphasis, find, and image zoom capabilities.

Source preview is suitable for viewing long files and code structure. For image diffs, zooming and dragging are supported.

Narrow Panel and Mobile Layout

When the panel width is less than or equal to 620px, the plugin switches to a single-column drill-down layout. When the width is restored, it returns to the original multi-column layout.

Shared Workspace Guardrails

When DSH AI and the plugin share the same repository, write operations trigger a modal prompt. The prompt explains that Git operations can be performed directly by the AI.

If an operation encounters .git/index.lock, the plugin automatically retries once and indicates that Git is busy.

Language Support

The plugin UI follows the DSH system language setting and supports Simplified Chinese and English.

Installation and Activation

Install the stable release via the npm package:

dsh plugin --profile web add @xbzbing/dsh-git-panel@latest

This command adds the plugin to DSH’s web profile. After installation or update, the Git panel will appear in the workspace tab bar after the “Conversations” and “Traces” tabs. No service restart or page refresh is required.

Configuration options within the panel, such as the input box marker toggle on the details page and the default diff view, use hot configuration writes and take effect immediately.

If you need to use a pre-release version, it should be installed using the attachment URL from a GitHub Release. Pre-release version numbers include -, appear only in GitHub Releases, and are not published to npm. When a stable release is published, it becomes available on npm and in the stable Release simultaneously.

The documentation explicitly recommends against installing via methods like dsh plugin add github:…; use the npm package or a Release attachment URL instead.

For local development and integration, you can add the plugin to the DSH web profile’s dsh.profile.bundles, point to this directory using a file: dependency, and then run:

node build.mjs

After the build completes, it takes effect. Client-side artifacts can be hot-replaced after being updated; changes on the host side still require a service restart.

Typical Usage

Below is a common local usage flow.

  1. Install the plugin and enter a DSH workspace.

After installation, the Git panel appears in the workspace tab bar.

  1. View repository status.

Open the Git panel to view branches, tags, commit history, and current uncommitted changes.

  1. Review diffs.

Select a commit or an uncommitted file to view the diff content. The diff view supports unified, side-by-side, before, and after modes.

  1. Handle uncommitted changes.

In the change records page, you can stage, unstage, or discard files one by one, or batch discard selected changes.

  1. Commit or amend.

After confirming that the changes are correct, commit manually or amend the current commit.

  1. Generate commit messages.

If needed, generate commit messages based on current uncommitted changes. Note: generation sends the diff content to the provider of the model selected by the user.

  1. Perform common Git operations.

You can switch branches, create or delete tags, revert or reset commits within the panel. These operations only modify the local repository and do not automatically push.

  1. Browse and preview files.

In the file browsing page, view the workspace directory and preview code, Markdown, HTML, or images.

Use Cases and Notes

This plugin is suitable for the following scenarios:

  • Managing a local Git repository using DSH Web GUI.
  • Wanting to view branches, commits, changes, and diffs during a conversation.
  • Wanting to reduce switching back and forth between the terminal and IDE.
  • Needing to complete common operations such as staging, committing, amending, and stashing directly within the workspace.

Before installation, note permissions and data boundaries.

The plugin runs with the current DSH process permissions, so you should review the source code and license before installation. This plugin is licensed under MIT.

Runtime dependencies:

  • The git CLI is required.
  • If git is not installed or the directory is not a Git repository, only file browsing is shown, with the current working directory as the root.

How Git commands are executed:

  • All Git commands are executed via the host subprocess service.
  • argv arrays are used; shell strings are not concatenated.
  • The working directory is locked to the repository root.
  • Timeouts and output limits are applied.
  • The plugin does not modify Git configuration.

Write operation boundaries:

  • Commit, amend, stage, discard, and similar operations all have explicit entry points.
  • The only disk-write action is “discard untracked entries”.
  • Discarding untracked entries deletes workspace files after confirmation.
  • If an entry is itself a Git repository, the entire batch is rejected.

Network boundaries:

  • The plugin itself only makes a request for version hints:
GET https://api.github.com/repos/<owner>/<repo>/releases/latest
  • Operations such as fetch, pull, push, and publish only access the network via Git commands after the user clicks.

AI-generated commit message boundaries:

  • Generating commit messages sends the diff content to the model provider configured in DSH by the user.
  • Model calls are performed by the host.
  • The plugin does not hold credentials.

Where to Get It

Plugin directory page:

https://www.skillhub.cn/plugins/xbzbing/dsh-git-panel

GitHub repository:

https://github.com/xbzbing/dsh-git-panel

The value of @xbzbing/dsh-git-panel lies in bringing Git viewing, change handling, and diff review into DSH’s conversation workspace. For developers who frequently handle local repository changes in DSH, it reduces the cost of switching windows and brings Git operations closer to the current development context.

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

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

Xiaoye