Introduction

In DeepSeek Harness (DSH) usage scenarios, model agents often need to run Linux commands. The traditional approach is usually to write .sh scripts or pwsh wrappers. The dsh-wsl plugin solves this problem by allowing model agents to run Linux commands directly through wsl.exe, without hand-written scripts. It matches the behavior of native Linux DSH at the command execution level, including a real Linux kernel and bash environment, exit codes and signal handling, timeouts, output truncation, and background job management.

Plugin Introduction

This plugin is a WSL tool plugin for models, designed to simplify the process of executing Linux commands in a Windows environment.

  • Plugin name: dsh-wsl (repository) / dsh-wsl-tool (NPM package name)
  • Maintainer: XINY11451
  • Category: Online tool
  • Open-source license: MIT

Installation

Install it through the DSH plugin manager:

dsh plugin add --profile <profile> dsh-wsl-tool

After installation, the plugin automatically registers tool-wsl when the Bundle is loaded. Do not manually list tool-wsl in a preset, because DSH has already registered the tool globally, and duplicate registration will cause an error.

Core Features

The plugin registers three tools, used respectively for command execution, path conversion, and environment probing.

1. wsl: Run Linux commands

Executes commands by calling wsl.exe. The default behavior is equivalent to running directly in WSL.

  • Command format: wsl.exe [-d <distro>] -e bash -lc "cd <workdir> && <command>"
  • Returned content: Includes stdout, stderr, as well as exit code, timeout, or truncation markers.
  • Long script support: If the command length exceeds the Windows command-line limit (32767 characters), the content is passed to wsl.exe through stdin to avoid truncation.
  • Background jobs: Setting runInBackground: true runs the command as a background task and returns a task ID. It must be used together with the @deepseek-ai/dsh-tool-jobs preset.

2. wsl-path: Path conversion

Uses the wslpath tool to convert between Windows and WSL paths.

  • Automatic detection: Automatically determines the conversion direction based on the path format.
  • Manual specification: Force the direction with direction: 'win' | 'linux'.
  • Example: C:\Users\me\a.txt -> /mnt/c/Users/me/a.txt

3. wsl-env: Environment summary

Detects and returns detailed information about the WSL environment, helping the agent assess environment capabilities before execution.

  • Information items: Distro list, kernel version, architecture, CPU core count, memory and disk usage, systemd status, Docker installation status, GPU passthrough status, mounted drives, and so on.
  • Fault tolerance: Undetected items are shown as empty or a specific status (e.g., docker: not installed).

Typical Usage

Execute Linux commands

wsl command: "echo hello"

After execution, it returns a result such as [exit code: 0].

Convert a path

wsl-path C:\Users\me\project

Returns: /mnt/c/Users/me/project

Get environment information

wsl-env

Returns a summary including kernel version, CPU core count, memory status, drive mount points, and other information.

Notes and Limitations

  1. Sandbox restrictions: wsl calls run under the DSH sandbox. This means file policies cannot restrict execution of this plugin, and you must rely on system-level permission controls.
  2. Filesystem semantics: If the project is on a Windows drive (such as C: or D:), the filesystem retains Windows semantics. This includes case insensitivity, no POSIX permissions, no file change notifications, and slower access speed.
  3. Background job dependency: When using background jobs, you must include @deepseek-ai/dsh-tool-jobs in the preset Composition, otherwise the call will fail.
  4. Registration conflict: As mentioned earlier, do not manually register tool-wsl in a preset, otherwise you will get the error tool "wsl" is already registered in this scope.

Conclusion

dsh-wsl provides native Linux command execution capabilities for DeepSeek Harness. By calling wsl.exe directly, it reduces the developer’s effort in writing script wrappers and provides standardized environment probing capabilities. When using it, be aware that it runs under the DSH sandbox and that filesystem restrictions on Windows drives apply.

  • Directory page: https://www.skillhub.cn/plugins/XINY11451/dsh-wsl
  • GitHub repository: https://github.com/XINY11451/dsh-wsl