中文EN

dsh-restart-anywhere

dev已测通过npmMIT

在「设置」上方添加「重启 dsh」按钮,原地重启:以 systemd 单元运行时由 systemd 重启,否则通过 process.execve 保持同一 PID(Windows 或 Node < 22.15 时保留一个轻量父进程),启动 dsh 的守护进程或终端无需额外配置(已在 Linux 实测,Docker、macOS、Windows 尚未实机测试);新 boot id 响应后页面自动刷新。

下载量 / Downloads
1,493
依赖体积 / node_modules
0.03 MB
测试时间 / Tested
2026-11-06
DSH 版本 / Version
0.2.2-rc.1

安装

dsh plugin --profile web add dsh-restart-anywhere

沙箱测试结果

阶段结果
1 安装✓
2 列装✓
3 挂载✓
4 启动—

四阶段在隔离沙箱里跑:安装(有网)→ 列装 → 挂载 → 启动(后三步断网)。

README

<p align="center">

<img src="https://raw.githubusercontent.com/JoblessJoe/dsh-restart-anywhere/main/.github/assets/banner.svg?v=2" alt="dsh-restart-anywhere: one restart button for the DeepSeek Harness web GUI that works with your setup" width="100%">

</p>

<p align="center">

<a href="https://www.npmjs.com/package/dsh-restart-anywhere"><img src="https://img.shields.io/npm/v/dsh-restart-anywhere?color=34d399&label=npm" alt="npm version"></a>

<a href="https://www.npmjs.com/package/dsh-restart-anywhere"><img src="https://img.shields.io/npm/dm/dsh-restart-anywhere?color=34d399" alt="npm downloads"></a>

<img src="https://img.shields.io/badge/dependencies-0-34d399" alt="zero runtime dependencies">

<a href="https://joblessjoe.com/dsh-restart-anywhere"><img src="https://img.shields.io/badge/website-joblessjoe.com-34d399" alt="project page on joblessjoe.com"></a>

<a href="LICENSE"><img src="https://img.shields.io/github/license/JoblessJoe/dsh-restart-anywhere?color=34d399" alt="MIT license"></a>

</p>

A DeepSeek Harness (dsh) web GUI plugin that adds one small Restart dsh button above Settings. It is for the moments you need a restart: you installed a plugin, changed a config, or fixed a bug in your own plugin.

Agents can do it too. A dsh_restart tool lets an agent restart dsh after installing or editing a plugin. With a continue_prompt, it is woken in the same session once dsh is back and carries on.

**It works with your setup.** systemd, Docker, Kubernetes, pm2, a tmux pane, a plain terminal or Windows: click, and dsh is back in a few seconds. The page reloads by itself.

npx @deepseek-ai/dsh plugin --profile web add dsh-restart-anywhere

<p align="center">

<img src="https://raw.githubusercontent.com/JoblessJoe/dsh-restart-anywhere/main/.github/assets/overview.png" alt="The Restart dsh button above Settings in the dsh sidebar" width="100%">

</p>

Works with your setup

Most restart buttons kill dsh and hope something starts it again. That only works for the setup their author had. A detached "relaunch me" helper gets killed along with a systemd service. A clean exit doesn't trigger Restart=on-failure. A container without a restart policy just stops. And under pm2 or runit, the helper and the supervisor both start dsh and fight over the port.

dsh-restart-anywhere doesn't hand dsh's life to anyone else. It restarts dsh in place:

Your setup · What happens · Leaves behind

systemd (user or system unit, any Restart= policy) · Asks systemd to restart the unit, so you get a fresh process, exactly like systemctl restart. If that's not permitted (a system unit, no root), it falls back to in-place. · nothing

Docker / Podman / Kubernetes (with or without a restart policy) · In place: same PID, so the container never notices. · nothing

pm2, supervisord, launchd, runit, s6, nssm, forever, … · In place: the supervisor keeps seeing the process it started, still running. · nothing

Terminal, tmux, screen, nohup · In place: same PID, and the new dsh keeps printing to the same terminal. Ctrl-C still stops it. · nothing

Windows / Node < 22.15 · Wrapper: the old process stays as a thin parent of the new dsh. It forwards Ctrl-C and exits with dsh's exit code. · the parent process

dsh desktop app · Button hidden: the app manages its own lifecycle. · n/a

No supervisor detection, no config, no root, no helper scripts.

How it works

1. Graceful shutdown. The plugin calls dsh's own exit hook (ctx.appExit). Every plugin tears down exactly as on a normal quit, and sessions are flushed.

2. The process becomes the new dsh.

  • Linux / macOS, Node ≥ 22.15: process.execve() swaps the process image for a fresh dsh with the same command line, environment and stdio. The PID doesn't change, and nothing is left behind.
  • Windows / older Node: the process stays alive as a small wrapper and starts the fresh dsh as its child. Later restarts reuse the same wrapper, so there's never more than one.
  • systemd: systemd restarts the unit itself, via a one-second transient timer, so the HTTP reply reaches your browser first.

3. The page reloads. The browser polls until a server with a new boot ID answers, then reloads. That works however fast or slow the restart is.

Details that make it hold up:

  • --port 0: a random port is pinned on restart, so the page finds dsh again.
  • No browser-tab spam: --no-open is added on relaunch.
  • Double clicks: a second request while a restart is running gets 409.

Install

Into your dsh web profile (web below is the profile name; use whichever profile backs your web GUI). From a source checkout, use pnpm dsh instead of npx @deepseek-ai/dsh:

npx @deepseek-ai/dsh plugin --profile web add dsh-restart-anywhere

This installs the package into the profile and adds it to dsh.profile.bundles. Reload the browser tab, and Restart dsh shows up above Settings. If it doesn't, restart dsh one last time the old way. From then on, the button does it.

Requires dsh 0.2.0 or newer and Node 20+. There's no build step and no runtime npm dependencies.

Using it

Click Restart dsh and confirm. The icon spins while dsh restarts, and the page reloads when the new dsh is up, usually within about 5 seconds.

Running agent sessions are interrupted by a restart, like with any restart. The confirmation dialog says so.

For agents: the dsh_restart tool

Agents get the same restart as a tool, e.g. after installing or editing a plugin they want to test.

  • dsh_restart({ continue_prompt? }): restarts dsh exactly like the button.
  • continue_prompt: once dsh is back, the agent is woken in the same session with this text as its next instruction. Leave it out and the session just stays

…(truncated)

以上内容来自 npm 上的 README,我们只做格式化,不改内容。

版本

npm 上共发布:6,最后更新 2026-10-25

链接

GitHub · Homepage · npm

同类插件