Tools & Capabilities

dsh-launcher

ryun601/dsh-launcher · ★ 4

ryun601

A Windows launcher and manager for DeepSeek Harness Web with foreground or background startup, browser opening, status checks, service stopping, and deepseek command registration.

License
MIT
Added
2026-08-23
Maintenance
active
Install kind
github

No manifest check is available; listing does not imply compatibility or security review.

安装

dsh plugin --profile web add github:ryun601/dsh-launcher

GitHub 源码安装:首次需按提示配置 allowBuilds 构建授权后重试

For install and environment setup, plus plugin development tutorials, see DSH community docs ↗

README

Source README · body: en · Read Chinese README

Table of contents
  1. Features
  2. Installation
  3. Prerequisite: Install Node.js
  4. Option 1: One-line install via PowerShell (recommended)
  5. Option 2: Manual install
  6. Option 3: Run from source
  7. Quick Start
  8. CLI Usage
  9. Start & Stop
  10. Status & Logs
  11. Authentication & browsers
  12. Version & Upgrades
  13. Diagnosis & Uninstall
  14. Other Ways to Start
  15. Built-in scripts
  16. Optional: the official DSH CLI
  17. FAQ
  18. Appendix: Files
  19. License

中文 | English

License Release Platform

A launch & management tool for DeepSeek Harness Web on Windows: type deepseek in cmd / PowerShell to start it (foreground / background modes), auto-open the browser, check status, and stop the service. One-click registration of the deepseek command is also supported.

Features

  • Command-line launch: type deepseek in cmd / PowerShell to start — no need to hunt for icons or remember paths
  • Foreground / background modes: foreground shows logs in a window (closing the window stops it); deepseek -b submits background startup and returns immediately
  • Auto-open browser: opens the authenticated local Web UI automatically when the service is ready
  • Cross-browser reopen: deepseek --open [default|edge|chrome|firefox|brave] opens the authenticated URL in a selected browser
  • Visible shortcut feedback: shows startup progress, closes after opening the browser, and stays open with log details on failure
  • Status & stop: deepseek --status shows the run state; deepseek --stop stops the service and reminds you how to restart it
  • Works on both Windows 10 and Windows 11

Installation

Prerequisite: Install Node.js

dsh-launcher is a launcher for DeepSeek Harness; dsh-launcher only requires Node.js. On the first deepseek run, it prepares and starts DeepSeek Harness through npm in %USERPROFILE%\dsh-launch\runtime.

  1. Install Node.js LTS (requires ^22.19.0 || >=24.0.0, same as upstream DSH; Node 22 LTS or 24+ both work. The launcher checks this before install, start and upgrade and reports the current version and how to upgrade)

The first launch requires an internet connection. Node.js normally includes npm; if the environment check cannot find npm, reinstall Node.js LTS.

irm https://raw.githubusercontent.com/RYun601/dsh-launcher/main/install.ps1 | iex

Downloads the latest Release, verifies the release package SHA-256 and manifest, extracts it to %USERPROFILE%\dsh-launcher, and registers the deepseek command automatically.

Before extraction the installer verifies the package SHA-256 (the GitHub release asset digest first, the published .sha256 sidecar as fallback) and the shipped release-files.txt manifest. The install refuses without writing anything when the digest is missing or mismatched, or when the package files do not match the manifest.

A desktop shortcut is not created by default. To create one, run these two steps in the same PowerShell window:

  1. Download the installer script to the current directory:

    irm https://raw.githubusercontent.com/RYun601/dsh-launcher/main/install.ps1 -OutFile .\install.ps1
    
  2. Run the script with the -Shortcut parameter:

    .\install.ps1 -Shortcut
    

-Shortcut: creates a "DeepSeek Harness" desktop shortcut. It starts in background mode, shows startup progress, and closes automatically after a successful start. Running the installer with this parameter again updates the shortcut; without it, the installer does not create a shortcut.

Option 2: Manual install

  1. Download dsh-launcher.zip from Releases and extract it
  2. Run install-command.cmd (registers the deepseek command)
  3. Open a new terminal and type deepseek

