Introduction¶
In the Windows usage scenarios of DSH (DeepSeek Harness), the shell tool surface is often a specific pain point: the agent might need to execute bash-style commands, but the currently active shell might be pwsh; if both bash and pwsh are exposed in the tool surface, both prompt engineering and tool selection become more complex.
dsh-windows-shell-policy addresses this point by converging the logic: it detects local availability of git-bash/MSYS2/Cygwin, provides a “Default Shell” collapsible card in “Settings → Plugins → Plugin Config” supporting Auto / bash / pwsh three-way selection; when the policy is bash, it dynamically registers the bash tool and trims the prompt tool surface, ensuring the agent faces only one shell tool.
Overview¶
- Plugin Name:
dsh-windows-shell-policy - Maintainer:
LAN-TINA-WS - Version:
0.0.5(package.json) - License: MIT
- GitHub: https://github.com/LAN-TINA-WS/dsh-windows-shell-policy
One-sentence positioning: It is the DeepSeek Harness (DSH) Windows default shell policy plugin, used to detect bash, switch between bash/pwsh, register bash tools, and control the shell tool surface visible to the agent on Windows.
Core Capabilities¶
Shell Detection¶
The plugin detects available bash in the following order:
- Explicit
bashPath - Git common installation paths (Program Files / x86)
- MSYS2 / Cygwin
PATH
Use it immediately upon detection.
Configuration Card¶
In “Settings → Plugins → Plugin Config”, the plugin provides a “Default Shell” collapsible card. The card displays the detection status and the currently active shell, and supports three-way selection:
- Auto
- bash
- pwsh
Policy Behavior¶
The policy behavior is as follows:
auto: Detects bash and uses it; otherwise, uses pwsh.bash: Forces the use of bash; if bash is not detected, it falls back to pwsh and warns.pwsh: Forces the use of pwsh.
Changes take effect on the next request after saving.
Bash Tool Registration¶
When effective=bash, the plugin dynamically registers the bash tool and executes it using the subprocess channel, supporting timeouts, output truncation, and exit code marking.
Prompt Tool Surface Trimming¶
The plugin hides pwsh/bash in system-prompt/assemble according to the policy, keeping only one shell tool in the agent’s tool surface.
Persistence¶
preferred is persisted in the shell-policy section of the settings document and remains after restart.
Clean Uninstall¶
You can uninstall using:
dsh plugin --profile web remove
Or in a development environment:
dev_uninject_plugin <本目录>
This completes tool unregistration, prompt restoration, and junction cleanup.
Installation and Activation¶
GitHub Direct Install¶
The following command adds the plugin from GitHub:
dsh plugin --profile web add github:LAN-TINA-WS/dsh-windows-shell-policy
After installation, restart dsh web, open “Settings → Plugins → Plugin Config” to start configuration.
npm Install¶
The following command adds the plugin from npm:
dsh plugin --profile web add dsh-windows-shell-policy
Then open “Settings → Plugins → Plugin Config” to start configuration.
Release ZIP Install¶
First, download dsh-windows-shell-policy-v*.zip and unzip it, then install using the unzipped directory:
dsh plugin --profile web add link:<解压目录>
After restarting dsh web, enter “Settings → Plugins → Plugin Config”.
Development Environment Injector Install¶
The following command first builds the plugin artifacts:
DSH_CHECKOUT=<checkout> bash scripts/build.sh
After generating lib/index.js and lib/client.js, inject the current directory:
dev_inject_plugin <本目录>
Typical Usage¶
Selecting Default Shell¶
- Open “Settings → Plugins → Plugin Config”.
- Expand the “Default Shell” card.
- Select Auto, bash, or pwsh.
- Save; the switch takes effect on the next request.
Configuring Explicit Bash Path¶
When you need to specify the bash executable file path, you can configure shell-policy.bashPath in settings.yaml. UI editing is planned; currently, it can be set via the configuration file.
shell-policy:
bashPath: <本机 bash 可执行文件路径>
After configuration, the plugin will prioritize reading the explicit bashPath according to the detection order.
Runtime Dependencies¶
The peerDependencies declared by the plugin are as follows:
@deepseek-ai/dsh-llm >=0.0.1-rc <2
@deepseek-ai/dsh-tools >=0.0.1-rc <2
@deepseek-ai/dsh-subprocess >=0.0.1-rc <2
@deepseek-ai/dsh-settings >=0.0.1-rc <2
@deepseek-ai/dsh-sandbox >=0.0.1-rc <2
@deepseek-ai/dsh-sandbox-policy >=0.0.1-rc <2
@deepseek-ai/dsh-jobs >=0.0.1-rc <2
cordis >=4.0.0-rc <5
schemastery ^3.18.0
@deepseek-ai/dsh-client-ui-slots >=0.0.1-rc <2
Use Cases and Notes¶
Who is this for:
- Using DSH web on Windows.
- Wanting the agent to use bash when executing shell commands, or desiring a stable, single shell tool exposure.
- Needing to switch between bash/pwsh according to a policy with configuration persistence after restart.
- Needing to restore tool registration and prompt state after uninstallation.
Notes:
- The plugin runs with the current dsh process permissions; check the source code and license before installing.
- Changes to the shell take effect on the next request after saving.
- When explicitly set to bash, if bash is not detected, it will fall back to pwsh and warn.
- UI editing for
shell-policy.bashPathis planned. - The community directory is an independent site with no official affiliation with DeepSeek or Huanfang; do not interpret it as an official app store.
Conclusion¶
dsh-windows-shell-policy turns Windows shell selection into a detectable, configurable, persistent, and restorable policy item: it provides bash detection, a default shell card, bash tool registration, prompt tool surface trimming, and restoration after uninstallation.
- GitHub Repository: https://github.com/LAN-TINA-WS/dsh-windows-shell-policy
- Feedback Issues: https://github.com/LAN-TINA-WS/dsh-windows-shell-policy/issues/1
- Community Directory Page: URL not provided in verified materials.