@gnawbit/tabretake 0.4.0 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +95 -83
- package/README.md +112 -100
- package/README.zh-CN.md +105 -87
- package/SKILL.md +38 -60
- package/examples/site/style.css +81 -71
- package/examples/story.json +1 -2
- package/package.json +12 -3
- package/references/rendering.md +8 -1
- package/schemas/story.schema.json +606 -610
- package/scripts/cli.mjs +6 -3
- package/scripts/demo.mjs +7 -1
- package/scripts/doctor.mjs +11 -3
- package/scripts/init.mjs +77 -3
- package/scripts/lib/browser.mjs +65 -3
- package/scripts/lib/captions.mjs +8 -3
- package/scripts/lib/options.mjs +9 -0
- package/scripts/lib/system-browser.mjs +30 -0
- package/scripts/lib/themes.mjs +125 -0
- package/scripts/plan.mjs +138 -116
- package/scripts/record.mjs +6 -4
- package/scripts/render.mjs +76 -37
package/README.zh-CN.md
CHANGED
|
@@ -6,28 +6,61 @@
|
|
|
6
6
|
[](package.json)
|
|
7
7
|
[](https://github.com/gnawbit/tabretake/releases/latest)
|
|
8
8
|
[](SKILL.md)
|
|
9
|
+
[](https://github.com/gnawbit/tabretake/stargazers)
|
|
9
10
|
|
|
10
|
-
|
|
11
|
+
**自动化生成 Web 应用演示。从此告别手动录屏与繁琐剪辑。**
|
|
11
12
|
|
|
12
|
-
|
|
13
|
+
把可编辑的 JSON 步骤或 AI 编程助手的指令,直接转化为丝滑的 **16:9 README 动图 (GIF)** 与 **9:16 竖屏发布视频 (MP4)** —— 自带点击自动平滑放大、光标波纹和**不遮挡页面内容的底部字幕区**。界面改版后,一行命令全自动重拍重渲染。
|
|
13
14
|
|
|
14
|
-
|
|
15
|
+
<img src="docs/hero.gif" alt="TabRetake 录制 Vikunja 看板:创建任务、跨列拖拽并聚焦结果" width="100%">
|
|
15
16
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
*实测录制于 [Vikunja v2.8.0](https://github.com/go-vikunja/vikunja)(15k★ 开源看板):输入任务、在真实看板上将卡片拖入 Doing、自动将镜头推进聚焦到结果。单次录制同时生成 16:9 MP4、README 动图与 9:16 竖屏短片。*
|
|
18
|
+
|
|
19
|
+
[项目页](https://gnawbit.github.io/tabretake/) · [观看演示](docs/hero.mp4) · [安装](#安装) · [工作原理](#工作原理) · [真实实测展台](#-真实开源项目实测展台-real-world-showcase) · [路线图](#路线图)
|
|
20
|
+
|
|
21
|
+
### 📊 核心工程规格一览
|
|
22
|
+
|
|
23
|
+
| 维度 | 规格说明 |
|
|
24
|
+
|---|---|
|
|
25
|
+
| **运行环境与协议** | Node.js `>=20.9.0`,MIT 协议,100% 本地运行(无云端上传、无遥测收集) |
|
|
26
|
+
| **浏览器引擎** | Playwright Chromium,支持未执行 `setup` 时自动回退本机 **Chrome / Edge**(`--browser auto`) |
|
|
27
|
+
| **双输入模式** | (1) 实时网页 URL + 可编辑 JSON 步骤(支持 `init --auto`) · (2) 已有录屏(OBS/QuickTime)+ 时间标记 `marks` |
|
|
28
|
+
| **输出产物** | `16:9` 1080p MP4、`README GIF`(约 400–900 KB)、`9:16` 竖屏 MP4/GIF、PNG 封面、`record.json` 时间线 |
|
|
29
|
+
| **内置品牌主题** | `midnight`(暗夜紫)、`daylight`(浅色极简)、`paper`(暖纸复古)、`slate`(石板翠绿) |
|
|
30
|
+
| **平台与智能体** | Windows、macOS、Linux · 支持 Claude Code、Codex、Cursor 及所有 [Agent Skills](https://agentskills.io) 客户端 |
|
|
31
|
+
|
|
32
|
+
### ⚡ 为什么选择 TabRetake?
|
|
33
|
+
|
|
34
|
+
| 常见痛点 | 传统手动录屏与剪辑 | TabRetake 自动化工作流 |
|
|
35
|
+
|---|---|---|
|
|
36
|
+
| **界面改版重录** | 手工重新操作、重新剪辑、补字幕(耗费 2 小时+) | 修改 1 行 JSON 或让 Agent 重跑(`tabretake render`,10秒搞定) |
|
|
37
|
+
| **竖屏发布 (9:16)** | 画面裁切变形或需重新单独录制 | 单次录制同时导出 16:9 与 9:16,支持竖屏独立放大倍率 |
|
|
38
|
+
| **字幕遮挡操作** | 悬浮字幕遮挡输入框或按钮 | 自动按源比例适配留白,字幕固定居于内容下方 |
|
|
39
|
+
| **多端与自动化** | 纯人工操作,无法纳入自动化流程 | 本地 Playwright CLI + AI 编程助手(Claude Code / Cursor / Codex) |
|
|
19
40
|
|
|
20
41
|
故事文件与代码一起保存,界面更新后即可重新生成演示。
|
|
21
42
|
已有录屏也可配合时间标记渲染相同产物,无需浏览器自动化;详见[用已有录屏](#用已有录屏)。
|
|
22
43
|
|
|
23
|
-
|
|
24
|
-
|
|
44
|
+
### 🚀 零等待极速体验(自动适配本机 Chrome/Edge)
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
npm install --global @gnawbit/tabretake@0.4.2
|
|
48
|
+
tabretake demo --preset daylight
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
> 电脑上装有 Chrome 或 Edge 即可直接开跑,无需等待下载额外浏览器。若需固定版本的独立 Chromium,可随时运行 `tabretake setup`。
|
|
52
|
+
|
|
53
|
+
### 🎯 真实开源项目实测展台 (Real-World Showcase)
|
|
25
54
|
|
|
26
|
-
|
|
27
|
-
和产物成功情况,不将这些测试当作外部采用。
|
|
55
|
+
拒绝虚假的 AI 蓝紫色假模版。TabRetake 在具有复杂 DOM 与真实交互的前端项目中深度验证:
|
|
28
56
|
|
|
29
|
-
|
|
30
|
-
|
|
57
|
+
| 📋 [Vikunja](https://gnawbit.github.io/tabretake/vikunja/) (15k★ 看板协作) | ✍️ [Memos](https://gnawbit.github.io/tabretake/memos/) (35k★ 知识笔记) | 📝 [TodoMVC](https://gnawbit.github.io/tabretake/todomvc/) (前端通用标准) |
|
|
58
|
+
|:---:|:---:|:---:|
|
|
59
|
+
| <a href="https://gnawbit.github.io/tabretake/vikunja/"><img src="docs/poster.png" alt="Vikunja 看板拖拽" width="100%"></a> | <a href="https://gnawbit.github.io/tabretake/memos/"><img src="docs/examples/memos.png" alt="Memos 富文本与搜索" width="100%"></a> | <a href="https://gnawbit.github.io/tabretake/todomvc/"><img src="docs/examples/todomvc.png" alt="TodoMVC 任务过滤" width="100%"></a> |
|
|
60
|
+
| **真实看板跨列拖拽**<br>复杂交互与目标卡片聚焦 | **富文本录入与检索**<br>真实 contenteditable 与标签联动 | **标准任务状态流**<br>经典 ES6 实现与完成项筛选 |
|
|
61
|
+
| [故事 JSON](site/vikunja/story.json) · [完整复现教程](https://gnawbit.github.io/tabretake/vikunja/) | [故事 JSON](site/memos/story.json) · [完整复现教程](https://gnawbit.github.io/tabretake/memos/) | [故事 JSON](site/todomvc/story.json) · [完整复现教程](https://gnawbit.github.io/tabretake/todomvc/) |
|
|
62
|
+
|
|
63
|
+
> 本地原生运行于 Windows、macOS 与 Linux。支持 Claude Code、Codex、Cursor,以及任何支持 [Agent Skills](https://agentskills.io) 的 agent。
|
|
31
64
|
|
|
32
65
|
---
|
|
33
66
|
|
|
@@ -62,21 +95,19 @@ TabRetake 是在本地生成可重复网页演示的 CLI 和 Agent Skill。用
|
|
|
62
95
|
|
|
63
96
|
## 安装
|
|
64
97
|
|
|
65
|
-
|
|
98
|
+
从 npm 安装 CLI。
|
|
66
99
|
|
|
67
100
|
```bash
|
|
68
|
-
npm install --global
|
|
69
|
-
tabretake setup
|
|
101
|
+
npm install --global @gnawbit/tabretake@0.4.2
|
|
70
102
|
tabretake demo
|
|
71
103
|
```
|
|
72
104
|
|
|
73
|
-
要求 Node 20.9
|
|
74
|
-
|
|
75
|
-
ffmpeg/ffprobe 随依赖安装。
|
|
105
|
+
要求 Node 20.9+。在工作目录运行 `tabretake`,内置示例会将结果写入 `./demo`。
|
|
106
|
+
若未安装 Playwright Chromium,TabRetake 会自动回退调用本机已安装的 Chrome 或 Edge(`--browser auto`);
|
|
107
|
+
需要固定版本浏览器时运行 `tabretake setup`(Linux 缺系统依赖时加 `--with-deps`)。ffmpeg/ffprobe 随依赖安装。
|
|
76
108
|
|
|
77
|
-
包名为 `@gnawbit/tabretake
|
|
78
|
-
|
|
79
|
-
安装新版后,现有 JSON 故事可以直接用 `tabretake` 运行。
|
|
109
|
+
包名为 [`@gnawbit/tabretake`](https://www.npmjs.com/package/@gnawbit/tabretake)。
|
|
110
|
+
旧版本(`v0.4.0` 及更早 / `demo-reel`)兼容性说明见 [版本兼容性指南](docs/compatibility.md)。
|
|
80
111
|
|
|
81
112
|
参与开发时,从源码安装:
|
|
82
113
|
|
|
@@ -84,7 +115,6 @@ ffmpeg/ffprobe 随依赖安装。
|
|
|
84
115
|
git clone https://github.com/gnawbit/tabretake
|
|
85
116
|
cd tabretake
|
|
86
117
|
npm ci
|
|
87
|
-
node bin/tabretake.mjs setup
|
|
88
118
|
node bin/tabretake.mjs doctor
|
|
89
119
|
```
|
|
90
120
|
|
|
@@ -93,7 +123,7 @@ node bin/tabretake.mjs doctor
|
|
|
93
123
|
CLI 环境就绪后,可安装 agent 工作流:
|
|
94
124
|
|
|
95
125
|
```bash
|
|
96
|
-
npx skills@1.9.0 add "https://github.com/gnawbit/tabretake.git#v0.4.
|
|
126
|
+
npx skills@1.9.0 add "https://github.com/gnawbit/tabretake.git#v0.4.2" --skill tabretake
|
|
97
127
|
```
|
|
98
128
|
|
|
99
129
|
在目标项目中运行,可加 `--agent codex`、`--agent claude-code` 或 `--agent cursor`
|
|
@@ -103,7 +133,7 @@ npx skills@1.9.0 add "https://github.com/gnawbit/tabretake.git#v0.4.0" --skill t
|
|
|
103
133
|
Claude Code 也可以通过插件安装(命令行版本需 2.1.292+):
|
|
104
134
|
|
|
105
135
|
```bash
|
|
106
|
-
claude plugin install tabretake --marketplace "gnawbit/tabretake#v0.4.
|
|
136
|
+
claude plugin install tabretake --marketplace "gnawbit/tabretake#v0.4.2"
|
|
107
137
|
```
|
|
108
138
|
|
|
109
139
|
两种工作流安装方式任选其一;插件仍需先安装上述 TabRetake 运行环境。
|
|
@@ -126,18 +156,15 @@ node bin/tabretake.mjs doctor
|
|
|
126
156
|
# 2. 跑一遍内置 demo
|
|
127
157
|
node bin/tabretake.mjs demo
|
|
128
158
|
|
|
129
|
-
# 3.
|
|
130
|
-
|
|
131
|
-
|
|
159
|
+
# 3. 录你自己的产品(支持 --auto 自动生成步骤,--preset 选择主题)
|
|
160
|
+
tabretake init --url https://your-app.com --auto --preset daylight
|
|
161
|
+
tabretake record --config demo.json
|
|
162
|
+
tabretake render --config demo/record.json --vertical
|
|
132
163
|
```
|
|
133
164
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
v0.3.3 起,`label` 来自 ARIA 引用或 HTML 标签;原生下拉框的 `options`
|
|
139
|
-
包含 `label`、`value` 和 `disabled`,方便识别控件与选项。`name` 仍是 HTML 属性,
|
|
140
|
-
`selector` 是建议使用的 CSS 定位器。这是 DOM 清单,不是完整的无障碍树。
|
|
165
|
+
`init --auto` 会自动扫描目标网页,识别可见的输入框与按钮,直接生成一段包含输入、点击和字幕的多步骤演示故事。
|
|
166
|
+
若不加 `--auto` 则生成初始占位模板。也可用 `tabretake plan --url <url>` 查看完整的 DOM 控件清单(包含 ARIA/HTML `label` 与原生 `<select>` `options`)。
|
|
167
|
+
`name` 仍是 HTML 属性,`selector` 是建议使用的 CSS 定位器。这是 DOM 清单,不是完整的无障碍树。
|
|
141
168
|
|
|
142
169
|
```bash
|
|
143
170
|
node bin/tabretake.mjs record --config demo.json
|
|
@@ -215,18 +242,12 @@ demo/
|
|
|
215
242
|
|
|
216
243
|
动作:`wait`、`goto`、`click`、`type`、`hover`、`focus`、`drag`、`scroll`、`press`、`waitFor`、`screenshot`。
|
|
217
244
|
|
|
218
|
-
|
|
219
|
-
使用毫秒,默认 20,000;持续阻挡会返回 `STEP_TIMEOUT`。v0.3.2 及更早版本
|
|
220
|
-
没有这项可靠的可点击等待。
|
|
245
|
+
`click` 会等待目标启用且不被遮挡(步骤 `timeout` 使用毫秒,默认 20,000;持续阻挡会返回 `STEP_TIMEOUT`)。
|
|
221
246
|
|
|
222
247
|
定位字段为 `selector`、`role` + `name`(或 `text`)、`name` 或 `text`。
|
|
223
|
-
显式 `selector`
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
每个候选取首个可见元素。标签重复或重叠时,使用限定范围的 CSS 选择器。
|
|
227
|
-
v0.3.3 及更早版本可能让部分匹配的按钮先于精确匹配的链接:页面同时有
|
|
228
|
-
“Clear completed” 按钮时,用 `selector: "a[href='#/completed']"`
|
|
229
|
-
代替单独的 `text: "Completed"`。
|
|
248
|
+
显式 `selector` 优先。匹配顺序为:精确按钮/链接 $\to$ 部分匹配按钮/链接 $\to$ 普通文字(先精确后部分)。
|
|
249
|
+
指定 `role` 时只在该角色中匹配,名称同样先精确后部分;每个候选取首个可见元素。标签重复或重叠时,建议使用限定范围的 CSS 选择器。
|
|
250
|
+
历史版本匹配差异见[版本兼容性指南](docs/compatibility.md)。
|
|
230
251
|
|
|
231
252
|
技巧:
|
|
232
253
|
|
|
@@ -252,11 +273,14 @@ v0.3.3 及更早版本可能让部分匹配的按钮先于精确匹配的链接
|
|
|
252
273
|
`render --config demo/record.json --poster-at 4.5` 覆盖,无需重新录制。
|
|
253
274
|
时间从裁剪后成片的第 0 秒开始,必须小于视频时长。
|
|
254
275
|
|
|
255
|
-
###
|
|
276
|
+
### 主题预设与竖屏品牌配置
|
|
256
277
|
|
|
257
|
-
|
|
278
|
+
支持在配置中选择内置主题 `brand.preset`(`midnight`、`daylight`、`paper`、`slate`),或在渲染时通过 `--preset <name>` 一键切换皮肤。显式指定的 `brand.background` / `brand.accent` 会覆盖预设颜色(除非传入命令行 `--preset`)。
|
|
258
279
|
|
|
259
280
|
```json
|
|
281
|
+
"brand": {
|
|
282
|
+
"preset": "daylight"
|
|
283
|
+
},
|
|
260
284
|
"vertical": {
|
|
261
285
|
"badge": "你的产品",
|
|
262
286
|
"titleLines": ["一句话钩子", "第二行补充"],
|
|
@@ -269,10 +293,13 @@ v0.3.3 及更早版本可能让部分匹配的按钮先于精确匹配的链接
|
|
|
269
293
|
`titleLines` 最多两行;`watermark: false` 会去掉底部的小 TabRetake 水印。
|
|
270
294
|
中文会自动用 CJK 字体。
|
|
271
295
|
|
|
272
|
-
|
|
273
|
-
`plan --viewport 390x844` 检查布局,再用相同 viewport 录制。
|
|
274
|
-
|
|
275
|
-
|
|
296
|
+
横屏(16:9)与竖屏(9:16)均会按源视频比例自适应留白,并在画面下方留出专用字幕区。
|
|
297
|
+
移动端流程可先用 `plan --viewport 390x844` 检查布局,再用相同 viewport 录制。
|
|
298
|
+
使用 `--vertical --zoom 1 --vertical-zoom 1.8` 可保持横屏全景,单独放大竖屏焦点;
|
|
299
|
+
故事中的 `vertical.zoom` 可保存竖屏倍率,命令行参数优先;`zoom: false` 的步骤仍显示全景。放大后需检查是否裁掉必要上下文。
|
|
300
|
+
|
|
301
|
+
首次在自己的项目试用后,可[反馈首次演示结果](https://github.com/gnawbit/tabretake/issues/new?template=first-demo.yml),
|
|
302
|
+
失败同样有用。[试用与记录说明](docs/adoption.md)区分首次成功、重复使用和外部采用。
|
|
276
303
|
|
|
277
304
|
## 命令
|
|
278
305
|
|
|
@@ -282,55 +309,45 @@ v0.3.2 起,竖屏卡片按源视频比例适配。移动端流程可先用
|
|
|
282
309
|
| `tabretake capabilities --json` | 查询支持的命令、参数及 JSON 输出 |
|
|
283
310
|
| `tabretake doctor [--json]` | 检查 Node、Chromium、ffmpeg、字体 |
|
|
284
311
|
| `tabretake setup` | 安装与当前 CLI 匹配的 Chromium |
|
|
285
|
-
| `tabretake init --url <url
|
|
312
|
+
| `tabretake init --url <url> [--auto] [--preset <name>]` | 创建可编辑的故事文件(`--auto` 自动生成步骤,`--preset` 设置主题) |
|
|
286
313
|
| `tabretake validate --config demo.json [--json]` | 预检故事、录屏标记或录制时间线 |
|
|
287
314
|
| `tabretake plan --url <url>` | 截图 + 列出可交互元素 |
|
|
288
315
|
| `tabretake record --config demo.json` | 录制故事 |
|
|
289
316
|
| `tabretake preview --config demo.json` | 在可见浏览器中执行步骤,提前检查故事 |
|
|
290
|
-
| `tabretake render --config demo/record.json` | 渲染 MP4 + GIF |
|
|
317
|
+
| `tabretake render --config demo/record.json [--preset <name>]` | 渲染 MP4 + GIF |
|
|
291
318
|
| `tabretake serve` | 启动内置 demo 站点 |
|
|
292
|
-
| `tabretake demo` | 录制 + 渲染内置 demo |
|
|
319
|
+
| `tabretake demo [--preset <name>]` | 录制 + 渲染内置 demo |
|
|
320
|
+
|
|
321
|
+
### 🏷️ 徽标接入 (Project Badge)
|
|
322
|
+
|
|
323
|
+
如果你的开源项目已使用 TabRetake 制作发布演示或 README 动图,欢迎在 README 中嵌入徽标:
|
|
324
|
+
|
|
325
|
+
```markdown
|
|
326
|
+
[](https://github.com/gnawbit/tabretake)
|
|
327
|
+
```
|
|
293
328
|
|
|
294
329
|
Agent 可用 `capabilities --json` 和 `doctor --json` 获取标准输出上的单个 JSON
|
|
295
330
|
对象,包含 `schemaVersion: 1` 和已安装版本。诊断包含稳定的 `id`、`required`、
|
|
296
331
|
`status`,失败时提供修复提示 `hint`。必需检查失败返回退出码 `1`;缺少字体仅警告,
|
|
297
|
-
必需项通过时退出码仍为 `0
|
|
298
|
-
JSON 工作流及配置校验需要 v0.3.0 或更新版本。
|
|
332
|
+
必需项通过时退出码仍为 `0`。浏览器仅检查是否存在,不实际启动。
|
|
299
333
|
|
|
300
|
-
`doctor`
|
|
334
|
+
`doctor` 检查整个工具链。渲染现有录屏或已保存的时间线不需要浏览器;
|
|
301
335
|
若唯一失败的必需项是 `chromium`,可跳过浏览器安装,继续 `validate` 和
|
|
302
|
-
`render
|
|
336
|
+
`render`,其他必需项错误仍需先修复。网页规划和录制使用固定 Chromium 或本机 Chrome/Edge。
|
|
303
337
|
|
|
304
338
|
录制前运行 `validate --config demo.json --json`,按随包提供的
|
|
305
|
-
[JSON Schema](schemas/story.schema.json)
|
|
306
|
-
|
|
307
|
-
`/steps/0/action`)、`message` 和 `hint`;JSON 语法或文件读取错误使用 `error` 对象。
|
|
308
|
-
预检不会启动浏览器,也不验证选择器、登录态或媒体文件是否可用。
|
|
309
|
-
`record` 和 `render` 也会在改写输出文件前校验输入。编辑器补全可在配置中加入
|
|
339
|
+
[JSON Schema](schemas/story.schema.json) 检查类型、动作、必需目标和未知字段
|
|
340
|
+
(`record` 与 `render` 在改写输出前也会自动校验)。编辑器补全可在配置中加入
|
|
310
341
|
`"$schema": "https://raw.githubusercontent.com/gnawbit/tabretake/main/schemas/story.schema.json"`。
|
|
311
342
|
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
`init`、`plan`、`record`、`render` 也支持 `--json`:标准输出只有一个结果对象,
|
|
315
|
-
进度写入标准错误。成功结果包含 `command`、`ok`、`version`、`schemaVersion`,
|
|
316
|
-
以及列出绝对路径、类型、字节数的 `artifacts`。步骤失败提供从零开始的
|
|
317
|
-
`error.step.index`、动作、JSON Pointer 路径及修复提示,修正后再重试。
|
|
343
|
+
`init`、`plan`、`record`、`render` 均支持 `--json`(标准输出返回结果对象,进度写入 stderr)。
|
|
344
|
+
导航异常返回 `PAGE_UNREACHABLE` 或 `PAGE_HTTP_ERROR` 且不回显敏感 URL;动作完成后字幕即刻显示并在 `pause` 期间保持。
|
|
318
345
|
手动 `--login` 需在交互终端运行且不带 `--json`,自动调用使用 `--storage-state`。
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
v0.3.1 起将页面导航失败报告为 `PAGE_UNREACHABLE`,提示检查
|
|
322
|
-
URL、服务和网络;HTTP 4xx/5xx 返回 `PAGE_HTTP_ERROR` 与 `error.status`,
|
|
323
|
-
避免把错误页录成成功演示。这类错误不回显目标 URL 中的凭据或查询参数。
|
|
324
|
-
`doctor` 只检查依赖,不能证明目标应用可访问。
|
|
325
|
-
|
|
326
|
-
v0.3.2 起,手动 `--login` 的导航异常也不回显目标 URL;HTTP 401/403
|
|
327
|
-
页面会保留供登录,其他 HTTP 错误会停止命令。
|
|
328
|
-
|
|
329
|
-
v0.3.1 起已修正字幕时序:动作完成即显示字幕,随后 `pause` 留出阅读时间。
|
|
330
|
-
v0.3.0 可用 `pause: 0` 加独立 `wait` 步骤代替。旧时间线需重新录制才能获得
|
|
331
|
-
新时序,仅重新渲染会保留原时间戳。
|
|
346
|
+
旧版本历史兼容细节见[版本兼容性指南](docs/compatibility.md)。
|
|
332
347
|
|
|
333
348
|
```bash
|
|
349
|
+
--browser auto # auto(固定 Chromium 或自动回退本机 Chrome/Edge)、chromium、chrome、msedge
|
|
350
|
+
--preset daylight # 主题预设:midnight(默认)、daylight、paper、slate
|
|
334
351
|
--login # 打开有头浏览器,手动登录一次
|
|
335
352
|
--storage-state auth.json
|
|
336
353
|
--proxy http://127.0.0.1:10808
|
|
@@ -382,12 +399,13 @@ node bin/tabretake.mjs record --config demo.json --storage-state auth.json
|
|
|
382
399
|
接入自己的应用时,替换应用检出与启动命令、就绪检测地址和故事文件。
|
|
383
400
|
使用可重置的演示数据,并在发布前检查成片。
|
|
384
401
|
|
|
385
|
-
|
|
|
386
|
-
|
|
387
|
-
|
|
|
402
|
+
| 真实开源案例 | 上游项目 | 故事脚本 | 输出产物 |
|
|
403
|
+
|---|---|---|---|
|
|
404
|
+
| Vikunja 看板 (Hero) | [go-vikunja/vikunja](https://github.com/go-vikunja/vikunja) (15k★) | [site/vikunja/story.json](site/vikunja/story.json) | [16:9 MP4](docs/hero.mp4) · [9:16 MP4](docs/hero-9x16.mp4) · [GIF](docs/hero.gif) |
|
|
405
|
+
| Memos 知识库 | [usememos/memos](https://github.com/usememos/memos) (35k★) | [site/memos/story.json](site/memos/story.json) | [GIF](docs/examples/memos.gif) · [封面](docs/examples/memos.png) |
|
|
406
|
+
| TodoMVC 经典标准 | [tastejs/todomvc](https://github.com/tastejs/todomvc) (ES6) | [site/todomvc/story.json](site/todomvc/story.json) | [GIF](docs/examples/todomvc.gif) · [封面](docs/examples/todomvc.png) |
|
|
388
407
|
|
|
389
|
-
|
|
390
|
-
README 动图、首次创建项目,以及重复生成发布素材。从源码目录运行(全局安装可将前缀替换为 `tabretake`):
|
|
408
|
+
如需在不下载任何上游项目的前提下快速体验,TabRetake 也内置了三个虚构应用预设(readme、onboarding、release),执行 `tabretake demo` 即可体验。从源码目录运行(全局安装可将前缀替换为 `tabretake`):
|
|
391
409
|
|
|
392
410
|
```bash
|
|
393
411
|
node bin/tabretake.mjs demo --story readme --port 0 --out demo-readme
|
|
@@ -474,9 +492,9 @@ Linux 用 Noto Sans CJK。`doctor` 会检查。
|
|
|
474
492
|
|
|
475
493
|
- [x] 9:16 竖屏导出
|
|
476
494
|
- [x] 已有录屏输入(`--video` + `marks`)
|
|
495
|
+
- [x] 多套品牌预设(`midnight`、`daylight`、`paper`、`slate`)
|
|
477
496
|
- [ ] 配音(TTS)
|
|
478
497
|
- [ ] 设备边框(iPhone、Android、macOS)
|
|
479
|
-
- [ ] 多套品牌预设
|
|
480
498
|
- [ ] 云端渲染
|
|
481
499
|
|
|
482
500
|
## 参与贡献
|
package/SKILL.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: tabretake
|
|
3
|
-
description: Create repeatable product demo videos and README GIFs from a web app URL or an existing screen recording. Use when asked for a launch video, browser walkthrough, signup or onboarding demo, or to regenerate a demo after UI changes, including 产品演示、网页录屏、README
|
|
3
|
+
description: Create repeatable product demo videos, screen recording walkthroughs, and README GIFs (16:9 and 9:16 portrait) from a web app URL or an existing screen recording. Use when asked for a launch video, browser walkthrough, signup or onboarding demo, vertical short video, or to regenerate a demo after UI changes, including 产品演示、网页录屏、README 动图、竖屏宣传视频. Runs locally with Playwright + FFmpeg, zero cloud upload, and supports dark/light theme presets. Not for browser test assertions, text-to-video generation, or general audio/video editing.
|
|
4
4
|
license: MIT
|
|
5
5
|
metadata:
|
|
6
6
|
author: gnawbit
|
|
7
|
-
version: "0.4.
|
|
7
|
+
version: "0.4.2"
|
|
8
8
|
repository: https://github.com/gnawbit/tabretake
|
|
9
|
-
compatibility: Node.js 20.9+, Chromium via tabretake setup, Windows/macOS/Linux. Target app access is required. Rendering is local
|
|
9
|
+
compatibility: Node.js 20.9+, local Chrome/Edge or Chromium via tabretake setup, Windows/macOS/Linux. Target app access is required. Rendering is local.
|
|
10
10
|
---
|
|
11
11
|
|
|
12
12
|
# TabRetake by gnawbit
|
|
@@ -18,20 +18,18 @@ After `waitFor`, use a `focus` step with a selector, caption and pause to frame
|
|
|
18
18
|
result instead of the last clicked control. Inspect the rendered clip for framing.
|
|
19
19
|
|
|
20
20
|
Create a repeatable product walkthrough from a web URL, or render an existing
|
|
21
|
-
screen recording with supplied timestamps.
|
|
21
|
+
screen recording with supplied timestamps. Canonical project:
|
|
22
22
|
https://github.com/gnawbit/tabretake.
|
|
23
|
-
Outputs are local MP4, GIF and PNG posters in landscape and optional portrait.
|
|
23
|
+
Outputs are local MP4, GIF and PNG posters in landscape (16:9) and optional portrait (9:16).
|
|
24
|
+
For legacy release notes (`v0.4.0` and earlier / `demo-reel`), see [compatibility](docs/compatibility.md).
|
|
24
25
|
|
|
25
26
|
## Locate and check the CLI
|
|
26
27
|
|
|
27
|
-
Use an installed `tabretake` CLI when available.
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
[CLI installation instructions](https://github.com/gnawbit/tabretake#install).
|
|
33
|
-
The renamed CLI and Skill are available together in v0.4.0. Releases through
|
|
34
|
-
`v0.3.3` use the command and Skill name `demo-reel`.
|
|
28
|
+
Use an installed `tabretake` CLI when available. For a source checkout, replace
|
|
29
|
+
`tabretake` with `node /absolute/path/to/tabretake/bin/tabretake.mjs` (quote paths with spaces).
|
|
30
|
+
If missing, install with `npm install --global @gnawbit/tabretake@0.4.2`.
|
|
31
|
+
When Playwright Chromium is absent, TabRetake automatically falls back to local
|
|
32
|
+
Chrome or Edge (`--browser auto`), or you can install pinned Chromium via `tabretake setup`.
|
|
35
33
|
|
|
36
34
|
```bash
|
|
37
35
|
tabretake --version
|
|
@@ -39,28 +37,22 @@ tabretake capabilities --json
|
|
|
39
37
|
tabretake doctor --json
|
|
40
38
|
```
|
|
41
39
|
|
|
42
|
-
Query capabilities before choosing flags
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
`setup --with-deps`. Rendering an existing recording or saved timeline does not
|
|
48
|
-
need Chromium: if `chromium` is the only failed required check, continue to
|
|
49
|
-
validate/render without installing a browser. Fix other required errors first.
|
|
50
|
-
Node.js 20.9+ is required. Chinese captions need a CJK system font.
|
|
40
|
+
Query `capabilities --json` before choosing flags. `doctor --json` reports required
|
|
41
|
+
errors and optional font warnings; it checks browser presence without launching one.
|
|
42
|
+
Rendering an existing recording or saved timeline does not need a browser: if `chromium`
|
|
43
|
+
is the only failed required check, continue to `validate` and `render`. Fix other
|
|
44
|
+
required errors first. Node.js 20.9+ is required; Chinese captions need a CJK system font.
|
|
51
45
|
|
|
52
46
|
## Choose the input
|
|
53
47
|
|
|
54
|
-
- **Web app:** confirm the URL and intended flow.
|
|
55
|
-
it does not write a story. Use a test account and non-sensitive demo data.
|
|
48
|
+
- **Web app:** confirm the URL and intended flow. Use a test account and non-sensitive demo data.
|
|
56
49
|
- **Existing recording:** get the file and moments to highlight. Read
|
|
57
50
|
[recording input and branding](references/rendering.md); do not invent marks.
|
|
58
51
|
- **Example requested:** `tabretake demo --story readme|onboarding|release --port 0`
|
|
59
|
-
runs a fictional bundled app
|
|
52
|
+
runs a fictional bundled app (not evidence of external adoption).
|
|
60
53
|
|
|
61
|
-
Ask only for missing details that affect the result, such as the target flow
|
|
62
|
-
|
|
63
|
-
state changes are usually enough for a short launch clip.
|
|
54
|
+
Ask only for missing details that affect the result, such as the target flow,
|
|
55
|
+
theme preset (`midnight`, `daylight`, `paper`, `slate`), or output orientation.
|
|
64
56
|
|
|
65
57
|
## Record a web flow
|
|
66
58
|
|
|
@@ -68,48 +60,34 @@ state changes are usually enough for a short launch clip.
|
|
|
68
60
|
|
|
69
61
|
```bash
|
|
70
62
|
tabretake plan --url https://your-app.com --out plan.json --json
|
|
71
|
-
tabretake init --url https://your-app.com --out demo.json --json
|
|
63
|
+
tabretake init --url https://your-app.com --out demo.json --auto --preset midnight --json
|
|
72
64
|
```
|
|
73
65
|
|
|
74
|
-
2. Read the plan file from its returned artifact path.
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
The plan's `name` is an HTML attribute, not necessarily an accessible name;
|
|
82
|
-
use `selector` when needed.
|
|
83
|
-
On v0.3.3 and earlier, use a scoped selector for overlapping labels: a
|
|
84
|
-
“Clear completed” button can match `text: "Completed"` before that exact link.
|
|
85
|
-
v0.4.0 prefers exact button/link labels and respects an explicit role;
|
|
86
|
-
see [locator behavior](references/story.md) before relying on this change.
|
|
87
|
-
|
|
88
|
-
3. Validate, record and render:
|
|
66
|
+
2. Read the plan file from its returned artifact path. Inspect `--auto` steps or
|
|
67
|
+
replace starter steps with the requested flow. See [story authoring](references/story.md)
|
|
68
|
+
for actions, locators, and timing units. `plan` includes `label` (ARIA/HTML labels)
|
|
69
|
+
and native select `options`; `name` remains the HTML attribute. Use scoped `selector`
|
|
70
|
+
when labels repeat or overlap. `init` will not overwrite an existing story.
|
|
71
|
+
|
|
72
|
+
3. Validate, preview, record and render:
|
|
89
73
|
|
|
90
74
|
```bash
|
|
91
75
|
tabretake validate --config demo.json --json
|
|
76
|
+
tabretake preview --config demo.json --headless --json
|
|
92
77
|
tabretake record --config demo.json --out demo --json
|
|
93
78
|
tabretake render --config demo/record.json --vertical --json
|
|
94
79
|
```
|
|
95
80
|
|
|
96
|
-
Omit `--vertical` for landscape only; add `--no-gif`
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
inspect and record at a narrow viewport (for example `390x844`); use
|
|
103
|
-
`--zoom 1` to preserve the full viewport. Wide desktop text may still be small.
|
|
104
|
-
|
|
105
|
-
4. Inspect the poster and video, then return links to the actual generated
|
|
106
|
-
artifacts. Re-record after flow changes; re-render the saved timeline after
|
|
107
|
-
caption, zoom or branding changes. Fonts and encoder versions can affect
|
|
108
|
-
appearance across machines. Output videos have no audio.
|
|
81
|
+
Omit `--vertical` for landscape only; add `--no-gif` to skip GIFs; pass
|
|
82
|
+
`--preset daylight|paper|slate|midnight` to switch themes without re-recording;
|
|
83
|
+
pass `--browser chrome|msedge|chromium|auto` to pick a browser engine.
|
|
84
|
+
Use `--vertical --zoom 1 --vertical-zoom 1.8` to keep landscape overview while
|
|
85
|
+
enlarging portrait focus targets (`vertical.zoom` saves it in config; `zoom: false`
|
|
86
|
+
keeps full view). Record narrow viewports (e.g. `390x844`) for mobile flows.
|
|
109
87
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
88
|
+
4. Inspect the generated poster and video, then return clickable paths to the actual
|
|
89
|
+
artifacts. Re-record after flow changes; re-render `record.json` after caption,
|
|
90
|
+
zoom, or theme preset changes. Output videos have no audio.
|
|
113
91
|
|
|
114
92
|
## Interpret results and recover
|
|
115
93
|
|