Option 3: Run from source

git clone https://github.com/RYun601/dsh-launcher.git
cd dsh-launcher

Quick Start

After completing the installation above (any option) and opening a new terminal window (so the new PATH takes effect):

  1. Type deepseek -b to submit background startup and return immediately (or deepseek for foreground mode)
  2. On first run, npm prepares the DeepSeek Harness runtime and required dependencies automatically (needs internet, ~1-2 minutes)
  3. The browser opens the local Web UI automatically when the service is ready
  4. On first use, sign in / enter an API Key in the DeepSeek Harness UI

See "CLI Usage" below for every subcommand and flag.

CLI Usage

Only one action is allowed per invocation; unknown arguments or conflicting combinations fail with an error and never fall back to a foreground launch. Real exit codes from the PowerShell layer are propagated unchanged to the deepseek command. --full is only valid together with --uninstall; a number is valid only immediately after --logs as its line count or after --upgrade as the version-list display count, --json only after --status, --follow only after --logs, a version token (e.g. 0.1.1-rc.2) only after --upgrade, and a browser alias only after --open.

Start & Stop

Command Description
deepseek Foreground mode (default): shows logs in a window; close the window or press Ctrl+C to stop
deepseek -b Background mode: returns immediately while the service keeps starting; browser opens automatically when ready
deepseek --stop Stop the service (port 3080; only kills DeepSeek Harness processes) and remind how to restart; a failed kill or wait timeout fails loudly with a nonzero exit code

Status & Logs

Command Description
deepseek --status Show service state (READY / STARTING / UNHEALTHY / FOREIGN_PORT / FAILED / STOPPED); STARTING covers download/install and FAILED includes the log path
deepseek --status --json Print the same state as versioned JSON (with timestamps and stable fields); problem states (FAILED / UNHEALTHY / FOREIGN_PORT) exit nonzero for scripting
deepseek --logs [N] Show the last N lines of the background log (default 20), e.g. deepseek --logs 50
deepseek --logs --follow [N] Follow the log (Ctrl+C to stop); reconnects automatically after rotation. Long-running background logs rotate to a single .old generation once they exceed 5 MB

Authentication & browsers

Command Description
deepseek --open Open the authenticated URL for the current ready instance in the system default browser
deepseek --open edge Open the current instance in Edge; chrome, firefox, brave, and default are also supported

--open only attaches to an instance already in READY; retry after startup completes. It reuses the DSH process's authenticated entrypoint without disabling authentication or printing the token URL. Explicit browsers use their default profile; private windows and named profiles are not supported.

Version & Upgrades

