555 字
3 分钟
DeepSeek Harness 安装与桌面应用封装指南

DeepSeek Harness 是由 DeepSeek 团队新开发的 AI 开发工具,本教程将带你完成从安装到封装为桌面应用的全过程。

1. 环境检查#

首先确保你的系统安装了 Node.js v24 或更高版本。

按 Win 键输入 cmd 回车,在终端中运行:

Terminal window
node -v

如果显示 v24.x.x 或更高版本即可。如果没有安装,请访问 nodejs.org 下载 LTS 版本。

2. 安装 DeepSeek Harness#

使用 npm 全局安装,推荐使用国内镜像加速:

Terminal window
npm i -g @deepseek-ai/dsh --registry=https://registry.npmmirror.com

会非常漫长,静等,

3. 启动服务#

运行以下命令启动 DeepSeek Harness Web 服务:

Terminal window
dsh web

终端会显示出访问地址,形如 http://127.0.0.1:3080(以实际为准)。

4. 使用方法#

在浏览器中打开上述地址,填入你的 DeepSeek API Key(可在 platform.deepseek.com 获取),即可开始使用。

5. 封装桌面应用(可选)#

将 DeepSeek Harness 封装为桌面应用,可以获得更好的使用体验。

5.1 创建项目目录#

新建文件夹 dsh-desktop,创建以下两个文件:

package.json

{
"name": "dsh-desktop",
"version": "1.0.0",
"main": "main.js",
"scripts": {
"start": "electron ."
}
}

main.js 使用 AI 编写的。我懒得演了,能用就行

const { app, BrowserWindow, dialog } = require("electron");
const { exec, spawn } = require("child_process");
const path = require("path");
let mainWindow;
let dshProcess;
function createWindow() {
mainWindow = new BrowserWindow({
width: 1200,
height: 800,
title: "DeepSeek Harness", // 可选
webPreferences: {
nodeIntegration: false,
contextIsolation: true,
},
});
const checkServer = () => {
fetch("http://127.0.0.1:3080") // 自行修改
.then(() => {
mainWindow.loadURL("http://127.0.0.1:3080");
})
.catch(() => {
setTimeout(checkServer, 500);
});
};
checkServer();
mainWindow.on("closed", () => {
mainWindow = null;
if (dshProcess) {
dshProcess.kill();
}
app.quit();
});
}
app.whenReady().then(() => {
dshProcess = spawn("dsh", ["web"], { // 自行修改,你也可以使用 npx 启动
shell: true,
detached: false,
});
createWindow();
});
app.on("window-all-closed", () => {
if (dshProcess) {
dshProcess.kill();
}
app.quit();
});

5.2 安装 Electron#

换源

Terminal window
set ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/
npm i --registry=https://registry.npmmirror.com

5.3 创建桌面快捷方式#

在桌面右键 → 新建 → 快捷方式:

  • 目标:\dist\electron.exe
  • 参数:"xxx\dsh-desktop"
  • 起始位置:xxx\dsh-desktop

5.4 验证#

双击快捷方式测试,能弹窗就行。

结尾#

就当水一期了。没招了

教程

连载中

第 5 篇,共 6 篇本文属于系列

DeepSeek Harness 安装与桌面应用封装指南
https://x0.fan/posts/install-deepseek-harness/
作者
殘月
发布于
2026-08-13
许可协议
CC BY-NC-SA 4.0

分享文章

生成精美分享图或复制链接,与更多人分享本文。

继续阅读

沿着主题读

基于共同的标签与分类

换条路线

从其他文章中稳定抽取

评论

正在加载评论...

最后更新于 ,距今已过 68 天

部分内容可能已过时