dsh-git-statusline: View Compact Git Status in DSH Web Sidebar

Preface

When developing agents with DSH, the current session is often bound to a working directory. Branch names, staged/unstaged changes, and ahead/behind upstream information are scattered across terminals or IDEs, and may not be immediately visible when switching back to the web interface. Below is a community plugin dsh-git-statusline (maintainer pinzza, category: client): it displays a compact one-line Git workspace and upstream status within the DSH Web UI, with the display position configurable in settings. The design references ccstatusline-zh’s Git widgets and is suitable for DSH 0.2.x users who want a persistent Git summary in the browser.

What This Is

dsh-git-statusline is a pure JavaScript client plugin for DSH Web. It renders Git status into a sidebar footer, next to the session title, or above/below the dialog box via DSH slots. Sessions that are not in Git repositories will be hidden by design; when there is no upstream, it will not give a wrong “pushed” conclusion, and the hover tooltip will indicate that it cannot determine the status.

  • Directory page: https://www.skillhub.cn/plugins/pinzza/dsh-git-statusline
  • Source and documentation: https://github.com/pinzza/dsh-git-statusline
  • Version in current materials: 0.2.1 (MIT License)

Display Content and Format

A typical one-line format looks like:

main (+16,-2) ↑2 ↓1

Meanings (consistent with the README):

  • (+16,-2): Added/deleted lines of text changes that are staged and unstaged.
  • ↑2: Number of commits to be pushed from the current branch relative to upstream.
  • ↓1: Number of commits to be pulled from the current branch relative to upstream.
  • ✓: The workspace is clean, and there are no commits ahead of or behind upstream.

The plugin polls every 5 seconds and refreshes immediately when the window regains focus; only one request is in progress at a time (client-side concurrent deduplication). Git commands are all read-only, and GIT_OPTIONAL_LOCKS=0 is set. The server first pre-checks using the mtime of .git/HEAD and .git/index; if the workspace is unchanged, it hits the cache and does not spawn a git process; on Windows mounted paths (such as WSL’s /mnt/*), there are additional timeout and result cache strategies, see the repository README for details.

Display Position

In DSH, open: Settings → Git Status Line → Display Position. The option is saved in the browser’s localStorage (key dsh-git-statusline:config), and the change takes effect immediately without restarting DSH.

Position Description
Sidebar footer (default) One line in the sidebar; when collapsed to a 56px rail, it degenerates to ↑ / ↓ / ± / ✓ single characters
After the top session title A small chip inside the title bar
Above the dialog A chip above the input box, occupying a full line
Below the dialog Plain text within the status line below the input box (on the same line as usage statistics, etc., due to limited bandwidth, it is borderless plain text)
Do not display Do not register slots and do not send requests

If you care about the layout of the line below the dialog, the README suggests prioritizing “After the top session title”.

Compatibility with DSH Versions

Requires DSH >=0.2.0-rc.1 <0.3.0 (plugin from 0.2.1). When DSH starts, it verifies whether the plugin’s @deepseek-ai/dsh* peer in package.json covers the current runtime; if not, it will print skipping profile bundle and silently skip the entire plugin, with no error on the interface.

DSH version line Available plugin versions
>=0.2.0-rc.1 <0.3.0 From 0.2.1
0.1.x 0.2.0 (will be skipped on 0.2.x)

Installation and Enablement

The plugin’s pre-built code is in the repository’s lib/, no build step is required. The following commands are marked in the README as tested on DSH 0.2.0-rc.1 + pnpm 11.21.0.

Install directly from GitHub (recommended):

dsh plugin --profile web add github:pinzza/dsh-git-statusline

Install from Release pre-built tarball (equivalent to the above method, can be offline):

curl -L -o dsh-git-statusline.tgz \
  https://github.com/pinzza/dsh-git-statusline/releases/latest/download/dsh-git-statusline.tgz
dsh plugin --profile web add ./dsh-git-statusline.tgz

To pin a version, the URL can be changed to a tag-pinned form, e.g., .../releases/download/v0.2.1/dsh-git-statusline.tgz.

After installation, restart dsh web; if the Web is managed by another process, restart that process and refresh http://127.0.0.1:3080.

Verify if the plugin layer is loaded:

dsh --profile web --dump-config | grep -A2 dsh-git-statusline

You should see # == dsh-git-statusline. If dsh: skipping profile bundle "dsh-git-statusline" also appears, it means the peer does not match the current DSH, and you need to upgrade the plugin or adjust the DSH version according to the compatibility table.

Uninstall:

dsh plugin --profile web remove dsh-git-statusline

Troubleshooting When Not Displayed

The order given by the README:

  1. Is the plugin layer skipped: Run the above dump-config | grep, if # == dsh-git-statusline is not visible or skipping profile bundle appears → peer incompatibility (common after upgrading DSH).
  2. The current session’s working directory is not a git repository (isRepo=false, the plugin is hidden).
  3. The display position is set to “Do not display”.

If there is no POST /git-statusline/status in the browser’s Network, it is mostly ① or ③; if there is a request but no rendering, it is mostly ②.

Applicable Scenarios and Notes

  • Suitable for: Users developing in the DSH 0.2.x Web, who want to see the branch and upstream summary without switching to the terminal frequently.
  • Permissions and Security: The plugin runs with the current dsh process and performs read-only Git queries through the server; before installation, please check the source code and MIT license yourself to ensure it meets your environment policies. The DSH community directory (such as SkillHub) is an independent ecosystem site and has no official affiliation with DeepSeek / HuanFang.
  • 0.1.x DSH: Should use plugin v0.2.0 or earlier tags, do not mistakenly use old peer packages on 0.2.x.

In the repository, you can run node --test to execute 8 tests (4 Git parsing + 4 compatibility regressions).

Conclusion

dsh-git-statusline compresses Git branch, line-level change summary, and upstream ahead/behind status into a one-line status configurable in the Web UI, and has caching and pre-checks for polling and slow file systems. For installation commands and performance details, please refer to the GitHub README.

  • Plugin directory: https://www.skillhub.cn/plugins/pinzza/dsh-git-statusline
  • Repository: https://github.com/pinzza/dsh-git-statusline
羽毛球分组比赛记分
小程序二维码

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

Xiaoye