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. AcceptsC:\...or/mnt/c/...forms.win_read: Read Windows text files. Supportsutf8/gbk, and line offset/limit.win_write: Write UTF-8 text to Windows files. Creates parent directories.win_run: Run Windows programs. Can usecmd,powershell, or direct interop.win_open: Open files or folders with default Windows handlers.win_path: Convert paths betweenC:\...and/mnt/c/.... Useswslpath.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:
- WSL has Windows interop enabled, and
cmd.exe,powershell.exe,wslpath,explorer.exeare reachable. The README states this is typically available in WSL1/WSL2. - The DSH host possesses
shellandsandboxPolicyservices.
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.
- 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
- 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.
- Write a text file
Call win_write to write UTF-8 text. This tool creates the parent directories required for the target file.
- 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.
- Open a file or folder
Call win_open to open the target file or folder using the default Windows handler.
- Convert paths
Call win_path to convert between C:\... and /mnt/c/.... It uses wslpath underneath.
- List drives
Call win_drives to list mounted Windows drives.
- 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_runcreates script files in the Windows temp directory and relies on cleanup after execution.codebase_searchandcodebase_archare not independently available by default and depend oncodebase-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-bridgein the DSH plugin directory site you are using; this article does not provide a fixed directory page URL.