dlssjdyka0019/dsh-launcher

桌面端Desktop ⭐ 2 MIT 客户端与启动器Clients & Launchers

管理多个隔离的 DeepSeek Harness (DSH) 实例的 Windows 桌面工具

项目介绍Project Overview

DSH Launcher 是 Windows 桌面托盘工具,用于集中管理多个隔离的 DeepSeek Harness 实例,支持创建、启动、停止、删除及配置复制,并通过 WebSocket 实时查看日志。核心能力是每个实例拥有独立 $DSH_HOME 目录与配置,互不干扰,配合单端口 :4750 WebUI 统一管控。适用于同时运行多套 DSH 环境进行开发、测试或插件调试的场景。注意:当前仅支持 Windows 平台,且需 Go 1.23+、Node.js 22.19+、pnpm 等本地构建依赖。

DSH Launcher is a Windows system tray application for centrally managing multiple isolated DeepSeek Harness instances. It supports creating, starting, stopping, deleting instances, and copying configurations, with real-time WebSocket log streaming. Its core capability is providing each instance an independent $DSH_HOME directory and DSH installation copy, isolated from others, managed through a unified :4750 web dashboard. Use it when running multiple DSH environments in parallel for development, testing, or plugin debugging. Note: it currently supports only Windows and requires Go 1.23+, Node.js 22.19+, and pnpm for local building.

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

命令行安装CLI Install

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

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

READMEREADME

DSH Launcher

管理多个隔离的 DeepSeek Harness (DSH) 实例的 Windows 桌面工具

Go React Vite License dsh-plugin

DSH Launcher 是一个 Windows 系统托盘应用,用于管理多个隔离的 DeepSeek Harness 实例。每个实例拥有独立的配置、插件和模型目录,互不干扰。

开发者的话
本软件纯 DSH + DeepSeek-V4-Flash 制作,开发者一行代码没看。
开发初衷是 DSH 加插件崩溃了每次要用 Codex 修,现在可以让 DSH 自己修了。
不要问为什么后端是 Go 前端不直接用 Go,因为前端 AI 用 Go 写不明白,我让 AI 换个技术重写了。
作者是个看见黑窗口(CLI / 命令行终端)就会死的人,所以软件提供了 DSH 快速安装和 DSH 依赖的快速安装。
秉持着 DSH 轻量化、插件化的精神,同样采取了 WebUI(前端美术风格也差不多)。

功能

  • 多实例管理 — 创建、启动、停止、删除多个 DSH 实例
  • 实例隔离 — 每个实例拥有独立的 $DSH_HOME 目录和 DSH 安装副本
  • 配置复制 — 从一个实例复制配置到另一个,快速搭建开发环境
  • 实时日志 — WebSocket 实时流式查看实例日志,支持过滤和搜索
  • 运行中实例发现 — 自动扫描系统中已在运行的 DSH 实例
  • 系统托盘 — Windows 托盘图标,快速访问实例列表
  • 主题支持 — 深色/浅色/跟随系统
  • 单端口架构 — 统一管理界面端口 :4750

快速开始

前置条件

工具 版本要求
Go >= 1.23
Node.js >= 22.19.0
pnpm >= 7.11.0
Git >= 2.0
DeepSeek Harness 任意版本

构建

# 完整构建
.\scripts\build.ps1

# 开发模式(前端 HMR 热更新)
.\scripts\build.ps1 -Dev

运行

# 正常模式(带系统托盘)
.\build\dsh-launcher.exe

# 无头模式(仅 HTTP API)
.\build\dsh-launcher.exe --headless

# 前端开发模式(终端 1:Go 后端)
.\build\dsh-launcher.exe --headless --dev-frontend http://localhost:4751

# 前端开发模式(终端 2:Vite HMR)
cd web
pnpm run dev

打开 http://127.0.0.1:4750 即可使用。

架构

