DeepSeek Harness 安装与桌面应用封装指南

555 字
3 分钟
DeepSeek Harness 安装与桌面应用封装指南
DeepSeek Harness 是由 DeepSeek 团队新开发的 AI 开发工具,本教程将带你完成从安装到封装为桌面应用的全过程。
1. 环境检查
首先确保你的系统安装了 Node.js v24 或更高版本。
按 Win 键输入 cmd 回车,在终端中运行:
node -v如果显示 v24.x.x 或更高版本即可。如果没有安装,请访问 nodejs.org 下载 LTS 版本。
2. 安装 DeepSeek Harness
使用 npm 全局安装,推荐使用国内镜像加速:
npm i -g @deepseek-ai/dsh --registry=https://registry.npmmirror.com会非常漫长,静等,
3. 启动服务
运行以下命令启动 DeepSeek Harness Web 服务:
dsh web终端会显示出访问地址,形如 http://127.0.0.1:3080(以实际为准)。
Warning
此终端窗口需保持开启状态,关闭后服务会停止。
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
换源
set ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/npm i --registry=https://registry.npmmirror.comWarning
如果安装完成后 dist 目录中没有 electron.exe,请手动下载:
- 下载 electron 运行时
- 解压到项目的
dist目录 - 在
dist目录下创建path.txt文件,内容为electron.exe
5.3 创建桌面快捷方式
在桌面右键 → 新建 → 快捷方式:
- 目标:
\dist\electron.exe - 参数:
"xxx\dsh-desktop" - 起始位置:
xxx\dsh-desktop
5.4 验证
双击快捷方式测试,能弹窗就行。
结尾
就当水一期了。没招了
文章分享
如果这篇文章对你有帮助,欢迎分享给更多人!
DeepSeek Harness 安装与桌面应用封装指南
https://x0.fan/posts/install-deepseek-harness/相关文章智能推荐
1
DeepSeek V4 Pro 正式版震撼发布
观点吓哭了。
2
OpenCode Zen 免费模型使用指南
教程如何在 OpenCode Zen 中白嫖免费的大语言模型
3
如何在 Linux 发行版上安装 Rust 开发环境
教程2026-07-30
4
在 Droidspaces 容器中安装 Niri
教程使用 Anland 渲染
5
如何在 2026 年安装 Ubuntu 26.04 LTS
教程从使用 U 盘安装,到系统部署
随机文章随机推荐
