YMRwithNoworry/dsh-nushell-only ↗★ 0

dsh-nushell-only

将 shell 执行统一为 Nushell,并在模型提示中注入 Nushell 语法指引 适合统一命令风格的团队环境,需保证仅有一个 shell 提供器并安装可用 Nushell。

套件
dsh-nushell-only
相容性
待驗證
Harness 依賴範圍
^0.1.5-rc.2
Cordis 依賴範圍
^4.0.2
版本
0.1.0
授權
MIT
最近更新
2026年9月13日

安裝

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:YMRwithNoworry/dsh-nushell-only

配置

补丁层默认配置(cordis.patch.yml):

- id: nushell-executor
  name: dsh-nushell-only/executor
  config:
    timeoutMs: 60000
    maxTimeoutMs: 600000
    maxOutputBytes: 64000
    graceMs: 3000
    enforceNushellOnly: true   # 拒绝把命令交给别的 shell
    requireNu: true            # 找不到 nu 就启动失败(而不是每次调用都失败)
    verifyNu: true             # 启动时跑一次 `nu --version`

- id: nushell-teaching
  name: dsh-nushell-only/teaching
  config:
    guide: full                # full | compact | off
    rules: true
    rewriteToolDescriptions: true

执行器可选项:

字段默认含义
nuPath$DSH_NU_PATH → nuNushell 可执行文件;优先级:本字段 > 环境变量 > PATH
nuArgs['--no-config-file','-c']argv 前缀,命令追加在最后
enforceNushellOnlytrue守卫开关
foreignShellAllowlist[]整条命令匹配的正则(字符串),命中则放行
requireNutrue无法解析 nu 时启动即失败
verifyNu / verifyTimeoutMstrue / 10000启动探测 nu --version 及其超时

cwd、timeoutMs、maxTimeoutMs、maxOutputBytes、maxSpillBytes、graceMs 沿用 dsh 自己的 shell 设置命名空间,settings.yaml 的 shell: 段仍然可以热改预算。

在本 profile 的 cordis.patch.yml 里按 id 覆盖即可,例如:

- id: nushell-executor
  config:
    nuPath: 'C:\Users\me\AppData\Local\Programs\nu\bin\nu.exe'
    enforceNushellOnly: false