oxgbl/dsh-no-cmd-launcher

DSH background launcher: double-click icon to run dsh web without any cmd window, plus desktop start/stop shortcuts (npm/CLI installs, no DSH Desktop dependency)

项目介绍Project Overview

DSH后台启动工具,为纯CLI安装dsh的用户提供免cmd的静默启动方案。双击桌面图标即可后台运行dsh web,自动打开浏览器,支持停止、开机自启及端口配置。适用于Windows+Node.js环境,需dsh命令在PATH中。注意:需确保3080端口未被占用。

A Windows launcher for DSH that starts the service silently in the background without a cmd window, ideal for users who installed dsh via npm or other pure CLI methods. Double-click a desktop icon to launch dsh web, auto-open the browser, and keep it running after closing the terminal. Includes stop, auto-start, and port configuration. Requires Windows, Node.js, and dsh in PATH. Caveat: ensure port 3080 is free.

或使用命令行安装(适合开发者)Or use CLI install (for developers)

命令行安装CLI Install

dsh plugin --profile web add github:oxgbl/dsh-no-cmd-launcher

oxgbl/dsh-no-cmd-launcher 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

DSH 后台启动工具(免 cmd,适配纯 CLI / npm 安装)

给习惯在 cmd / 终端里敲 dsh web 的人用:双击桌面图标即可后台静默启动 DSH, 不出现任何 cmd 窗口,关掉终端也不影响运行,启动完成后自动打开浏览器界面。

本工具不依赖 DSH Desktop 桌面应用,适用于通过 npm 等纯 CLI 方式安装 dsh 的用户。

前置条件

  • Windows + Node.js(dsh 命令行工具运行所需)
  • 已安装 dsh 且 dsh 命令在 PATH 中(例如 npm install -g @deepseek-ai/dsh, 以你实际的安装方式为准)。验证:在 cmd 里执行 dsh --version 能输出版本号。

文件说明

文件 作用
start-dsh.ps1 核心启动器(端口可改,见下文)
stop-dsh.ps1 停止器:只结束本工具拉起的后台服务(node.exe / DSH Desktop.exe 进程树)
start-dsh.vbs 无窗口外壳(快捷方式指向它,零闪烁)
stop-dsh.vbs 无窗口外壳(停止用)
install-shortcuts.ps1 一键安装桌面快捷方式(图标自动取 DSH Desktop.exe → node.exe → 系统默认)
README.md 本文档

安装(一次性)

在 PowerShell 里执行(或右键 install-shortcuts.ps1 → “使用 PowerShell 运行”):

powershell -ExecutionPolicy Bypass -File "本目录\install-shortcuts.ps1"

可选参数:

  • -AutoStart:额外注册开机自启(登录后静默后台启动 DSH)
  • -Uninstall:移除桌面快捷方式与自启项

装完桌面上会出现两个图标:DSH 后台启动DSH 后台停止

使用

  • DSH 后台启动
    • DSH 已在运行(3080 或 6338 端口有服务)→ 直接打开浏览器,不会开第二个实例
    • 未运行 → 无窗口后台启动 dsh web --port 3080,就绪后自动打开浏览器。
  • DSH 后台停止:结束后台服务(按 PID 文件精确结束进程树,安全)。

配置(可选)

编辑 start-dsh.ps1 顶部几行:

  • $Port = 3080:服务端口,与 cmd 里 dsh web 的默认端口一致。
  • $AltPort = 6338:备用检测端口——该端口上已有 DSH(如桌面版)在跑时,直接打开它。
  • 日志:%USERPROFILE%\.dsh\dsh-web-background.log
  • 进程记录:%USERPROFILE%\.dsh\dsh-web-background.pid

原理

start-dsh.vbs(wscript,本身无窗口)以隐藏方式调用 PowerShell (-WindowStyle Hidden),PowerShell 先通用解析 PATH 里的 dsh 命令 (npm shim 是 dsh.cmd),再以 cmd /c call "dsh.cmd" web --port 3080 >> 日志 2>&1CreateNoWindow(无窗口)+ 日志重定向 方式启动 dsh web,进程与调用者完全脱离—— 所以没有 cmd 窗口,关掉任何终端也不影响它。就绪后脚本把监听端口的进程 PID 写入 dsh-web-background.pidstop-dsh.ps1 据此 taskkill /T 结束进程树。

常见问题

  • 点了没反应? 看日志 %USERPROFILE%\.dsh\dsh-web-background.log
  • 提示"未找到 dsh 命令"? 确认已 npm install -g @deepseek-ai/dsh(或你的安装方式) 且 bin 目录在 PATH;重开一个终端验证 dsh --version
  • 启动超时? 多半是 3080 被其它程序占用,改 $Port 后重试。
  • 本机同时装了 DSH Desktop? 桌面版端口是动态的,启动器会自动检测其主进程 正在监听的端口并直接打开它(不会重复启动);两者共用同一套浏览器界面。 检测失败时则退回静态端口检查($AltPort)。
上一个 Prev dsh-desktop 下一个 Next dsh-cite