mirror of
https://github.com/deepseek-ai/deepseek-harness
synced 2026-08-15 21:04:50 +00:00
1.9 KiB
1.9 KiB
快速开始
English | 中文
本指南带你在 5 分钟内跑起一个 agent(智能体)。
环境准备
- Node.js ^22.19 或 >= 24
- 通过 Corepack 使用 pnpm 11
- DeepSeek Platform API 密钥
node -v
corepack enable
pnpm -v
第一步:安装并配置 API 密钥
git clone https://github.com/deepseek-ai/deepseek-harness-sdk.git
cd deepseek-harness
pnpm install
pnpm run build
在仓库根目录创建已被 Git 忽略的 .env:
DEEPSEEK_API_KEY=sk-your-key-here
第二步:运行一个 Headless 任务
运行一个非交互式任务并打印最终回答:
pnpm run dsh run "summarize the architecture of this workspace"
dsh run 创建并持久化一个新会话,打印最终助手回答,然后退出。运行期间,stderr 会打印可用于观察该会话的本地浏览器 URL。
第三步:使用 Web UI
启动浏览器界面:
pnpm run dsh web
打开 http://127.0.0.1:3080。agent 可以读写文件、运行命令、分配子任务和跟踪计划。可以尝试:Create hello.js in the current directory, print "Hello from Harness!", and run it。
运行原理
dsh run 启动 headless profile:dsh-base、dsh-web-app 和 dsh-headless 在空根之上组合。dsh web 使用前两层,不包含一次性运行器。二者都会根据各自入口模式选择 DeepSeek 模型和能力插件。