dsh-launcher.exe (Go 二进制)
├── 系统托盘 (getlantern/systray)
│   ├── Open Dashboard
│   ├── 实例列表(动态更新)
│   └── Quit(确认退出)
├── HTTP 服务器 (chi)
│   ├── REST API /api/*
│   ├── WebSocket /api/instances/{id}/logs
│   ├── 发现接口 /api/discover
│   └── React SPA /*(内嵌或代理到 Vite)
└── 实例管理器
    ├── 实例创建/删除/启动/停止
    ├── Node.js 子进程管理
    ├── 配置深拷贝(settings + credentials + profiles)
    ├── 实例注册表 JSON 持久化
    └── 运行中实例发现 (discover.go)

实例隔离

每个实例拥有独立的 $DSH_HOME 目录,所有实例共享同一 DSH 构建产物(不重复 clone):

~/.dsh-launcher/instances/
  ├── <instance-id>/
  │   ├── settings.yaml              ← 独有配置
  │   ├── .credentials.yaml          ← 独有凭据
  │   ├── profiles/                  ← 独有 profile 配置
  │   ├── sessions/                  ← 独有会话数据
  │   ├── storages/                  ← 独有存储数据
  │   └── .dsh-install/              ← 独有 DSH 安装副本
  │       ├── apps/cli/              ← 复制
  │       ├── packages/              ← 复制
  │       ├── vendor/                ← 复制
  │       └── node_modules/          ← junction → 共享安装目录
  └── ...

DSH 进程启动命令

$env:DSH_HOME = "~/.dsh-launcher/instances/<id>"
node <DSH_INSTALL_DIR>/apps/cli/lib/bin.js web --port <PORT> --no-open

配置复制

  • 深拷贝:settings.yaml、.credentials.yaml、profiles/、.agent-presets/
  • 不拷贝:sessions/、storages/(历史数据不共享)
  • 插件也要能复制:profiles 目录包含完整的 bundle 配置

端口管理策略

  • 默认起始端口:3080
  • 自动递增直到找到空闲端口
  • 用户可自定义端口
  • 启动器管理界面端口:4750(可配置)

进程管理

  • 每个 DSH 实例 = 独立 Node.js 子进程
  • 启动器关闭不影响运行中的 DSH 实例
  • 停止实例:先 SIGTERM,超时 10s 后强制 SIGKILL
  • 日志捕获:stdout + stderr 分开记录,带时间戳

运行中实例发现

  • 通过 wmic 扫描 Node.js 进程命令行,匹配 bin.js / dsh 关键字
  • 通过 TCP 端口扫描常见 DSH 端口(3080-3085, 3100, 3200)
  • 发送 HTTP 请求验证是否为 DSH Web UI
  • 在仪表盘底部展示已发现的实例,支持一键打开

API 接口

方法 路径 说明
GET /api/instances 列出所有实例
POST /api/instances 创建新实例
GET /api/instances/{id} 获取实例详情
PUT /api/instances/{id} 更新实例元数据
DELETE /api/instances/{id} 删除实例
POST /api/instances/{id}/start 启动实例
POST /api/instances/{id}/stop 停止实例
POST /api/instances/{id}/copy-config 复制配置到实例
WS /api/instances/{id}/logs WebSocket 日志流
GET /api/discover 发现已在运行的 DSH 实例
GET /api/env 环境检测状态
POST /api/env/install-dsh 获取 DSH 安装指引
POST /api/env/build-dsh 获取 DSH 构建指引
GET /api/settings 获取启动器设置
PUT /api/settings 更新启动器设置
GET /api/versions 列出已注册的 DSH 版本
POST /api/versions 注册 DSH 版本
DELETE /api/versions/{id} 删除 DSH 版本
POST /api/versions/download 下载并安装 DSH 版本

项目结构

dsh-launcher/
├── cmd/dsh-launcher/       # Go 入口
├── internal/
│   ├── api/                # HTTP API 处理
│   │   ├── router.go       # Chi 路由器 + 前端服务
│   │   ├── instances.go    # 实例 CRUD + WebSocket 日志
│   │   ├── env.go          # 环境检测 API
│   │   ├── settings.go     # 设置 API
│   │   └── versions.go     # 版本管理 API
│   ├── manager/            # 实例生命周期管理
│   │   ├── manager.go      # 实例注册表 + 持久化 + 配置复制
│   │   ├── instance.go     # 实例数据模型
│   │   ├── process.go      # Node.js 子进程管理
│   │   ├── discover.go     # 运行中实例发现
│   │   ├── version.go      # 版本管理器
│   │   └── version_download.go  # 版本下载器
│   ├── envdetect/          # 环境检测
│   │   └── detect.go       # 检测 Node.js/pnpm/Git/DSH
│   ├── config/             # 启动器配置
│   │   └── config.go       # 配置持久化
│   └── tray/               # Windows 系统托盘
│       └── tray.go         # Systray 集成
├── web/                    # React 前端源码
│   ├── src/
│   │   ├── App.tsx         # 根组件
│   │   ├── api/            # API 客户端
│   │   ├── hooks/          # React Hooks
│   │   ├── types/          # TypeScript 类型
│   │   └── components/     # 页面组件
│   ├── index.html
│   ├── vite.config.ts
│   └── package.json
├── webembed/               # Go embed 前端构建产物
│   ├── assets.go           # //go:embed dist/*
│   └── dist/               # 构建产物
├── scripts/
│   ├── build.ps1           # 构建脚本
│   └── download-deps.ps1   # 依赖下载脚本
├── go.mod
├── Makefile
└── LICENSE

技术栈

技术
后端 Go 1.23+, chi router, gorilla/websocket
前端 React 18, TypeScript, Vite 6, CSS Modules
托盘 getlantern/systray
样式 --dsw-* CSS 自定义属性体系

依赖清单

Go 依赖

用途
github.com/go-chi/chi/v5 HTTP 路由器
github.com/go-chi/cors CORS 中间件
github.com/getlantern/systray 系统托盘
github.com/gorilla/websocket WebSocket 实时日志流
github.com/google/uuid UUID 生成

前端依赖

用途
react ^18.3.1 UI 框架
react-dom ^18.3.1 DOM 渲染
clsx ^2.1.1 CSS 类名拼接
@vitejs/plugin-react ^4.3.4 Vite React 插件
typescript ^5.6.3 类型检查
vite ^6.0.0 构建工具

许可证

MIT

上一个 Prev DSH-Store 下一个 Next dsh-raven-research