Exits the dsh CLI process automatically when the Web UI closes, with a configurable grace period and dry-run mode.
Install
# from npm (prebuilt)
dsh plugin --profile web add dsh-auto-exit
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:xiaxingtianxia2-glitch/dsh-auto-exit
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 — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
English | 中文
What is this?
dsh --profile web keeps a long-running process in your terminal, driven from a
browser Web UI. This plugin makes closing the Web UI equivalent to exiting the
process: once every page is closed, the CLI process exits automatically through
the same graceful shutdown path as Ctrl+C (exit code 130) — no need to go back to
the terminal.
How it works
- Detection — the browser page keeps WebSocket connections to the CLI process; closing the page drops them.
- Grace period — after all connections are lost, it waits 15 seconds (configurable) before exiting, so a quick refresh or reopen never kills the process; reopening the page cancels the exit.
- Exit — when the grace period expires, it uses the same graceful shutdown channel as Ctrl+C and the process ends with exit code 130, saving state as usual.
Install
dsh plugin --profile web add dsh-auto-exit
Or from the GitHub source (identical content):
dsh plugin --profile web add github:xiaxingtianxia2-glitch/dsh-auto-exit
Usage
- Start
dsh --profile weband open the Web UI in your browser (default http://127.0.0.1:3080). - Close the browser tab(s)/window(s) (all of them if you have several).
- The process exits automatically 15 seconds later.
Check status
curl http://127.0.0.1:3080/auto-exit/status
{"enabled":true,"armed":true,"sockets":2,"countdownMs":0,"graceSeconds":15,"pollMs":1000,"dryRun":false,"lastEvent":"armed","fired":false}
Field meanings: sockets — current page connections; countdownMs — remaining
countdown (0 = not counting down); lastEvent — latest state change
(idle/armed/lost/cancel/exit).
Configuration
| Field | Default | Description |
|---|---|---|
enabled |
true |
Master switch |
graceSeconds |
15 |
Seconds to wait after all connections are lost before exiting |
pollMs |
1000 |
Poll interval (ms) |
armAfterFirstConnect |
true |
Only arm after the first page connects (a freshly started server with no browser open does not exit) |
dryRun |
false |
Dry run: only log "would exit", never actually exit |
FAQ
- Why hasn't it exited yet? Other tabs/windows are still open — the countdown only starts once all connections are gone.
- Does it exit on laptop sleep or browser crash? Yes — a dropped connection
means the UI is no longer usable; increase
graceSecondsif you don't want that. - How do I turn it off temporarily? Set
enabledtofalse, or uninstall:dsh plugin --profile web remove dsh-auto-exit.
License
Links
More in this category
yjh051108/dsh-routing-suite★ 6993
One repository, three parts: a runtime injector for DSH plugin packages (inject, hot-reload, unload, promote a dev staging tool to the front, route self-heal, plus a settings-page plugin manager that lists, unloads and drags folders in to internalize), a task-aware reasoning-mode router agent preset (router-standard / router-spec / router-react), and a graded two-level task protocol whose six tools (commit_star, lock_stage, revise_do, edit_plan, mark_task, redteam_verdict) pin task state to disk. The injector implementation ships in-tree, so the install carries its own behaviour rather than a dependency list.
strukto-ai/mirage#dsh★ 3672
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★ 326
Community distribution: TUI, desktop, and Web UI as one bundle with layered installation.
weijiafu14/pi2dsh★ 210
Pi Host ABI compatibility engine: after one install, unmodified Pi extensions from npm mount as native DSH plugins with `dsh plugin add <pi-package>`. Verified end to end on stock DSH with pi-mcp-adapter (full MCP manager: OAuth, resources, prompts, MCP Apps, elicitation, sampling), @tintinweb/pi-subagents, pi-code, pi-hermes-memory and pi-background-tasks; `pi2dsh inspect` reports a package's compatibility before installing.
lire1131/dsh-undo-savepoint★ 169
Undo/redo & rollback system for DSH: every config change is auto-snapshotted; undo/redo/restore to any version from the WebUI or the offline CLI/GUI tools (works even when DSH fails to boot).
Fishquito7/dsh-skill-mcp-panel★ 166
Manages DSH skills and MCP servers from the web settings: skill cards with hot enable/disable, workspace scopes, groups, batch migration and drag-and-drop import, plus stdio/HTTP MCP CRUD with connection tests, secret redaction and the unified dsh-panel CLI.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.