Introduction¶
DeepSeek Harness (DSH) adopts a plugin-based architecture. On the Windows platform, the default configuration only provides PowerShell (pwsh) as the command execution shell, with no entry point for Git Bash. This plugin solves the problem of the model being unable to execute commands using Git Bash in the Windows environment by adding a switching panel that allows only one shell tool to be visible to the model at a given time.
Core Capabilities¶
- Shell Switching: Switch the dsh agent’s command execution shell between PowerShell and Git Bash.
- Single Visibility: Only one shell tool is visible to the model at a given time, avoiding tool conflicts.
- Background Tasks: Supports background task execution; tools within the isolated realm can properly access the
jobsregistry. - Auto-detection: Supports automatic detection of the Git Bash path; when not detected, manual configuration is allowed.
- Tool Hiding: Supports hiding disabled shell tools, keeping the tool list clean.
- Platform Restriction: Only effective on the Windows platform.
Installation¶
The plugin is packaged according to the dsh bundle specification. It can be installed in the following way:
dsh plugin --profile desktop add github:codel6i/dsh-shell-switch
If you need to build and install locally:
cd <插件目录>
npm install
npm run build
npm pack
dsh plugin --profile desktop add file:<插件目录>\dsh-shell-switch-0.1.7.tgz
Note: When installing from a git repository, if you encounter pnpm 11’s ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED error, you need to set the corresponding git dependency to allowBuilds: true in the profile’s pnpm-workspace.yaml.
Usage¶
After installation, there are two entry points to the panel:
1. Settings → Shell: Open the settings panel via the account/settings entry in the bottom-left corner, and select Shell from the left navigation.
2. Plugins → dsh-shell-switch: Find this row in the plugin list and click to enter the configuration page.
Panel operations:
1. Current shell: Choose between PowerShell and Git Bash.
2. Git Bash path: Leave blank for auto-detection; manually enter an absolute path if detection fails.
3. Hide disabled tools: Enabled by default; if disabled, both tools remain in the list.
After switching, the model’s tool list will change accordingly. If the model executes a command, the PowerShell option will use PowerShell, and the Git Bash option will use Git Bash (uname -s returns MINGW64_NT-...).
Background task example:
// bash { run_in_background: true }
// job_output bash-6
"bg-start 10:55:47\ntick-1\ntick-2\ntick-3\nbg-done 10:55:50\nshell=5.2.37(1)-release"
How It Works¶
The plugin injects configuration into the host through cordis.patch.yml:
1. Isolated Realm: Creates an isolated realm (shell-switch-bash) containing the @deepseek-ai/dsh-bash-sandbox executor and @deepseek-ai/dsh-tool-bash tool, avoiding conflicts with the default pwsh-sandbox.
2. PATH Injection: When Git Bash is enabled, insert the Git installation’s bin directory at the front of the process PATH; remove it when the plugin is uninstalled.
3. Tool Visibility Control: Monitors the prompt assembly process and removes disabled shell tools from the model-visible list.
4. Prompt Injection: Dynamically injects the current shell state and Git Bash path into the prompt to guide the model to use the tools correctly.
5. Status Reporting: Reports detection status, path, and current tool visibility to the panel via the GET /shell-switch/status interface.
Configuration and Notes¶
Configuration items:
* activeShell: Current shell, default pwsh.
* gitBashPath: Absolute path to Git Bash, leave blank for auto-detection.
* hideInactiveTool: Whether to hide disabled shell tools, default true.
Notes:
* Only effective on Windows: No functionality is registered on other platforms.
* Auto-degradation: When Git Bash cannot be detected, pwsh is not hidden, ensuring the model has an available Shell.
* Built-in terminal unaffected: Only switches the Agent’s execution shell, does not change dsh’s built-in terminal.
* Permission restrictions: Git Bash behavior in restricted permission mode has not been tested.
* Hot update: The panel is automatically hot-updated by the client HMR, but schema changes on the host side require restarting the dsh process.