# Conflicts: # .agents/notes/implemented/process/2026-07-13-documentation-site-projection.md # docs/AGENTS.md # docs/rfc/INDEX.md # docs/user/develop/basic/index.zh.md # docs/user/develop/basic/tool.zh.md # docs/user/develop/framework/index.zh.md # docs/user/develop/framework/service.zh.md # docs/user/develop/practice/index.zh.md # docs/user/guide/index.zh.md # docs/user/guide/quickstart.zh.md # knip.json # package.json # pnpm-lock.yaml # scripts/doc-typecheck.ts # scripts/gen-website-api.ts # scripts/translation-pairing.manifest.json # scripts/verify-type-equiv.ts # website/zh-CN/api/cordis/context.md # website/zh-CN/api/cordis/events.md # website/zh-CN/api/cordis/fiber.md # website/zh-CN/api/cordis/registry.md # website/zh-CN/api/cordis/service.md # website/zh-CN/api/harness/agent-loop.md # website/zh-CN/api/harness/agents.md # website/zh-CN/api/harness/approval.md # website/zh-CN/api/harness/bash-env.md # website/zh-CN/api/harness/bash.md # website/zh-CN/api/harness/code-runtime.md # website/zh-CN/api/harness/compact.md # website/zh-CN/api/harness/events.md # website/zh-CN/api/harness/fs.md # website/zh-CN/api/harness/llm.md # website/zh-CN/api/harness/permission.md # website/zh-CN/api/harness/sandbox.md # website/zh-CN/api/harness/session-persistence.md # website/zh-CN/api/harness/session-query.md # website/zh-CN/api/harness/sessions.md # website/zh-CN/api/harness/skills.md # website/zh-CN/api/harness/spill-store.md # website/zh-CN/api/harness/subagents.md # website/zh-CN/api/harness/system-prompt.md # website/zh-CN/api/harness/tasks.md # website/zh-CN/api/harness/token-meter.md # website/zh-CN/api/harness/tools.md # website/zh-CN/api/harness/user-interaction.md # website/zh-CN/api/harness/web.md # website/zh-CN/api/harness/workflows.md # website/zh-CN/api/index.md # website/zh-CN/design/effects-coeffects.md # website/zh-CN/design/index.md # website/zh-CN/guide/config.md
2.0 KiB
2.0 KiB
快速开始
English | 中文
本指南带你在 5 分钟内跑起一个 Agent。
环境准备
# Check versions
node -v # v22.19.x, or v24.x and newer
corepack enable
pnpm -v # 11.x
第一步:运行 echo-agent
echo-agent 不需要 API key,装好依赖就能跑。
# Clone the repository
git clone https://github.com/deepseek-harness/deepseek-harness.git
cd deepseek-harness
# Install dependencies
pnpm install
# Start echo-agent
pnpm run demo:echo
启动后你会看到:
echo-agent ready. Type a message ("echo <text>" triggers the tool).
>
试着输入:
> echo hello world
你会看到模型发起了一次 tool call(工具调用),echo 工具将文本转为大写并返回:
[tool call] echo({"text":"hello world"})
[tool result] ECHO: HELLO WORLD
恭喜!环境没问题。
第二步:使用真实模型调用
接下来接入真实的 DeepSeek 模型,跑一个完整的命令行 Agent。
获取 API Key
前往 DeepSeek Platform 获取你的 API key。
配置环境变量
在仓库根目录创建 .env 文件(已被 gitignore):
DEEPSEEK_API_KEY=sk-your-key-here
启动 repl-agent
pnpm run demo:repl
agent REPL ready. Give it a coding task.
>
这就是一个完整的编程助手,它能读写文件、跑命令、拆分子任务。
试着给它一个任务:
> Create hello.js in the current directory, print "Hello from Harness!", and run it
回头看
echo-agent 和 repl-agent 用的是同一个应用框架(@deepseek-ai/dsh-stdio-demo),区别只在 cordis.yml——换了哪些插件、填了什么配置。你以后定制自己的 Agent 也是同样的方式。