dsh-nu
Nushell脚本执行器与教学层 适合希望将Nushell作为唯一Shell执行器并让模型学习其语法的用户。
安装
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:ryan4yin/dsh-nu说明文档
阅读完整 README ↗Configuration
The bundle's patch mounts one executor row and one teaching row; a profile patch overrides either by id. This profile patch spells out every field and its default:
- 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"]
| Field | Default | Meaning |
|---|---|---|
nuPath | $DSH_NU_PATH, then nu | Nushell executable: field, then environment, then PATH |
nuArgs | ["--no-config-file","-c"] | Argv prefix; the command is appended last, so it must end with -c or --commands |
enforceNushellOnly | true | Refuse handing the command to another shell |
foreignShellAllowlist | [] | Regexes exempt from both preflight checks; each must match the whole command |
syntaxLint | true | Refuse bash/PowerShell syntax before spawning |
syntaxHints | true | Append one Nushell hint (…) for a recognized failure or deprecation warning, including exit 0 |
guide | full | Prompt guide: full, compact, or off |
rules | true | Prepend the shell-rules section |
rewriteToolDescriptions | true | Replace the shell claims in the bash / pwsh tool descriptions, keeping the host's own contract text |
toolNames | ["bash","pwsh"] | Tool schemas whose shell text is rewritten |
timeoutMs | 60000 | Default per-call timeout; maxTimeoutMs caps overrides |
requireNu / verifyNu | true / true | Fail boot when nu cannot be resolved, reports no version, or cannot run the preflight |
verifyTimeoutMs | 10000 | Bound for that probe |
Both checks read Nushell's parser through two read-only probes on a private temporary script. Boot runs a token and diagnostic canary once when verifyNu is on and either check is enabled: with requireNu (the default) a failure fails boot, and with requireNu: false each call is refused instead of running without the check (fail closed). The error names enforceNushellOnly: false and syntaxLint: false as the escape hatches and points at the tested Nushell version.
Choose the guide by goal:
offdisables the guide only; the rules stay on unlessrules: false. It is a diagnostic baseline: the eval recorded many preflight refusals and extra retries, so do not use it in normal sessions.compactcovers the common idioms and uses fewer prompt tokens. It handled most eval samples without a refusal.fullkeeps the detailed syntax reference for uncommon syntax and edge cases.
Sandbox budgets (cwd, timeoutMs, …) stay on the nu-executor row, not in dsh's shared shell settings namespace. Override any row by id in the profile's own cordis.patch.yml. examples/preset-nu-shell.md lists the preset-level shell bypasses to disable.