feat: Add /kb-add command for quick video addition

- Add cmd_add() function to support adding single videos to inbox
- Support BV IDs, full URLs, and short links (with friendly warning)
- Add --process flag to immediately process after adding
- Add --yes flag to skip confirmation prompts
- Update SKILL.md with /kb-add command documentation
This commit is contained in:
OpenClaw Agent
2026-02-06 20:42:11 +08:00
parent 7e0acef4f9
commit ee18cde745
2 changed files with 168 additions and 0 deletions
+38
View File
@@ -11,6 +11,7 @@
| 命令 | 描述 | 用法 |
|------|------|------|
| `/kb-add` | 添加单个视频 | `/kb-add <URL> [--process] [--yes]` |
| `/kb-subscribe` | 订阅内容源 | `/kb-subscribe <source>:<type>:<id>` |
| `/kb-inbox` | 查看收件箱 | `/kb-inbox [--limit N]` |
| `/kb-process` | 处理内容 | `/kb-process [content_id]` |
@@ -20,6 +21,43 @@
## 命令详解
### /kb-add
快速添加单个视频到收件箱。
**用法:**
```
/kb-add BV1xx411c7mD
/kb-add "https://www.bilibili.com/video/BV1xx411c7mD"
/kb-add "https://www.bilibili.com/video/BV1xx411c7mD" --process
/kb-add BV1xx411c7mD --yes
```
**参数:**
- `<URL>` - 视频URL或BV号
- 完整URL: `https://www.bilibili.com/video/BVxxxxx`
- BV号: `BVxxxxx`
- 短链接: `https://b23.tv/xxxxx`(显示友好提示)
- `--process` - 添加后立即处理
- `--yes` - 跳过确认提示
**输出示例:**
```
📥 正在添加视频: BV1xx411c7mD
→ 标题: Python编程入门教程
→ UP主: CodeMaster
→ 时长: 3600秒
→ 获取字幕... ✅
✅ 视频已添加到收件箱!
Content ID: abc123def456
💡 使用以下命令处理:
python3 src/cli.py process abc123def456
或:
python3 src/cli.py process all
```
### /kb-subscribe
订阅一个内容源,支持自动获取更新。