DeepSeek Harness 插件

dsh-service-control

DSH 服务启停控制:HTTP API 与 dshctl CLI 按 profile 启动/停止/重启/查看状态,重启由独立进程执行,附带 shell 补全。

跳到安装方式

来源信息

GitHub 仓库
lxp731/agents-plugins
最近更新
2026年8月21日
分类
插件开发工具
GitHub stars
0

安装

默认先复制一段 Prompt,让 Agent 读页面和仓库;需要自己装时再切到命令。

复制这段 Prompt,发给 DSH、Codex 或其他 Agent,让它先读页面和仓库。

请先不要安装。阅读这个 DeepSeek Harness 插件,说明它解决什么问题、会访问哪些文件、网络或密钥,以及如何安装和卸载。

插件页面:https://deepseekplugins.org/zh/plugins/lxp731/agents-plugins~23dsh-service-control
GitHub:https://github.com/lxp731/agents-plugins/tree/main/dsh-service-control
插件名:agents-plugins#dsh-service-control
作者:lxp731
安装命令:dsh plugin --profile web add github:lxp731/agents-plugins#path:/dsh-service-control

确认前不要执行安装命令。

检查来源文件

安装前先看这个插件目录里的 README 和其他文件。

文件资源管理器3 个文件
README.md来源说明 · 只读预览

dsh-service-control

DSH 服务启停控制插件:HTTP API 控制启停/重启/状态,附带独立 CLI dshctl(含 shell 补全)。无 Web UI 面板。

控制逻辑在进程外(scripts/control.sh),插件通过 HTTP 路由调用;重启/停止由独立延迟进程执行,不会卡死插件自身。

安装

# 从 npm 安装(推荐)
dsh plugin --profile web add dsh-service-control
# 本地开发安装(从仓库目录调试时)
# dsh plugin --profile web add "file:."

装完重启 web profile 生效(结束当前 dsh web / dsh --profile web 进程后重新启动)。

启用 CLI 与补全

插件自带 CLI dshctl,安装后执行一次 setup 即可:自动链接到 ~/.local/bin/ 并安装补全(zsh/bash/fish 按检测到的 shell 自动选),幂等可重复执行,不改写任何 shell rc。新开终端后补全生效:

dshctl setup

如果提示 dshctl: command not found(多为 ~/.local/bin 不在 PATH),直接用包内命令执行 setup 即可,或改用全局安装:

~/.dsh/profiles/web/node_modules/.bin/dshctl setup   # 包内命令(profile 安装)
npm install -g dsh-service-control                   # 全局安装(npm 全局 bin 默认在 PATH)

使用

HTTP API

端点方法说明
/dsh-healthGET探活
/dsh-service/statusGET状态 JSON {ok, running, pid, port, url, profile, note}port/url 检测不到时为 null
/dsh-service/startPOST后台启动
/dsh-service/stopPOST优雅停止(SIGINT,由独立进程执行)
/dsh-service/restartPOST延迟重启(独立进程执行,先休眠 3s 再重启)

CLI

dshctl status                # 状态
dshctl open                  # 默认浏览器打开服务页面(未运行时提示先 start)
dshctl start                 # 启动(默认 web profile)
dshctl stop web
dshctl restart web
dshctl --profile tui start   # 指定 profile
dshctl setup                 # 启用 CLI + 安装补全
dshctl uninstall             # 移除 CLI 链接与补全

配置

插件 Config 支持 profile:指定控制哪个 profile,默认取启动 dsh 时的 --profile 参数(否则 web)。在 profile 的 cordis.patch.yml--patch overlay 中按 id 覆盖该行(config 为整体替换):

- id: dsh-service-control
  config:
    profile: tui

测试

npm test        # 单元测试:插件形态 / Config / inject / patch 行
npm run smoke   # smoke test:隔离 profile 安装 → 组合配置断言 → 启动 → /dsh-health 探测(无 dsh CLI 时自动跳过)

卸载

dshctl uninstall             # ① 删 CLI 链接 + 三处补全
dsh plugin --profile web remove dsh-service-control   # ② 移除插件本体(多 profile 逐一执行)
重启 web profile 生效        # ③ 结束当前 dsh web 进程后重新启动

可选残留:/tmp/dsh-web.log 日志;若配过 systemd 守护则 systemctl --user disable --now dsh 并删单元文件。

> 崩溃自动拉起需进程外机制(插件在进程死亡时无法自救),建议配合 systemd user service 使用。