Command Description
deepseek --version Show the launcher version and the active DeepSeek Harness version (reads the runtime-current.json pointer first, falls back to the legacy runtime dir, and lists other inactive sources)
deepseek --update Compare the active runtime version with the latest on npm and include the corresponding DeepSeek Harness GitHub Release tag page link; exits nonzero when the local version cannot be confirmed or the remote lookup fails - unknown is never treated as already latest
deepseek --upgrade One-click upgrade of the DeepSeek Harness runtime (flow and rollback see notes below)
deepseek --upgrade <version> Install and switch to a specific published version - higher or lower than the active one - for upgrading to a chosen version or rolling back from a newer one (reuses the --upgrade transaction)
deepseek --upgrade N List the active version plus the published DeepSeek Harness versions on npm (newest first; shows the newest 20 by default, deepseek --upgrade 0 lists all, deepseek --upgrade N lists the newest N) to pick a target version
deepseek --update-launcher Query the launcher's latest stable GitHub release and compare it with the local version (query only, no file changes)
deepseek --upgrade-launcher Self-update the launcher: download, verify, and transactionally replace the current install (flow and recovery see notes below)
  • Normal startup prefers the prepared and validated local DSH version and does not contact npm when a usable runtime exists; dependencies are prepared only for a first launch or repair without a usable runtime. Use deepseek --update to discover releases from npm and deepseek --upgrade to install and switch versions.
  • deepseek --update / deepseek --upgrade query the npm public registry directly (dist-tags or the published version list, both faster than npm view). To use a mirror or a private registry, set the DSH_REGISTRY environment variable (e.g. https://registry.npmmirror.com); it only affects remote release discovery, never local runtime startup.
  • deepseek --upgrade without a version in detail: it resolves and validates the target version first; if the current runtime is healthy and already at least the target version, it reports "already latest" and exits without stopping the service or running npm; otherwise it stops the service, clears old DSH npx workspaces, syncs the global dsh command, and restarts in background. If the candidate fails because a plugin imports an export removed from DSH or its plugin manifest is incompatible with the target DSH (plugin tree failed to load), it lists the incompatible plugins and asks whether to remove them from the web profile; after confirmation it runs the target version's dsh plugin --profile web remove command and retries the candidate; declining or failing the repair falls back through current, previous, or legacy usable runtimes (only runtimes that pass readiness validation are used for rollback).
  • deepseek --upgrade also syncs the global dsh command: it syncs it to the target version when installed or installs it when missing, so the dsh command stays in line with the launcher; a failure here only prints a warning and never blocks the launcher runtime upgrade. If the target version cannot be resolved or is invalid, the upgrade aborts before stopping anything and leaves the current install untouched.
  • deepseek --upgrade <version> constraints and flow: the target must be an exact published npm version, in either direction (upgrade to a newer version or roll back to an older one); an unpublished target or a malformed version aborts before the service is stopped and leaves the current install untouched. The switch reuses the --upgrade transaction (stop the service → clear old DSH npx workspaces → sync the global dsh command → restart in background and validate) and also moves the global dsh command to the target version; the plugin handling and runtime fallback chain on a failed candidate match --upgrade. A target equal to the active version is a no-op that never stops the service. The version list shows the newest 20 by default and prints how to obtain the full list when truncated; targets are always validated against the complete version list, so the display count only affects printing.
  • deepseek --upgrade-launcher in detail: verify the release package's SHA-256 and manifest → take the maintenance mutex → back up the old install directory → place the new version → run an offline smoke check → commit; it refuses while a service is running, a DSH upgrade is in progress, in a source worktree, or for unmanaged installs; failures restore the old version automatically (an incomplete restore keeps the backup plus a recovery script and exits with code 2).

Diagnosis & Uninstall

Command Description
deepseek --check Environment diagnosis: launcher install and version, Node/npm, active runtime and pointer, service state and port 3080 owner, plus the last recorded failure; exits nonzero when it finds a problem
deepseek --uninstall Remove the deepseek command from the user PATH (unregister)
deepseek --uninstall --full Full uninstall: remove PATH + desktop shortcut + logs/runtime dir + install dir (transaction details see note below)
deepseek --help Show help
  • deepseek --uninstall --full transaction details: with confirmation — cancelling changes nothing; it stops the service first, moves directories to a backup before deletion; PATH is removed only after every directory is safely backed up; the install dir is validated against its ownership marker, and a failed cleanup keeps the backup with its location.

Other Ways to Start

The paths below bypass the deepseek command; pick whichever fits.

Built-in scripts

  • start-deepseek-harness.bat: foreground mode (starts the service + auto-opens the browser)
  • start-background.cmd: background startup progress window (closes automatically after a successful start, stays open with log details on failure)

Optional: the official DSH CLI

Install the DSH CLI globally only if you want to use the official dsh command directly from any terminal (dsh-launcher uses its own versioned runtime, so this step is not required):

npm install -g @deepseek-ai/dsh

Open a new terminal, then run:

dsh web

Opening the authenticated URL printed at startup confirms that it started successfully (press Ctrl+C to exit).

npm install -g @deepseek-ai/dsh registers dsh in npm's global executable directory (as dsh.cmd on Windows). A standard Node.js installation adds that directory to PATH; if dsh is still not found in a new terminal, check that the npm global directory is on PATH.

npx @deepseek-ai/dsh web can start DSH directly, but does not register the dsh command for use in any terminal.

FAQ

  • deepseek is not recognized as a command: run install-command.cmd first, then open a new terminal window
  • Stuck on download / network errors: switch to a mirror and retry: npm config set registry https://registry.npmmirror.com
  • deepseek --status shows STARTING: DSH is downloading or starting. Use deepseek --logs 50 to inspect progress; another deepseek -b will not submit a duplicate startup job.
  • deepseek --status shows FAILED: DSH exited before it listened on the port. Run deepseek --logs 50 for the error, then retry with deepseek -b.
  • deepseek --status shows UNHEALTHY: a DSH process listens on port 3080 but HTTP is not answering (it may have hung). Run deepseek --stop and start again.
  • deepseek --status shows FOREIGN_PORT: port 3080 is owned by a process that is not DeepSeek Harness. Free the port before starting; neither the launcher nor the stop logic will kill an unknown process.
  • Port 3080 is already in use (EADDRINUSE): an instance is already running — check with deepseek --status, or run deepseek --stop first
  • Another browser says dsh web authentication required: do not open the bare address; in a new terminal run deepseek --open edge (or use chrome, firefox, or brave)
  • Service stops when the foreground window closes: by design (the process lives in the console window); use deepseek -b for a persistent service
  • Migrate existing DSH settings (including API Key): copy the whole %USERPROFILE%\.dsh folder to C:\Users\<username>\.dsh on the new machine (contains sensitive credentials — do not share publicly)

Appendix: Files

For readers who want to understand each script's role or contribute; daily use only needs the commands above.

File Description
deepseek.cmd CLI entry: foreground / background / stop / status / check / help
start-deepseek-harness.bat Foreground launcher (starts the service + auto-opens browser)
start-background.cmd / .ps1 Background coordinator: supports immediate return or waiting for readiness; logs go to %USERPROFILE%\dsh-launch\dsh-background.log
stop-dsh.cmd / .ps1 Stop the service (finds the process by port 3080)
open-when-ready.ps1 Polls the HTTP service and opens the browser when it is ready (900-second timeout)
open-dsh.ps1 Validates the current DSH instance and opens its authenticated Web URL in the default or selected browser
background-run.ps1 Owns the background startup lock, lifecycle state, log, readiness monitor, and DSH child process
background-run.cmd Compatibility entrypoint for the background runner; normal startup invokes background-run.ps1 directly
run-dsh.ps1 Serializes runtime preparation, completes required peers, audits the tree with npm ls --all, and starts the Node entrypoint
update-check.ps1 Version comparison: active runtime pointer vs latest on npm, including the corresponding DeepSeek Harness GitHub Release tag page link (other sources are informational only)
update-launcher.ps1 Launcher self-update: query / download / verify the GitHub release and transactionally replace the current install (--update-launcher / --upgrade-launcher)
dsh-doctor.ps1 Implementation of the deepseek --check environment diagnosis
dsh-logs.ps1 Implementation of deepseek --logs viewing and follow mode (rotation-aware reconnect)
dsh-maintenance-lock.ps1 Launcher maintenance mutex shared by overwrite install, DSH upgrade, self-update and full uninstall
version-info.ps1 Implementation of the deepseek --version version source (active pointer first)
register-path.ps1 Implementation of the user PATH registration behind install-command.cmd
upgrade-dsh.ps1 One-click upgrade: stop service, clear legacy DSH npx workspaces, prepare and start the latest runtime; with -TargetVersion it switches to a specific published version (newer or older)
set-shortcut.ps1 Create or migrate the desktop shortcut to the visible startup progress window
uninstall.ps1 Uninstall: remove PATH registration (-Full also removes shortcut / logs and runtime / install dir)
install-command.cmd Adds this folder to the user PATH and registers the deepseek command
VERSION Launcher version (read by deepseek --version)
deepseek.ico DeepSeek Harness black whale icon (16-256px, multiple sizes; used by the desktop shortcut)
deepseek.svg Vector source of the icon (from the DSH web frontend favicon; regenerate the .ico from it)

License

MIT