ryan4yin/dsh-nu ↗★ 2

dsh-nu

Nushell脚本执行器与教学层 适合希望将Nushell作为唯一Shell执行器并让模型学习其语法的用户。

包名
dsh-nu
兼容性
待验证
Harness 依赖范围
^0.2.1-rc.2
Cordis 依赖范围
^4.0.2
版本
0.6.1
许可证
MIT
最近更新
2026年10月21日

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:ryan4yin/dsh-nu

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"]
FieldDefaultMeaning
nuPath$DSH_NU_PATH, then nuNushell 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
enforceNushellOnlytrueRefuse handing the command to another shell
foreignShellAllowlist[]Regexes exempt from both preflight checks; each must match the whole command
syntaxLinttrueRefuse bash/PowerShell syntax before spawning
syntaxHintstrueAppend one Nushell hint (…) for a recognized failure or deprecation warning, including exit 0
guidefullPrompt guide: full, compact, or off
rulestruePrepend the shell-rules section
rewriteToolDescriptionstrueReplace 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
timeoutMs60000Default per-call timeout; maxTimeoutMs caps overrides
requireNu / verifyNutrue / trueFail boot when nu cannot be resolved, reports no version, or cannot run the preflight
verifyTimeoutMs10000Bound 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:

  • off disables the guide only; the rules stay on unless rules: false. It is a diagnostic baseline: the eval recorded many preflight refusals and extra retries, so do not use it in normal sessions.
  • compact covers the common idioms and uses fewer prompt tokens. It handled most eval samples without a refusal.
  • full keeps 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.