Preface¶
In DeepSeek Harness (dsh), the model executes shell commands via the bash / pwsh tools by default. If you want the agent to uniformly use Nushell’s pipelines, structured output, and type system, and want to prevent the model from secretly spawning bash or PowerShell, you need to swap the executor at runtime and teach the model Nushell syntax in the system prompt. Hand-written profile patches can achieve this, but maintenance costs are high, and they easily become inconsistent with the conventions of other dsh plugins.
Below is an introduction to the community plugin dsh-nu (maintainer ryan4yin): it routes every shell call in dsh to Nushell, and refuses to hand commands to other shells before the subprocess is launched. The plugin is categorized as a “client” plugin; you can view its entry on the SkillHub directory page; the source code and documentation are on GitHub (currently about 2 stars).
What Is This¶
dsh-nu is a dsh bundle plugin: through the low-level extension points exposed by dsh, it replaces the bash / pwsh executors with a Nushell executor at runtime; all commands run in the form of nu --no-config-file -c "<command>". For dsh, the tool names and invocation conventions remain bash / pwsh, so it stays compatible with other plugins and features — the model still sees tools named bash / pwsh, except the scripts passed in should be Nushell.
npm package version 0.6.1, license MIT. The tested combination recorded in package.json is dsh 0.2.1-rc.2 and Nushell 0.115.1; the author states support for that combination only. If your local dsh or nu versions differ, a warning is printed at startup; other versions are untested.
Core Features¶
The plugin README summarizes three things; below they are explained in execution order.
1. Swap the executor¶
The bundle’s patch mounts the Nushell executor and disables the platform’s built-in bash / pwsh executors. dsh still calls the same shell tool interface, but the actual execution path becomes Nushell.
2. Teach the model¶
Appends a concise Nushell rules and syntax description to the system prompt (the teaching layer). This consumes part of the context; if the teaching text is turned off, the model is more likely to make mistakes when calling shell tools. In the config, fields like guide (full | compact | off) and rules can adjust this (see the configuration example below).
3. Refuse handoffs to external shells¶
When a command tries to hand work off to bash, PowerShell, or another shell, the guard refuses execution before the process starts. Bash/PowerShell syntax that Nushell would reject or misread is also intercepted by syntax rules, with error messages giving hints on the corresponding Nushell syntax.
To be clear: this is not a complete sandbox. The guard only checks the command locations it can read; the README also has a section on “what Nushell-only does not cover”. It is recommended to read through the repository documentation before deployment.
Installation and Activation¶
Environment requirements (from the README):
- Node 22.19+
pnpmonPATH(used by thedsh plugininstallation flow)- dsh 0.2.1-rc.2
- Nushell 0.115.1 on
PATH
Add the bundle to your dsh profile:
dsh plugin --profile tui add dsh-nu@0.6.1
For browser use, use --profile web. The first run of dsh plugin creates the profile; the bundle’s patch disables the platform shell executors and mounts the Nushell executor and the teaching layer. Then launch the corresponding profile with dsh tui (or dsh web).
If pnpm reports ERR_PNPM_NO_MATURE_MATCHING_VERSION (new versions are restricted by minimumReleaseAge), you can wait until the cutoff time, or add --config.minimumReleaseAge=0 to the same command.
Note: the plugin runs shells with the permissions of the current dsh process; review the source code and license yourself before installing, and do not enable it directly in untrusted environments.
Configuration Essentials¶
The profile can override the bundle’s default lines by id via cordis.patch.yml. The complete example given in the README is as follows (see the repository configuration table for field meanings):
- id: nu-executor
name: dsh-nu/executor
config:
nuPath: ""
nuArgs: ["--no-config-file", "-c"]
timeoutMs: 60000
enforceNushellOnly: true
syntaxLint: true
syntaxHints: true
requireNu: true
verifyNu: true
verifyTimeoutMs: 10000
foreignShellAllowlist: []
- id: nu-teaching
name: dsh-nu/teaching
config:
guide: full # full | compact | off
rules: true
rewriteToolDescriptions: true
toolNames: ["bash", "pwsh"]
Common trade-offs:
guide: full(default): detailed syntax reference, suitable for unconventional syntax and edge cases.guide: compact: saves more tokens; most examples in the eval pass without rejection.guide: off: only turns off the guide; rules can still be controlled viarules; the README states that more preflight rejections and retries will appear in the eval; not recommended as the default for daily sessions.
The nuPath resolution order is: config field → environment variable DSH_NU_PATH → nu on PATH. enforceNushellOnly: false and syntaxLint: false are the “escape hatches” mentioned in the documentation; only consider them when explicitly needed.
Sandbox-related budgets (such as cwd, timeoutMs) are attached to the nu-executor line, not in dsh’s shared shell namespace. The repository’s examples/preset-nu-shell.md lists the shell bypasses that need to be turned off at the preset level.
Nix and Other Installation Paths¶
dsh-nu does not package dsh itself. The repository provides a flake; you can use nix develop to obtain the Node and Nushell versions used for testing. If you use Nix to assemble dsh with plugins, the README gives an example flake via withPlugins and mkDshNuPackage from nur-ryan4yin; nix build produces a dsh binary with the bundle. For details, refer to the README Nix section.
Use Cases and Caveats¶
Suitable for: those who already use Nushell in daily development and want the dsh agent’s language to be consistent with local scripts; those who want to prevent the model from spawning bash/pwsh via shell tools as much as possible; those willing to accept the context overhead from the teaching text.
Not suitable or needs caution: must use a dsh / Nushell version not listed in testedWith; workflows that rely on bash-specific syntax or frequently exec external shells (unless you understand the guard boundaries and adjust the whitelist foreignShellAllowlist).
DeepSeek Harness’s ecosystem philosophy is “everything is a plugin”; SkillHub is a community directory with no official affiliation to DeepSeek / High-Flyer. The installation commands and versions in this article are based on the repository README.
Conclusion¶
dsh-nu consolidates dsh’s shell layer into “Nushell only”: executor replacement, prompt teaching, and pre-launch refusal of external shells. Together, these three reduce the model spinning in wrong shell dialects. If you want to pin Nushell in dsh, you can first add dsh-nu@0.6.1 to your profile with the commands above, then adjust guide and guard switches according to the README.
- Directory page: https://www.skillhub.cn/plugins/ryan4yin/dsh-nu
- GitHub: https://github.com/ryan4yin/dsh-nu