2026-07-09 16:07:58 +08:00
|
|
|
|
# 快速开始
|
|
|
|
|
|
|
2026-07-15 18:08:28 +08:00
|
|
|
|
[English](quickstart.md) | 中文
|
|
|
|
|
|
|
2026-07-09 16:07:58 +08:00
|
|
|
|
本指南带你在 5 分钟内跑起一个 Agent。
|
|
|
|
|
|
|
|
|
|
|
|
## 环境准备
|
|
|
|
|
|
|
2026-07-13 15:38:47 +08:00
|
|
|
|
- [Node.js](https://nodejs.org/) ^22.19 或 >= 24
|
2026-07-20 19:26:04 +08:00
|
|
|
|
- 通过 Corepack 使用 [pnpm](https://pnpm.io/) 11
|
2026-07-20 20:16:41 +08:00
|
|
|
|
- [DeepSeek Platform](https://platform.deepseek.com/) API key
|
2026-07-09 16:07:58 +08:00
|
|
|
|
|
|
|
|
|
|
```sh
|
2026-07-20 19:26:04 +08:00
|
|
|
|
node -v
|
2026-07-13 15:38:47 +08:00
|
|
|
|
corepack enable
|
2026-07-20 19:26:04 +08:00
|
|
|
|
pnpm -v
|
2026-07-09 16:07:58 +08:00
|
|
|
|
```
|
|
|
|
|
|
|
2026-07-20 20:16:41 +08:00
|
|
|
|
## 第一步:安装并配置 API key
|
2026-07-09 16:07:58 +08:00
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
|
git clone https://github.com/deepseek-harness/deepseek-harness.git
|
|
|
|
|
|
cd deepseek-harness
|
|
|
|
|
|
pnpm install
|
|
|
|
|
|
```
|
|
|
|
|
|
|
2026-07-20 20:16:41 +08:00
|
|
|
|
在仓库根目录创建已被 Git 忽略的 `.env`:
|
2026-07-09 16:07:58 +08:00
|
|
|
|
|
2026-07-20 20:16:41 +08:00
|
|
|
|
```sh
|
|
|
|
|
|
DEEPSEEK_API_KEY=sk-your-key-here
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
## 第二步:运行一个 Headless 任务
|
2026-07-09 16:07:58 +08:00
|
|
|
|
|
2026-07-20 20:16:41 +08:00
|
|
|
|
运行一个非交互式任务并打印最终回答:
|
2026-07-09 16:07:58 +08:00
|
|
|
|
|
|
|
|
|
|
```sh
|
2026-07-20 20:16:41 +08:00
|
|
|
|
pnpm run demo:headless "summarize the architecture of this workspace"
|
2026-07-09 16:07:58 +08:00
|
|
|
|
```
|
|
|
|
|
|
|
2026-07-20 20:16:41 +08:00
|
|
|
|
Headless 运行一个完整的模型/工具轮次,持久化会话,打印结果后退出。需要规范事件流时可使用 `--output-format stream-json`。
|
|
|
|
|
|
|
|
|
|
|
|
## 第三步:使用 TUI
|
|
|
|
|
|
|
2026-07-20 19:26:04 +08:00
|
|
|
|
启动交互式 coding agent:
|
2026-07-09 16:07:58 +08:00
|
|
|
|
|
|
|
|
|
|
```sh
|
2026-07-20 19:26:04 +08:00
|
|
|
|
pnpm run demo:tui
|
2026-07-09 16:07:58 +08:00
|
|
|
|
```
|
|
|
|
|
|
|
2026-07-20 19:26:04 +08:00
|
|
|
|
这个全屏 Agent 可以读写文件、运行命令、分配子任务和跟踪计划。可以尝试:`Create hello.js in the current directory, print "Hello from Harness!", and run it`。
|
2026-07-09 16:07:58 +08:00
|
|
|
|
|
|
|
|
|
|
## 回头看
|
|
|
|
|
|
|
2026-07-29 13:58:21 +08:00
|
|
|
|
headless-agent 使用 `@deepseek-ai/dsh-cli-demo` app;交互式 `dsh` surface 则以 [`apps/cli/base.cordis.yml`](../../../apps/cli/base.cordis.yml) 叠加 `tui.cordis.yml` overlay 组合而成,不使用 app 组合包。二者加载同一个 providerless agent spine,并通过各自的 `cordis.yml` 为对应 surface 选择 DeepSeek 模型和能力插件。
|
2026-07-09 16:07:58 +08:00
|
|
|
|
|
|
|
|
|
|
## 下一步
|
|
|
|
|
|
|
2026-07-20 19:26:04 +08:00
|
|
|
|
- [配置文件](./config.md) — 了解 `cordis.yml` 的格式
|
|
|
|
|
|
- [开发插件](../develop/basic/) — 编写自己的 tool 或后端
|