docs: update dev agent guide with accurate CLI usage and Windows launcher
CI / test (push) Successful in 7s
CI / test (push) Successful in 7s
This commit is contained in:
+39
-7
@@ -92,19 +92,51 @@ git clone → pip install → pytest →
|
||||
|
||||
## Dev Agent 使用指南
|
||||
|
||||
### 方式 A: Claude Code Agent 模式
|
||||
### 前置:配置环境变量(一次性)
|
||||
|
||||
每次启动 Agent 前需要设置 Gitea API Token:
|
||||
|
||||
**Windows (双击启动):** 使用项目自带的 `scripts/start_dev_agent.bat`(见下方)
|
||||
|
||||
**Bash/WSL/Git Bash:**
|
||||
```bash
|
||||
export GITEA_API_TOKEN="59117246ec418d5d87042de073b0d4197d8054bf"
|
||||
export GITEA_URL="http://localhost:3000"
|
||||
export GITEA_REPO="pzhang_zywl/document_analyzer"
|
||||
```
|
||||
|
||||
### 方式 A: 单次任务模式
|
||||
|
||||
直接在命令行带上 Prompt 执行一次性任务:
|
||||
|
||||
```bash
|
||||
cd /c/Users/peterz/projects/document_analyzer
|
||||
export GITEA_API_TOKEN="你的token"
|
||||
export GITEA_URL="http://localhost:3000"
|
||||
export GITEA_REPO="pzhang_zywl/document_analyzer"
|
||||
|
||||
# 启动 Dev Agent
|
||||
claude -p --agent agents/DEV_AGENT.md \
|
||||
"检查 Gitea 有没有新的 agent-task 或 ci-failure 工单,有就领取并修复。"
|
||||
```
|
||||
|
||||
`-p` 表示非交互模式,执行完退出。适合手动触发或脚本调用。
|
||||
|
||||
### 方式 B: 持续轮询模式(推荐)
|
||||
|
||||
```bash
|
||||
cd /c/Users/peterz/projects/document_analyzer
|
||||
|
||||
claude -p --agent agents/DEV_AGENT.md \
|
||||
"用 loop 模式每 10 分钟检查一次 Gitea Issues,发现 agent-task 或 ci-failure 就处理。"
|
||||
```
|
||||
|
||||
Agent 会持续运行,每隔 10 分钟检查一次,有工单就干活。
|
||||
|
||||
### 方式 C: 交互模式
|
||||
|
||||
```bash
|
||||
cd /c/Users/peterz/projects/document_analyzer
|
||||
claude --agent agents/DEV_AGENT.md
|
||||
```
|
||||
|
||||
对 Agent 说: "检查 Gitea 有没有新的待处理工单,有就处理。"
|
||||
进入交互会话后,对 Agent 说:"检查 Gitea Issues 并处理。"
|
||||
|
||||
### 方式 B: Claude Code 内作为子 Agent
|
||||
|
||||
@@ -112,7 +144,7 @@ claude --agent agents/DEV_AGENT.md
|
||||
|
||||
> 用 DEV_AGENT.md 检查 http://localhost:3000/pzhang_zywl/document_analyzer/issues 有没有待处理工单
|
||||
|
||||
### 方式 C: 任何其他 Agent
|
||||
### 方式 D: 任何其他 Agent
|
||||
|
||||
任何支持终端命令的 AI Agent 都可以通过 `agent_poller.py` 与 Gitea 交互:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user