Skip to content
dsh.fish
Bundle

dsh-nushell

Run DeepSeek Harness's bash tool with Nushell

Source
daief
License
MIT
Updated
Updated 19 days ago

Readme

# dsh-nushell

[English](README.en.md) | 中文

`dsh-nushell` 是一个 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) Profile Bundle,用 [Nushell](https://www.nushell.sh/) 执行 DSH 内置的 `bash` 工具。

面向模型的工具名称和参数仍保持为 `bash`,但命令会以 `nu --no-config-file -c <command>` 运行。用户的 `config.nu` 和 `env.nu` 不会影响工具调用;后台任务、权限审批、沙箱、超时和输出处理继续使用 DSH 的原有机制。

## 前置条件

- 兼容 DSH `0.1.0-rc.7`,并使用 Node.js `>=22.19.0`。
- 已安装 Nushell,并能通过 `PATH` 中的 `nu` 调用。若需使用其他位置的可执行文件,请在启动 DSH 前将 `DSH_NU_PATH` 设置为其绝对路径。

## 安装

```sh
dsh plugin --profile web add dsh-nushell
```

安装后重启对应 Profile;将 `web` 替换为你实际使用的 Profile 名称。

## 本地开发与测试

先安装依赖并构建:

```powershell
pnpm install
pnpm run build
```

生成引用本机构建产物绝对路径的补丁:

```powershell
pnpm run patch:local
```

该命令从 `cordis.patch.yml` 生成未纳入 Git 的 `cordis.patch.local.yml`,并将 `sandbox.js` 和 `tool.js` 替换为本机 `dist` 目录的绝对 `file:///` 路径。

使用该补丁启动 DSH:

```powershell
dsh web --patch ./cordis.patch.local.yml
```

修改源码后,先重新构建,再运行 `pnpm run patch:local`。

## 使用方式

工具仍叫 `bash`,但必须编写 Nushell 语法:

```nu
ls | where type == file | get name
open package.json | get name
$env.DSH_WEB_URL
```

每次调用都会创建新的 Nushell 进程。请使用工具的 `workdir` 参数,不要依赖前一次调用的 `cd` 状态。

## 限制

- Shell 状态、别名和变量不会在工具调用之间持久化。
- 为了兼容性,公开工具名仍是 `bash`;插件自己的 consumer 会将其描述和系统提示固定为 Nushell 语义。
- 执行器将隔离委托给 DSH 沙箱,并按当前 runner 的拒绝特征分类文件访问拒绝和 runner 故障。
- 插件实现与 DSH `0.1.0-rc.7` 的 shell/sandbox 契约对齐;升级 DSH 前应先验证兼容性。

Install

dsh plugin --profile web add github:daief/dsh-nushell#98660b7fc11f0115d9269a81602e3623b2c70980

Profile: web

  • This package builds from source on install. pnpm will ask you to allow its build script — that is permission to run the package’s code on your machine, outside the agent sandbox. Only allow sources you trust.
Source