Preface¶
In DeepSeek Harness (DSH), agents execute commands locally through the shell tool. By default, the built-in executor picks a Shell based on the platform (for example, PowerShell on Windows, or $SHELL on Linux). If you want to pin the Shell to Git Bash, WSL, cmd.exe, zsh, or fish, while ensuring the model only ever sees one shell tool and cannot switch Shells per command, you need to make the “which Shell” choice a deployment-level configuration — and explicitly reject a Shell the sandbox cannot constrain, rather than silently running outside the sandbox.
The community plugin dsh-shell-select (maintainer athif23, category: client) does exactly that. It injects a Shell selection layer into Harness’s existing sandbox and execution pipeline, and persists configuration through a Web settings card.
What This Is¶
dsh-shell-select is a DeepSeek Harness plugin: it exposes only a single shell tool to the model, while the actual Shell used (PowerShell, Windows PowerShell, cmd.exe, Git Bash, WSL Bash, bash, zsh, fish, or system sh) is selected by the user in the settings. The selection is deployment configuration, not model state; Shells that the current permission mode cannot constrain are refused (fail-closed), rather than allowed to run outside the sandbox.
- Catalog page: https://www.skillhub.cn/plugins/athif23/dsh-shell-select
- Source: https://github.com/athif23/dsh-shell-select
- License: MIT (README and package.json)
Core Features¶
One Shell for All Agent Commands¶
The selected Shell becomes ctx.shell, and the shell tool, Hook commands, and Harness’s own probes all execute through it. The plugin rejects Harness’s built-in bash and pwsh tools, pointing the model to the unified shell tool in the rejection reason, so the model cannot mix multiple entry points.
Discovery and Explicit Paths¶
Harness’s built-in executable resolution looks up Shells by name. If the install path is non-standard or multiple installs share the same name, set executable in the configuration; this path takes priority over auto-discovery. If the path cannot be resolved or points to a different Shell, an error is raised rather than continuing a blind search.
Web Settings Card¶
Configuration is stored under the shell-select namespace of the DSH settings document. In the Settings → Plugins → Shell selection card, you can pick a Shell, Save / Discard, and use Test shell to run a fixed probe command for verification. Test shell uses the already-saved configuration, not the unstaged edits still on the card.
Shell Syntax Hints for the Model¶
Each Shell ships with its own syntax notes (for example, PowerShell paths, cmd variable expansion, WSL /mnt/..., fish’s non-POSIX syntax), helping the agent produce commands that match the current Shell.
No Separate Execution Stack¶
Deadlines, output caps, background tasks, and sandbox constraints are still provided by Harness; the plugin adds no independent execution machinery.
Installation and Activation¶
A DSH profile is a pnpm project under ~/.dsh/profiles/<name>. In an existing Harness profile (for example, web):
dsh plugin --profile web add dsh-shell-select
This command passes the arguments to the pnpm in the profile directory and registers the package as a bundle layer in dsh.profile.bundles; entries already in the list are left untouched. A running profile still uses the bundle set from startup, so you must restart after installation:
dsh web
dsh web is equivalent to dsh --profile web.
For development from a local checkout (an optional approach mentioned in the docs; review the source at your own discretion):
git clone https://github.com/athif23/dsh-shell-select
dsh plugin --profile web add link:/absolute/path/to/dsh-shell-select
The link: install keeps the directory and the profile linked, so after editing the plugin’s code, restarting the profile picks up the changes. The plugin declares Harness packages via peerDependencies and does not bundle another copy of Harness inside the plugin.
Typical Usage¶
After installing and restarting the profile, inside the app:
- Open Settings → Plugins and expand Shell selection.
- Select a Shell in the dropdown. The default Automatic resolves and shows the actually selected Shell according to the deployment rules.
- Click Save; before Save, modifications are only staged and runtime behavior does not change.
- Click Test shell to run a fixed test command through the current saved selection. If it returns a refusal, that is consistent with what real agent commands would get under the current permission mode.
You can also directly edit the shell-select section in ~/.dsh/settings.yaml, for example:
shell-select:
shell: gitbash
loginShell: false
Common fields (see README for the full table):
| Config key | Default | Meaning |
|---|---|---|
shell |
auto |
Shell id from the catalog, or auto |
executable |
empty | Explicit executable path, overrides auto-discovery |
loginShell |
false |
For bash-family Shells, whether to add -l (load profile on each command) |
wslDistro |
empty | WSL distribution name; empty uses the default distribution |
wslMountRoot |
/mnt |
Root path where WSL mounts Windows drives |
enableRunInBackground |
true |
Whether to offer run_in_background on the shell tool |
There is also a set of budget fields inherited from the local executor (such as cwd, timeoutMs default 120000, maxOutputBytes, etc.), configured uniformly in the same composition line. Harness’s existing pwshPath still applies to the PowerShell entry.
Setting changes only affect subsequent invocations and do not rewrite invocations that are already preparing, running, or finished.
Platform Support and Permission Notes¶
The README uses a table to distinguish three tiers: “in catalog”, “actually run agent commands”, and “sandbox refuses writes outside the workspace”. Brief conclusions:
- Windows (primary platform):
pwsh,powershell,cmd,gitbash,wslare available.cmd.exeand PowerShell 5.1 are verified to work under sandbox constraints. Git Bash and WSL Bash cannot start under a restricted token, so they are refused underworkspace-writeandread-only(including version probing in the settings card); they run only underdanger-full-access. This is intentional design: it avoids using Shells that the sandbox cannot constrain. - Linux (secondary): On CI, the plugin’s execution has been tested and asserted to refuse workspace-write for
bash,sh,pwsh; independent review on Linux without a usable sandbox backend mainly verified the refusal path.zshandfishare not installed in the test environment. - macOS: The README marks it as unverified; the test workflow only runs on Windows and Linux.
The Automatic default behavior replicates the deployment’s original logic: on Windows it resolves to PowerShell first; on Linux it follows $SHELL, pointing at the catalog entry. If executable points to a bash.exe while shell is still auto, that binary runs with bash arguments.
Use Cases and Pre-Install Checklist¶
Suitable for DSH deployments on Windows that need to uniformly use cmd, PowerShell, or (under danger-full-access) Git Bash / WSL, or on Linux to pin bash / sh / pwsh, and that want the agent to face only one shell tool.
Like Harness itself, the plugin runs under the permissions of the current dsh process; before installing, read the source code and the MIT license to confirm the bundle behavior fits your security policy. The community catalog SkillHub and DeepSeek / High-Flyer have no official affiliation; this plugin comes from community maintainer athif23.
Common errors (README Troubleshooting):
- No
<shell>executable found: No executable was found by name; install it or setexecutable. - Refused under the current permission mode: The current permission mode cannot constrain the chosen Shell; on Windows, Git Bash / WSL under
workspace-write/read-onlyis expected behavior — switch to a constrainable Shell or adjust the permission mode. - Automatic shows unknown: The staged
executablehas not been resolved by the host yet; after Save, the card will show the Automatic resolution result.
Conclusion¶
dsh-shell-select consolidates Shell selection into a deployment-level setting and a single model-facing shell tool, works on top of Harness’s existing sandbox, and refuses execution when a Shell cannot be constrained. If you need the Web card or YAML fine-tuning of WSL, login shell, background tasks, etc., install and restart the profile using the commands above.
- Plugin catalog: https://www.skillhub.cn/plugins/athif23/dsh-shell-select
- GitHub: https://github.com/athif23/dsh-shell-select