diff --git a/README.md b/README.md index baafbaa6..76059554 100644 --- a/README.md +++ b/README.md @@ -495,6 +495,23 @@ dws chat message send-by-bot --robot-code BOT_CODE --group GROUP_ID \ +## DingTalk bot — connect a robot to your local AI + +`dws dev connect` bridges a DingTalk robot to a local AI CLI (Claude Code / Codex / opencode / Qoder / Gemini, or any tool via `--agent-cmd`): @-mention the bot in a chat and it answers using your local agent, keeping per-conversation multi-turn memory. + +```bash +dws dev connect --channel auto --robot-client-id --robot-client-secret +``` + +In-chat **session commands** (send the bare command as the whole message — no agent turn, no tokens): + +| Command | Effect | +|---------|--------| +| `/new` (aliases `/start`, `/reset`) | Start a fresh session; the previous one is left intact (resumable where the agent supports it) | +| `/clear` | Wipe the current session — disposed through the agent's real session op (opencode issues `DELETE /session/:id`); channels whose agent exposes no delete primitive fall back to a reset | + +See [`docs/robot-quickstart.md`](./docs/robot-quickstart.md) for the full 4-step walkthrough (install → create robot → connect → add to a group). + ## Key Services | Service | Command | Commands | Subcommands | Description | diff --git a/README_zh.md b/README_zh.md index 31e41a64..1c28fc96 100644 --- a/README_zh.md +++ b/README_zh.md @@ -491,6 +491,23 @@ dws chat message send-by-bot --robot-code BOT_CODE --group GROUP_ID \ +## 钉钉机器人 —— 把机器人接到你本地的 AI + +`dws dev connect` 把一个钉钉机器人接到本地 AI CLI(Claude Code / Codex / opencode / Qoder / Gemini,或用 `--agent-cmd` 接任意工具):群里 @ 机器人提问,它用你本地的 agent 回答,按会话保留多轮上下文。 + +```bash +dws dev connect --channel auto --robot-client-id --robot-client-secret +``` + +聊天里的**会话指令**(整条消息就是指令时生效,不消耗一次 AI 调用): + +| 指令 | 作用 | +|------|------| +| `/new`(别名 `/start`、`/reset`) | 开启新会话;旧会话保留(agent 支持的话仍可回溯) | +| `/clear` | 清空当前会话 —— 调 agent 真实会话原语真删(opencode 走 `DELETE /session/:id`);驱动接口没有删除原语的渠道退化为重置 | + +完整四步教程见 [`docs/robot-quickstart.md`](./docs/robot-quickstart.md)(装工具 → 建机器人 → 接上 AI → 拉进群)。 + ## 核心服务 | 服务 | 命令 | 命令数 | 子命令 | 描述 |