dsh-git-change: Show a Git Status Badge in the DSH Input Box

DSH (DeepSeek Harness) adopts a plugin-based architecture, allowing developers to extend functionality as needed. When developing agents or debugging code, developers often need to check the current branch’s changes. The dsh-git-change plugin solves this by showing a badge in the top-right corner of the interface, so the status can be checked without leaving the input box.

The plugin is maintained by melo7up, currently has 4 stars, and is open-sourced under the MIT License.

Core Features

The plugin primarily displays a badge to the right of DSH’s input toolbar and to the left of the model selector.

  • Display Logic:
    • If the current workspace is not in a Git repository, the icon is not rendered.
    • By default, it shows a 14px gray branch icon without a circular background.
    • On hover, a tooltip pops up above, showing the branch name, changed file count, and added/deleted line counts (green/red).
  • Counting Scope:
    • It counts commits made on the current branch that have not been pushed (calculated as net diff).
    • It counts staged and unstaged files in the workspace.
    • It counts untracked files (entire file line counts are added to added lines).
  • Exclusion Rules:
    • Ignores commits pulled from others via git pull.
    • Ignores content brought in by merges.
    • If there is no upstream (e.g., a fresh git init or detached HEAD), only the workspace is counted.
  • Refresh Mechanism:
    • Refreshes automatically on mount, session state changes, and hover.
    • Failed requests are retried automatically.

Installation and Activation

The installation process consists of two steps: configuring the local dependency path and mounting it to the profile.

  1. Edit profile/package.json and add the dependency and bundle configuration:
    {
      "dependencies": {
        "dsh-git-change": "link:/absolute/path/to/dsh-git-change"
      },
      "dsh": {
        "profile": {
          "bundles": [ ..., "dsh-git-change" ]
        }
      }
    }
*Note: Local development typically uses a `link:/...` path.*
  1. Enter the profile directory and run the install command to create a symbolic link and write the lockfile:
    cd ~/.dsh/profiles/desktop && pnpm install
  1. Restart DSH. Configuration is assembled only at startup, and the running host caches modules; code changes require a restart to take effect.

Typical Usage

After installation and restart, the plugin is enabled automatically. To verify the installation or debug it, use the provided verification scripts:

  • Verify the client:
    node tools/verify-client.mjs
  • Verify the host:
    node tools/verify-host.mjs

Notes and Limitations

  • Positional Drift: The badge is positioned at conversation.input.right. Affected by the model name length, it may drift horizontally beside the model selector (the longer the model name, the further left the badge appears).
  • Counting Limit: Untracked file counting has a limit (up to 200 files or 1 MB per file); if the limit is exceeded or the operation times out, it displays “Statistics truncated.”
  • Non-Live Sessions: In historical or archived sessions, the badge is not displayed because the header cannot be obtained.
  • Permission Mode: The plugin runs in read-only mode and sets GIT_OPTIONAL_LOCKS=0, GIT_TERMINAL_PROMPT=0, and LC_ALL=C.
  • No Build Step: Client code must be loaded directly by calling window.__ModuleLoader__.load, without going through a bundler.

Conclusion

dsh-git-change provides lightweight Git status feedback, helping developers more intuitively grasp the current branch’s changes. To view the source code or file an issue, visit the GitHub repository.

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

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

Xiaoye