DeepSeek Harness plugin

dsh-service-control

HTTP API and dshctl CLI for managing the dsh service: start, stop, restart and check status per profile, with graceful detached restart and shell completions.

Jump to install

Source facts

Repository
lxp731/agents-plugins
Latest update
Aug 21, 2026
Category
Development & Runtime
GitHub stars
0

Install

Start with a prompt that asks an agent to read the source. Switch to the command if you want to install it yourself.

Copy this prompt into DSH, Codex, or another agent and ask it to read the page and repository first.

Do not install anything yet. Read this DeepSeek Harness plugin and explain what it does, which files, networks, or credentials it can access, and how to install and remove it.

Plugin page: https://deepseekplugins.org/plugins/lxp731/agents-plugins~23dsh-service-control
GitHub: https://github.com/lxp731/agents-plugins/tree/main/dsh-service-control
Plugin: agents-plugins#dsh-service-control
Author: lxp731
Install command: dsh plugin --profile web add github:lxp731/agents-plugins#path:/dsh-service-control

Do not run the install command until I confirm.

Check the source files

Read the README and other files from this plugin directory before installing.

File explorer3 files
README.mdSource · read only

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 使用。