Introduction

DeepSeek Harness (DSH) is a framework for building agents. In real-world development, when an agent runs in a WSL or Linux environment and needs to manipulate native Windows Git repositories or directly invoke Windows executable files, it usually faces the complexity of cross-system interaction.

dsh-plugin-gitbash solves this problem. It allows DSH to execute commands in the host machine’s Git for Windows Bash environment, without frequently switching sessions between Windows and WSL.

Plugin Positioning

This is a self-contained, zero-dependency Cordis plugin. It registers a model tool named gitbash. The plugin itself does not depend on external runtimes and uses only Node.js built-in modules.

Core Features

  • Direct Windows Git Bash invocation: Execute Windows-side commands directly within a DSH session.
  • Zero dependencies: No additional system dependencies are required; it is loaded only as a Cordis plugin.
  • Automatic path detection: The plugin is WSL aware and can automatically detect the installation path of Git Bash.
  • Stateless design: Each invocation starts a new process and does not retain working directory or environment variable state.

Installation and Enablement

Installing the plugin requires DSH’s profile command. After installation, the profile must be restarted for the changes to take effect.

dsh plugin --profile <name> add dsh-plugin-gitbash

After installation is complete, restart the profile (via dsh web or dsh --profile <name>) to load the gitbash tool.

If you need to install it manually before publishing to npm, you can use the GitHub URL:

dsh plugin --profile <name> add https://github.com/Jinsight-gif/dsh-plugin-gitbash

Configuration Reference

The plugin’s configuration options are located in the configuration table of the bundle row or agent preset.

Configuration Type Default Description
gitBashPath string - Explicitly specifies the path to bash.exe. The plugin trusts this path directly and does not perform detection.
autoDetect boolean true Whether to automatically search common installation locations when gitBashPath is not set.
timeoutMs number 120000 Timeout duration (in milliseconds) for a single command invocation.
maxOutputChars number 65536 Captured stdout/stderr output is truncated to this number of characters to prevent excessively large streams.

Path resolution order:
1. Config item config.gitBashPath
2. Environment variable DSH_GITBASH_PATH
3. Automatic detection (only takes effect when autoDetect: true)

Typical Usage

When using this plugin, you can specify the location of Git Bash by configuring an explicit path or environment variable.

Method 1: Configure an explicit path

- id: tool-gitbash
  name: 'dsh-plugin-gitbash'
  config:
    gitBashPath: '/mnt/e/Program Files/Git/bin/bash.exe'

Method 2: Use an environment variable

export DSH_GITBASH_PATH='/mnt/e/Program Files/Git/bin/bash.exe'

Use Cases and Notes

  • Use cases: Run DSH in a WSL or Linux environment while needing to work with native Windows Git repositories (using the Windows version of the git command), execute Windows executable files (.exe), or use native Windows paths (such as D:\... or /d/...).
  • Path semantics: This is a key point. The command is executed in Windows Git Bash, so you must use Windows paths (such as /d/tools or D:/tools). WSL /mnt/... paths are invalid inside the command.
  • Working directory: The workdir parameter is mapped and supports formats such as /mnt/X/..., /X/..., or X:\.... If a WSL-only path that cannot be mapped is passed (such as /home/...), the invocation starts in the session working directory instead of reporting an error.
  • Stateless: Each invocation is a new process; cwd, environment variables, and shell functions are not retained between invocations. If chained operations are needed, complete them within the same command (for example, cd /d/tools && git status).

Conclusion

dsh-plugin-gitbash provides the ability to seamlessly invoke Windows Git Bash in a DSH environment, making it suitable for developers who need to manipulate the Windows file system from a Linux/WSL environment.

For more details and source code, visit: GitHub repository