Foreword

In the plugin-based extensions of DSH, the shell environment on Windows affects the details of command execution. dsh-plugin-git-bash addresses a specific issue: it enables DeepSeek Harness (DSH) to use Git for Windows Bash by default on Windows while preserving DSH’s original permission semantics of read-only, workspace-write, and danger-full-access.

This plugin is maintained by inmny, with the npm package named dsh-plugin-git-bash, the GitHub repository as dsh-git-bash, and it is licensed under MIT.

What This Is

dsh-plugin-git-bash is a bundle layer installed into the DSH profile to switch DSH’s default shell on Windows to Git for Windows Bash.

After installing the plugin into the profile, the standard, code, cordis, and minimal presets will use Git Bash instead of PowerShell. The foreground commands, background commands, and Web Agent presets share the same executor.

It is installed only as a bundle layer into the target profile and does not modify the DSH installation directory.

Core Features

The following outlines the capabilities that the plugin has explicitly supported.

  • Makes DSH default to Git for Windows Bash on Windows.
  • Preserves DSH’s read-only, workspace-write, and danger-full-access permission semantics.
  • After installation into the profile, the standard, code, cordis, and minimal presets use Git Bash instead of PowerShell.
  • Foreground commands, background commands, and Web Agent presets share the same executor.
  • Automatically detects Git Bash in Program Files, user installation directories, and Scoop, and supports manual configuration of the bash.exe path.
  • In the Web GUI, you can expand the Bash tool row to view command, cwd, stdout/stderr, and exit status.
  • The npm package includes precompiled msys-token-guard.exe and msys-token-guard-hook.dll for win32-x64.

Installation and Enabling

Runtime requirements:

  • Windows x64
  • Node.js 24 or higher
  • DSH 0.1.0-rc.7
  • Git for Windows x64

First, install a fixed version to the Web profile:

dsh plugin --profile web add dsh-plugin-git-bash@0.3.1

After installation, restart dsh web to allow both the Host and browser client to load the new version, then create a new session.

When installing the latest version, you can omit the version number:

dsh plugin --profile web add dsh-plugin-git-bash

When developing a local version, pass in the checkout path:

dsh plugin --profile web add C:\path\to\dsh-git-bash

Verifying the Shell

After creating a new session, run the following command to confirm that the current shell is indeed a Git Bash environment:

printf 'shell=%s\nversion=%s\nmsystem=%s\n' "$BASH" "$BASH_VERSION" "$MSYSTEM"

Here, MSYSTEM should be MINGW64 or MINGW32.

In the Web GUI, you can also expand the Bash tool row to view the command, cwd, stdout/stderr, and exit status of that command execution.

Configuring the bash.exe Path

The plugin automatically detects Git Bash in Program Files, user installation directories, and Scoop.

For scenarios without a GUI, you can set DSH_GIT_BASH_PATH before starting DSH:

$env:DSH_GIT_BASH_PATH = 'D:\Apps\Git\bin\bash.exe'
dsh web

Alternatively, you can configure the executable for the provider in the profile’s cordis.patch.yml:

- id: git-bash-shell
  name: dsh-plugin-git-bash
  config:
    executable: D:\Apps\Git\bin\bash.exe

Permission Modes

read-only and workspace-write

In restricted mode, the DSH Windows ACL sandbox creates a WRITE_RESTRICTED token. The plugin runs the native guard first inside the sandbox, and then the guard launches Git Bash:

DSH ACL runner -> msys-token-guard.exe -> bash.exe -> child processes

Specific semantics are:

  • read-only can start Git Bash but cannot write to the workspace.
  • workspace-write can only write to the DSH-authorized workspace and private temp.

danger-full-access

danger-full-access does not go through the native guard and directly runs Git Bash, consistent with the execution method in plugin version 0.1.x.

Platform Support and Limitations

The npm package includes precompiled msys-token-guard.exe and msys-token-guard-hook.dll; normal installation does not require Visual Studio or CMake.

Currently, the native guard only supports win32-x64. Other architectures in restricted mode will return SANDBOX_UNAVAILABLE and will not degrade to unisolated execution.

Microsoft Detours 4.0.1 source code is stored under the MIT license in native/vendor/detours, and the license text is distributed with the npm package. Due to Detours’ use of the Windows ANSI API for the DLL path parameter, the plugin installation path must be representable without loss by the current system code page and must not exceed MAX_PATH; if these conditions are not met, the guard will fail closed.

Use Cases and Considerations

This plugin is suitable for the following scenarios:

  • Needing to unify DSH’s default shell on Windows to Git Bash.
  • Needing to preserve DSH’s read-only, workspace-write, and danger-full-access permission semantics.
  • Needing to view the execution details of Bash commands in the Web GUI.

Before installation, note the following:

  • The plugin ultimately runs within the system privileges obtained by the DSH process; before installation, you should inspect the source code, license, and dependencies.
  • Currently, the native guard only supports win32-x64.
  • The installation path must meet the code page requirements of the Windows ANSI API and the MAX_PATH limit.
  • danger-full-access does not go through the native guard and directly runs Git Bash; before use, you should be clear about the scope of this permission.

Closing

The value of dsh-plugin-git-bash is quite specific: it switches DSH’s default shell on Windows to Git for Windows Bash, while preserving DSH’s permission semantics, and maintains the sandbox isolation path under restricted mode through the native guard.

GitHub: https://github.com/inmny/dsh-git-bash

The directory page link has not been verified in confirmed materials, and this article does not provide a specific address; if the community directory includes it, you can search for dsh-plugin-git-bash. The community directory is an independent site and has no official affiliation with DeepSeek /幻方.