Introduction

When running DSH agents in WSL, a specific issue arises: the agent’s shell and file view are typically on the Linux side, while the files, programs, or actions to be processed may be located on the Windows side.

For instance, reading text files under C:\..., executing Windows programs, opening files or folders with default programs, listing Windows drives, and converting paths between C:\... and /mnt/c/.... dsh-wsl-bridge organizes these operations into a set of DSH tool interfaces, reducing the burden of repeatedly concatenating cmd, powershell, and wslpath in agent prompts or scripts.

What is this

dsh-wsl-bridge is a DSH (DeepSeek Harness) plugin. The repository path is ch1bug/dsh-wsl-bridge, and the package name in package.json is dsh-wsl-bridge.

It provides capabilities such as listing Windows directories, reading text files, writing UTF-8 text, executing Windows programs, opening with default programs, path conversion, and listing drives for agents running in WSL that need to access the Windows host. The README describes it as a Cordis plugin, with an MIT license.

Core Tools

The verified tools include:

  • win_ls: List Windows directories. Accepts C:\... or /mnt/c/... forms.
  • win_read: Read Windows text files. Supports utf8 / gbk, and line offset/limit.
  • win_write: Write UTF-8 text to Windows files. Creates parent directories.
  • win_run: Run Windows programs. Can use cmd, powershell, or direct interop.
  • win_open: Open files or folders with default Windows handlers.
  • win_path: Convert paths between C:\... and /mnt/c/.... Uses wslpath.
  • win_drives: List mounted Windows drives.

Additionally, if codebase-memory-mcp is installed in the environment, the following can be enabled:

  • codebase_search: Knowledge graph-based code retrieval.
  • codebase_arch: Knowledge graph-based code retrieval.

These two tools depend on external binaries. If not installed, the relevant tools will error out.

Installation and Usage

Two conditions must be met before installation:

  1. WSL has Windows interop enabled, and cmd.exe, powershell.exe, wslpath, explorer.exe are reachable. The README states this is typically available in WSL1/WSL2.
  2. The DSH host possesses shell and sandboxPolicy services.

Install using the DSH plugin command:

dsh plugin --profile web add /path/to/dsh-wsl-bridge

After installation, restart dsh web, and the tools will be automatically mounted.

The package.json declares @deepseek-ai/dsh-tools as peerDependencies:

{
  "peerDependencies": {
    "@deepseek-ai/dsh-tools": "*"
  }
}

To enable codebase-memory related tools, you can set CODEBASE_MEMORY_BIN. The default path is:

/usr/local/bin/codebase-memory-mcp

Typical Usage

The following describes usage by tool. Specific parameters depend on the DSH tool invocation interface and plugin implementation.

  1. View a directory

Call win_ls, passing a Windows directory path. The path can be:

   C:\Users\me

Or it can be:

   /mnt/c/Users/me
  1. Read a text file

Call win_read, specifying the encoding as utf8 or gbk. If you need to read only specific lines, you can use line offset/limit.

  1. Write a text file

Call win_write to write UTF-8 text. This tool creates the parent directories required for the target file.

  1. Run a Windows program

Call win_run, choosing to execute via cmd, powershell, or direct interop. The README notes that it writes temporary .bat / .ps1 files to:

   C:\Windows\Temp

and cleans up these temporary files after execution.

  1. Open a file or folder

Call win_open to open the target file or folder using the default Windows handler.

  1. Convert paths

Call win_path to convert between C:\... and /mnt/c/.... It uses wslpath underneath.

  1. List drives

Call win_drives to list mounted Windows drives.

  1. Use optional code retrieval

If codebase-memory-mcp is installed, you can call codebase_search and codebase_arch. If not installed, these tools will error out. If you need to customize the binary path, set:

   CODEBASE_MEMORY_BIN=/usr/local/bin/codebase-memory-mcp

Use Cases and Considerations

Suitable for the following scenarios:

  • DSH agents running in WSL but needing to read, write, or list files on the Windows side.
  • Agents needing to execute Windows programs, rather than just operating on Linux-side processes.
  • Need to convert between Linux path form (e.g., /mnt/c/...) and Windows drive path form (e.g., C:\...).
  • Need to call default Windows programs to open files or folders.

Notes:

  • These tools access Windows side resources and execute via DSH host services. Before installing, it is recommended to consider the plugin as providing capabilities running with the current DSH process permissions, and to review the source code, dependencies, and MIT license first.
  • The sandbox policy for the current session is applied on every call.
  • win_run creates script files in the Windows temp directory and relies on cleanup after execution.
  • codebase_search and codebase_arch are not independently available by default and depend on codebase-memory-mcp.
  • This plugin does not replace a full Windows automation framework; it provides a set of Windows access tools callable by DSH agents.

Links

  • GitHub: https://github.com/ch1bug/dsh-wsl-bridge
  • Plugin directory: Please search for dsh-wsl-bridge in the DSH plugin directory site you are using; this article does not provide a fixed directory page URL.