dsh-autostart:用 DSH 插件开关管理 Windows 登录自启动

前言

在 Windows 上长期跑 DeepSeek Harness(dsh),常见做法是手动把桌面客户端加进「启动」文件夹,或自己改注册表 Run 项。这类做法和 dsh 的配置、插件生命周期是脱节的:换安装路径、重装客户端后条目容易失效,卸载时也容易留下脏数据。

dsh-autostart 是社区维护的 bundle 插件,把「是否开机自启」绑在 dsh 里「启用 / 禁用插件」这一操作上:启用时写入当前用户注册表,禁用时删掉同一条目,无需管理员权限。

这是什么

  • 名称:dsh-autostart(GitHub:LLL-lyh0/dsh-autostart,维护者 LLL-lyh0)
  • 分类:admin-security(社区目录归类)
  • 定位:Windows 下 DeepSeek Harness 的开机自启动 bundle;非 Windows 平台不执行注册表操作,仅记录日志说明仅支持 Windows。
  • 许可:MIT(package.json 版本 1.0.0)

与 npm 上同名包 dsh-autostart(Ghost011118/dsh-autostart)不是同一项目:后者侧重隐藏窗口启动 dsh web 并做崩溃重启监督;本插件通过标准 Windows 登录 Run 项注册当前运行的桌面客户端(process.execPath),且除一条 HKCU 值外不写其它持久化数据。

核心功能

启用插件时,向 HKCU\Software\Microsoft\Windows\CurrentVersion\Run 写入名为 DeepSeekHarnessAutoStart 的字符串值,指向当前 dsh 可执行路径;路径含空格时会按 Windows 要求加引号。禁用插件、卸载 bundle 或触发 Cordis 清理时,删除该注册表值。

操作 效果
启用 写入 DeepSeekHarnessAutoStart → 当前 process.execPath
禁用 / 卸载 删除上述注册表值
非 Windows 无操作(日志提示仅 Windows 支持)

实现上,index.js 为 Cordis host 插件(export function apply(ctx, config)):激活时用 execFileSync 调用 reg add(不经 shell,保证带空格路径的引号正确);通过 ctx.effect 注册清理,在真正 disable/unload 时执行删除。

安装与启用

npm 包名 dsh-autostart 已被其它项目占用,需从本仓库安装。README 给出两种方式。

Option A — 插件市场 / dshmarket

若你的 dsh 插件市场支持从 Git 仓库安装 bundle,将市场指向 https://github.com/LLL-lyh0/dsh-autostart,再在界面中启用 dsh-autostart 条目。

Option B — 克隆并在 profile 中 link

# 1. Clone somewhere stable
git clone https://github.com/LLL-lyh0/dsh-autostart.git

# 2. Add to your profile's package.json
#    "dependencies":         { "dsh-autostart": "link:D:/path/to/dsh-autostart" }
#    "dsh.profile.bundles":  [ ... , "dsh-autostart" ]

# 3. Link the package into the profile's node_modules
mklink /J "%USERPROFILE%\.dsh\profiles\<profile>\node_modules\dsh-autostart" "D:\path\to\dsh-autostart"

完成后重启 dsh。

环境要求

  • Windows(其它系统上插件不生效)
  • 支持 plugin/bundle 的 DeepSeek Harness profile

典型用法与验证

自启动触发时机是 Windows 用户登录,不是「重启 dsh 进程」本身。要验证行为,应注销再登录或重启系统,而不是仅重启 dsh。

启用插件后,可用下列命令检查注册表:

reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Run" /v DeepSeekHarnessAutoStart

期望输出形态(路径需带引号,因安装目录常含空格):

DeepSeekHarnessAutoStart    REG_SZ    "C:\...\DeepSeek Harness\DeepSeek Harness.exe"

卸载:在 dsh 中禁用插件或 remove_bundle,注册表值会被移除,插件不会写入其它文件或键。

适用场景与注意

适合:在 Windows 工作站上希望 dsh 桌面客户端随当前用户登录自动启动,且希望自启开关与 dsh profile / 插件管理一致的用户。

注意

  • 只修改当前用户 HKCU,不需要管理员权限;禁用即可撤销。
  • 插件以当前 dsh 进程上下文运行;安装前建议阅读仓库源码与 MIT 许可证,确认符合你的安全策略。
  • DeepSeek Harness 生态强调「一切皆插件」;社区插件目录(如 skillhub.cn)为独立站点,与 DeepSeek / 幻方无官方从属关系,安装来源以维护者仓库说明为准。

链接

  • 社区目录:https://www.skillhub.cn/plugins/LLL-lyh0/dsh-autostart
  • 源码与说明:https://github.com/LLL-lyh0/dsh-autostart
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

小夜