Introduction¶
In the DeepSeek Harness (DSH) web environment, a session usually corresponds to a specific workspace directory. When a project is managed with Git, developers often need to switch between local branches. Manually running the git checkout command interrupts the workflow, and operating in the web interface is not intuitive enough. The dsh-git-branch-switcher plugin provides branch capsules directly in the session header, integrating Git operations into the DSH UI.
What Is This¶
This is a DeepSeek Harness (DSH) web client plugin maintained by mixin-ai. It displays a capsule button in the session header, allowing users to view and switch the current Git branch directly in the DSH interface without frequently jumping between the terminal and the interface.
Core Features¶
- Branch Capsule Display: Displays the current Git branch in the upper-right corner of the session header (only shown in Git-managed workspaces).
- Branch Switching: Clicking the capsule opens a branch panel; the current branch is highlighted with ✓ in the list, and clicking any branch executes
git checkout. - Status Synchronization: Supports the
detached HEADstate and displays the short commit hash; automatically refreshes every 30 seconds and supports manual refresh with the ↻ button. - Error Feedback: If switching fails (e.g., due to local conflicting changes), the raw Git error message is displayed.
- Themes and Security: All colors use
--dsw-*theme tokens and support light/dark modes; Git commands are executed under the same sandbox policy as the session Shell.
Installation and Activation¶
Run the following command to install the plugin into the web profile:
dsh plugin --profile web add "github:mixin-ai/dsh-git-branch-switcher#main"
After installation, restart the web profile to load the plugin:
dsh --profile web
Typical Usage¶
- Open a session whose workspace is a Git repository.
- Click the branch capsule in the upper-right corner of the session header.
- Select the target branch in the pop-up panel to switch to it.
- To synchronize the latest state immediately, click the ↻ button in the panel to reload the branch list.
Applicable Scenarios and Notes¶
- Applicable Scope: The plugin shows the branch capsule only in Git-managed workspaces.
- Version Requirement: Requires Node.js version
^22.19.0or>=24.0.0. - Security: The plugin executes Git commands through the
shellservice and follows the same sandbox policy as the session Shell. Branch names are escaped with single quotes and control characters are rejected to prevent command injection.
Brief Conclusion¶
By pushing Git operations into the session header, this plugin reduces the operational cost of branch switching in the web environment, making it suitable for developers who frequently switch code branches in DSH. Plugin details and source code are available at: GitHub.