A small self-contained power control for DSH: sidebar power button with an upward restart/shutdown menu and a Windows-shutdown-style overlay. Own restart & shutdown engine (no dependency on other plugins), dynamic-port aware.
Install
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:keyiadiannao/dsh-restart-button
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time. Only install sources you trust, and pin a commit (github:owner/repo#sha).
README
A self-contained power control plugin for DeepSeek Harness: a power button in the sidebar footer with an upward Restart / Shutdown menu and a full-screen transition overlay. The restart & shutdown engine is built into this plugin — no dependency on other plugins.
Developed with DeepSeek AI assistance, reviewed before release.
Features
- Power button in the sidebar footer (
sidebar.footer.action), styled to match the adjacent Settings trigger (34px row, theme tokens — follows light/dark). - Upward menu: Restart / Shutdown, closes on outside click or Esc.
- Restart: writes a
.cjshelper → spawnsnode <file>detached (no console window) → waits for the port to free → relaunches DSH with the sameexecPath/execArgv/argv/cwd, then terminates the old process after the response flushes. - Shutdown: terminates the process without relaunching.
- Overlay: Windows-shutdown-style transition screen with ring progress and stage captions; auto-reload after restart.
restart_harnessmodel tool: same name asanweat/dsh-restart, provided by this plugin when installed alone; skipped if another plugin already owns the name.
Install
dsh plugin --profile web add "github:keyiadiannao/dsh-restart-button#master"
Restart DSH; a power button appears in the sidebar footer. Requires Node ≥ 22.19.
How it works
click power → menu → Restart
[host] POST /api/dsh-restart-button/restart
→ write $USERPROFILE/.dsh/restart-helper-<pid>-<ts>.cjs
→ spawn `node <helper>` (detached, windowsHide)
[helper] wait for old PID to exit → wait for port to free
→ spawn DSH again with same execPath/argv/cwd → self-delete
[host] terminate after the HTTP response flushes
[client] poll health → confirm new instanceId → auto reload
Shutdown posts /api/dsh-restart-button/shutdown and terminates without relaunching.
Design notes (from real issues hit in development):
- The helper must be outside the process tree (
detached+unref), otherwise killing DSH kills the helper too. - The helper is a real
.cjsfile, notnode -e: multi-linenode -escripts get mangled by WindowsCreateProcessand die with a silentSyntaxError.
Safety
- Destructive POSTs are protected by a same-origin / loopback guard (CSRF).
- An at-most-once latch prevents duplicate restarts from concurrent requests (a second POST gets
409). - Restart success is confirmed by the per-process
instanceIdchanging (old → new), not just a transient down.
Development
npm run build # tsdown: host + client bundle
npm run typecheck # tsc --noEmit
Artifacts: host at lib/index.js, client bundle at lib/client.js (committed — git installs build-free).
License & Attribution
MIT. The "detached helper relaunch" idea follows anweat/dsh-restart (MIT); the implementation is independently written (real .cjs file, no PowerShell, dynamic port), no code copied.
Links
More in this category
strukto-ai/mirage#dsh★ 3431
Swaps the filesystem and bash providers for a mirage virtual workspace: file tools and shell commands run over mounted resources (RAM, S3, Redis, Slack, Gmail, Notion, Postgres) instead of the host disk, with per-mount read/write/exec modes, per-command sandbox routing (monty, pyodide, quickjs in process; docker, e2b, daytona remote), and installed CLIs (git, gh, slack, linear, ntn, gws, or one you register) as head words in the virtual terminal.
hust-open-atom-club/oh-dsh★ 176
Community distribution: TUI, desktop, and Web UI as one bundle with layered installation.
Jayden-X-L/forkprobe★ 65
Compare multiple skills on the same task and pick the winner.
vlln/plugin-registry★ 39
Ecosystem infrastructure: a thin browser console for managing official repository plugins (zero patches) plus a make-dsh-plugin skill for guided plugin development.
forrestchang/dsh-multica-runtime★ 33
Run the dsh runtime on Multica.
DietCokewithSugar/dsh-user-experience★ 18
Finds potential UX issues in your project: automatically reviews React/TypeScript code, pinpoints each problem, and gives concrete suggestions.