Introduction¶
DeepSeek Harness (DSH) uses a plugin-based architecture, aimed at extending capabilities through plugins. In local development environments, managing Git branches, worktree states, and context is common. dsh-git-workbench aims to resolve cumbersome Git workflow issues by automating session environment selection and context injection.
What Is This¶
This is a DSH Git development workbench plugin. It captures repository state (branch, ahead/behind, worktree status, worktree list, staged, recent commits), asks at session start which branch or worktree to develop in, and switches branches / creates and manages worktrees via the /git command, the git_workbench agent tool, and a settings page.
Core Features¶
- Automatic Git context (read-only): Each session injects the current branch, ahead/behind, worktree status (staged/modified/untracked/conflicts), worktree list, staged list, and recent commits. Non-Git directories remain silent.
- New-session environment selection (skippable): When
autoAskis used, the agent asks once which environment to develop in (stay on the current branch, switch branches, create a new branch, open an existing worktree, or create a new worktree). /gitslash commands: Provides commands for branch switching, merge, branch creation, log, stash management, and more.git_workbenchagent tool: The agent can invoke guarded operations, with the same guardrails as the command line.- Sidebar Git panel (Web): View the workbench overlay, select a workspace, view status, and execute actions in the sidebar.
- Composer Git strip (Web): The input row shows the branch and clean/dirty status, as well as environment selection.
- Merge and cleanup policy (agent rule): After merging into the main branch, asks whether to delete the branch/worktree.
- Guardrails: Blocks branch switching with a dirty tree; removing a dirty worktree requires
--force. By default,allowForceSwitchandallowForceWorktreeRemoveare off.
Installation and Enabling¶
Use the official installation command:
dsh plugin --profile web add dsh-git-workbench
Typical Usage¶
After installation, open a Git repository session, and the Git context will be injected. The following commands can be used for management:
/git status - 注入当前 git 上下文快照
/git switch <branch> - 切换分支
/git merge <target> - 将当前分支合并到目标
/git branch <name> - 创建分支并切换
/git log [N] - 最近提交
/git stash [push|list|pop|drop] - 暂存管理
/git worktree list/add/remove - 工作树管理
Applicable Scenarios and Notes¶
- Worktree management: DSH treats each worktree as an independent workspace/session.
/git worktree add <branch>creates a worktree and prompts opening a new session. - Dirty-tree protection: Switching a dirty-tree branch is blocked; the tool returns
needsDecision(options: stash first / force / cancel). The force option is controlled byallowForceSwitch(default off). - Worktree removal: Removing a worktree does not target the primary worktree or the current session directory; dirty worktrees require
--force. - Dependency requirements: Requires
dsh >= 0.1.0-rc.6andNode >= 22.19.0. - Module import: Do not import
@deepseek-ai/*from external host plugins to avoid duplicate module instances breaking tool dispatch. - Ecosystem context: DSH’s design philosophy is “everything is a plugin.” This plugin is registered in the community catalog at https://www.skillhub.cn/plugins/kaixinbaba/dsh-git-workbench and has no official affiliation with DeepSeek or High-Flyer.
Conclusion¶
This plugin provides DSH users with complete Git development workbench functionality through command-line commands, agent tools, and the Web interface. For more details and source code, visit GitHub.