Bundle
dsh-reloader
DSH 一键重启:安装/更新插件后调用 dsh_reload 工具自动重启 web 界面,无需手动 Ctrl+C。
- Source
- lin-cheng-lab
- stars
- 2 stars
- License
- MIT
- Updated
- Updated 10 days ago
Readme
# 🔄 dsh-reloader **DSH 一键重启工具** —— 安装/更新插件后说一句"帮我 reload",自动重启 web 界面,新插件立即生效,不用再手动 `Ctrl+C`。 ## 为什么需要它 DSH 的 profile bundle 插件(如 `dsh plugin --profile web add ...`)装好后,需要**重启 web 进程**才生效。手动重启很麻烦: ``` Ctrl+C → 重新输入 dsh web → 等启动 → 刷新浏览器 ``` 本插件把这一步变成一条命令:调用 `dsh_reload` 工具,6 秒后进程自动重启,页面刷新即恢复。 ## 安装 ```sh # 从 GitHub 安装 dsh plugin --profile web add "github:lin-cheng-lab/dsh-reloader" # 或从本地源码安装 dsh plugin --profile web add "file:/path/to/dsh-reloader" ``` 重启 profile 后生效(reload 工具的第一次使用需要一次手动重启,之后就全自动了)。 ## 使用 安装/更新插件后,向 DSH 说一句: > 帮我 reload 一下 工具会自动完成: 1. **等待 6 秒**(让当前回复先送达页面) 2. 用 `lsof` 按 3080 端口定位当前 dsh web 进程,`ps` 校验命令行含 `dsh` 后 `kill`(双保险防误杀) 3. 等待端口释放(最多 15 秒) 4. `nohup` 重新启动 `dsh web`,日志写入 `~/.dsh/web.log` 然后刷新页面即可——聊天记录都在(会话已持久化)。 ## 工作原理 - 通过 `ctx.shell` 启动一个**后台 detach 进程**执行重启(工具立即返回,不阻塞) - 进程定位用端口(`lsof -iTCP:3080`)+ 命令行校验(`ps | grep dsh`), 不依赖 `pgrep -f`(在受限执行环境中可能不可见) - 只影响监听 3080 的 dsh web 进程,不碰其他程序 ## 安全边界 - 只 kill 监听 3080 且命令行含 `dsh` 的进程 - 重启失败有日志(`~/.dsh/web.log`)可排查 - 若工具报错,仍可手动重启:终端 `Ctrl+C` → `dsh web` ## 开发 ```sh npm install --legacy-peer-deps # 安装 typescript(跳过未发布的 @deepseek-ai peer) npm run build # tsc → lib/ ``` 类型解析依赖本机 DSH 安装中的 `@deepseek-ai/cordis` 与 `@deepseek-ai/dsh-tools`。 ## 许可 MIT
Install
dsh plugin --profile web add github:lin-cheng-lab/dsh-reloader
Profile: web
With the hub plugin installed, ask your agent to install it by name — it resolves the same plan shown here.
dsh plugin --profile web add github:stvlynn/dsh.fish#path:packages/dsh-plugin-hub
install dsh-reloader from the hub
- 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.
- This source has no pinned commit, so a later push upstream changes what installs. Prefer pinning a commit.