@gnawbit/tabretake 0.0.0-stage → 0.4.0
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 +83 -0
- package/LICENSE +21 -0
- package/README.md +534 -2
- package/README.zh-CN.md +493 -0
- package/SKILL.md +157 -0
- package/agents/openai.yaml +4 -0
- package/bin/demo-reel.mjs +2 -0
- package/bin/tabretake.mjs +12 -0
- package/examples/site/app.js +87 -0
- package/examples/site/index.html +168 -0
- package/examples/site/style.css +705 -0
- package/examples/stories/readme.json +34 -0
- package/examples/stories/release.json +48 -0
- package/examples/story-video.json +32 -0
- package/examples/story.json +46 -0
- package/package.json +61 -4
- package/references/rendering.md +72 -0
- package/references/story.md +80 -0
- package/schemas/story.schema.json +610 -0
- package/scripts/capabilities.mjs +22 -0
- package/scripts/cli.mjs +106 -0
- package/scripts/demo.mjs +39 -0
- package/scripts/doctor.mjs +83 -0
- package/scripts/init.mjs +46 -0
- package/scripts/lib/browser.mjs +208 -0
- package/scripts/lib/camera.mjs +63 -0
- package/scripts/lib/captions.mjs +39 -0
- package/scripts/lib/config.mjs +76 -0
- package/scripts/lib/ffmpeg.mjs +60 -0
- package/scripts/lib/fonts.mjs +36 -0
- package/scripts/lib/metadata.mjs +14 -0
- package/scripts/lib/navigation.mjs +26 -0
- package/scripts/lib/options.mjs +65 -0
- package/scripts/lib/report.mjs +42 -0
- package/scripts/lib/tty.mjs +18 -0
- package/scripts/plan.mjs +214 -0
- package/scripts/record.mjs +352 -0
- package/scripts/render.mjs +563 -0
- package/scripts/serve.mjs +74 -0
- package/scripts/setup.mjs +23 -0
- package/scripts/validate.mjs +18 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## Unreleased
|
|
4
|
+
|
|
5
|
+
## 0.4.0 — 2026-11-23
|
|
6
|
+
|
|
7
|
+
- Add story preview with step progress, JSON diagnostics and recording preservation, plus an explicit focus action for result elements.
|
|
8
|
+
- Include rich-text editors and ARIA textboxes in page plans.
|
|
9
|
+
|
|
10
|
+
- Rename the project to TabRetake. Install from `gnawbit/tabretake` at `v0.4.0` and use `tabretake` for the CLI, Agent Skill and Claude Code plugin. Stories and saved timelines can be reused. Tags through v0.3.3 use `demo-reel`.
|
|
11
|
+
- Add pinned Vikunja and Memos reproduction recipes and a manually triggered TodoMVC recording workflow with downloadable artifacts.
|
|
12
|
+
- Prefer exact button/link labels before partial controls and plain text, and keep explicit roles scoped, so a “Completed” link is not mistaken for a “Clear completed” button.
|
|
13
|
+
|
|
14
|
+
## 0.3.3 — 2026-11-23
|
|
15
|
+
|
|
16
|
+
- Wait for click targets to become actionable and report blocked clicks as step timeouts instead of successful recordings.
|
|
17
|
+
- Include form labels and native select options in page plans so Agents can identify controls without guessing from field values.
|
|
18
|
+
|
|
19
|
+
## 0.3.2 — 2026-11-23
|
|
20
|
+
|
|
21
|
+
- Redact target URLs from manual login navigation failures while keeping HTTP 401/403 pages available for sign-in.
|
|
22
|
+
- Fit portrait cards to the source aspect ratio so mobile and ultrawide recordings retain their edges at overview zoom.
|
|
23
|
+
- Clarify rendering prerequisites and platform-neutral publishing examples; correct native Agent evaluation failure evidence.
|
|
24
|
+
|
|
25
|
+
## 0.3.1 — 2026-11-23
|
|
26
|
+
|
|
27
|
+
- Start captions before action pauses so the pause provides reading time. Re-record older stories to adopt the corrected timestamps.
|
|
28
|
+
- Distinguish unreachable pages from HTTP errors, preserve failed navigation step locations and avoid echoing target URLs in these errors.
|
|
29
|
+
- Clarify public discovery and installation entrypoints; record independent Agent smoke tests with their limitations.
|
|
30
|
+
|
|
31
|
+
## 0.3.0 — 2026-11-23
|
|
32
|
+
|
|
33
|
+
- Shorten the Skill entrypoint with focused references; add client metadata, a plugin icon and verified installation guidance.
|
|
34
|
+
- Add JSON results and artifact manifests for init, plan, record and render; report failed recording steps and require interactive manual login.
|
|
35
|
+
- Upgrade Sharp to 0.35.5 for patched image libraries; require Node.js 20.9 or newer.
|
|
36
|
+
- Validate stories, marks and recorded timelines before execution; add a packaged JSON Schema and field-level JSON diagnostics.
|
|
37
|
+
- Add machine-readable diagnostics, version and capability queries; keep diagnostics usable when dependencies are missing.
|
|
38
|
+
- Wrap captions within the frame, prevent overlaps and preserve recording brightness under decorative frames.
|
|
39
|
+
- Ease click zooms and pans without cutting the timeline; configure timing with `zoomDuration` or `--zoom-duration`.
|
|
40
|
+
- Select poster frames with `posterAt` or `--poster-at`; default to a frame near the end and support short clips.
|
|
41
|
+
- Add runnable README GIF, onboarding and release demo recipes with `demo --story`.
|
|
42
|
+
|
|
43
|
+
## 0.2.0 — 2026-11-20
|
|
44
|
+
|
|
45
|
+
- Package the CLI as `@gnawbit/demo-reel` with an explicit runtime file list.
|
|
46
|
+
- Add `setup` and support running the installed demo outside the source checkout.
|
|
47
|
+
- Add `init --url` to create an editable story without overwriting existing files.
|
|
48
|
+
- Improve skill task matching, input/output guidance and installation instructions.
|
|
49
|
+
- Exclude password field values from page plans and logs.
|
|
50
|
+
- Scroll targets into view before browser interactions and use the demo server's actual port.
|
|
51
|
+
- Validate packaged installation, recording and rendering on Linux, Windows and macOS.
|
|
52
|
+
|
|
53
|
+
## 0.1.0 — 2026-11-04
|
|
54
|
+
|
|
55
|
+
First public version.
|
|
56
|
+
|
|
57
|
+
### Added
|
|
58
|
+
|
|
59
|
+
- `plan` — screenshot and inventory buttons, links and inputs
|
|
60
|
+
- `record` — Playwright recording with a fake cursor, click ripple and events
|
|
61
|
+
- `render` — 1080p MP4, GIF and poster with auto-zoom, captions, browser frame
|
|
62
|
+
and a generated background
|
|
63
|
+
- 9:16 vertical export (`--vertical`) with a card frame, top label and larger
|
|
64
|
+
bottom captions
|
|
65
|
+
- Configurable vertical badge, title lines, subtitle and CTA
|
|
66
|
+
- Captions stay on screen until the next caption for easier reading
|
|
67
|
+
- Screen-recording input (`--video` + normalized `marks`) for sites that block
|
|
68
|
+
automation and for desktop/mobile apps
|
|
69
|
+
- `drag` steps for sliders, carousels and comparison handles
|
|
70
|
+
- Automatic CJK font selection for Chinese captions
|
|
71
|
+
- Page-load pre-roll is trimmed from the final video
|
|
72
|
+
- `demo` — one-command end-to-end demo on the bundled app
|
|
73
|
+
- `doctor` — Node, Chromium, ffmpeg, ffprobe and font checks
|
|
74
|
+
- Login flow via `--login` and reusable `auth.json`
|
|
75
|
+
- Story format: `wait`, `goto`, `click`, `type`, `hover`, `scroll`, `press`,
|
|
76
|
+
`waitFor`, `screenshot`
|
|
77
|
+
- Agent skill instructions in `SKILL.md`
|
|
78
|
+
- Demo site, hero GIF/MP4 and architecture diagram
|
|
79
|
+
|
|
80
|
+
### Known limitations
|
|
81
|
+
|
|
82
|
+
- Screen-recording marks are manual; automatic click detection is not included
|
|
83
|
+
- No voiceover or music
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 gnawbit
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,535 @@
|
|
|
1
|
-
#
|
|
1
|
+
# TabRetake — repeatable web app demo videos
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
English · [简体中文](README.zh-CN.md)
|
|
4
|
+
|
|
5
|
+
[](LICENSE)
|
|
6
|
+
[](package.json)
|
|
7
|
+
[](https://github.com/gnawbit/tabretake/releases/latest)
|
|
8
|
+
[](SKILL.md)
|
|
9
|
+
[](https://github.com/gnawbit/tabretake/stargazers)
|
|
10
|
+
|
|
11
|
+
**Record your web app as a README GIF or portrait launch video.**
|
|
12
|
+
|
|
13
|
+
<img src="docs/hero.gif" alt="TabRetake recording a SaaS dashboard, zooming into clicks and adding captions" width="100%">
|
|
14
|
+
|
|
15
|
+
[Project page](https://gnawbit.github.io/tabretake/) · [Watch the demo](docs/hero.mp4) · [Install](#install) · [How it works](#how-it-works) · [Roadmap](#roadmap)
|
|
16
|
+
|
|
17
|
+
TabRetake is a local CLI and Agent Skill for repeatable browser walkthroughs.
|
|
18
|
+
Describe a flow in editable JSON, or have your coding agent write it. It runs
|
|
19
|
+
the steps in Chromium and exports landscape or portrait MP4, README GIFs and
|
|
20
|
+
PNG posters with click zooms and captions. Works on Windows, macOS and Linux.
|
|
21
|
+
|
|
22
|
+
Keep the story with your code and re-run it when the UI changes.
|
|
23
|
+
Already have a screen recording? Supply timestamp marks to
|
|
24
|
+
[render the same outputs without browser automation](#use-an-existing-screen-recording).
|
|
25
|
+
|
|
26
|
+
[Try the TodoMVC recipe](https://gnawbit.github.io/tabretake/todomvc/): a pinned
|
|
27
|
+
upstream app, downloadable story and verified README GIF / 9:16 workflow.
|
|
28
|
+
|
|
29
|
+
[Agent discovery and invocation checks](docs/agent-discovery.md) separate search
|
|
30
|
+
visibility, Skill selection and successful output; they are not adoption metrics.
|
|
31
|
+
|
|
32
|
+
> Works with Claude Code, Codex, Cursor and any agent that supports
|
|
33
|
+
> [Agent Skills](https://agentskills.io).
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## Why
|
|
38
|
+
|
|
39
|
+
Every launch needs a demo:
|
|
40
|
+
|
|
41
|
+
- a GIF at the top of the README
|
|
42
|
+
- a hero video on the landing page
|
|
43
|
+
- a clip for product launches and social sharing
|
|
44
|
+
- a walkthrough for onboarding
|
|
45
|
+
|
|
46
|
+
Keep these assets reproducible with a story file that you or your agent can
|
|
47
|
+
edit and run again after a release.
|
|
48
|
+
|
|
49
|
+
**What you get**
|
|
50
|
+
|
|
51
|
+
- 1080p MP4 + GIF + poster, in **16:9 and 9:16**
|
|
52
|
+
- automatic zoom into each click
|
|
53
|
+
- a visible cursor and click ripple
|
|
54
|
+
- benefit-driven captions
|
|
55
|
+
- a browser frame and a generated background
|
|
56
|
+
- a `record.json` timeline you can re-render without recording again
|
|
57
|
+
- everything runs locally — no upload, no cloud
|
|
58
|
+
|
|
59
|
+
### Formats
|
|
60
|
+
|
|
61
|
+
| 16:9 — README / landing page | 9:16 — portrait launch video |
|
|
62
|
+
|---|---|
|
|
63
|
+
| <img src="docs/poster.png" alt="16:9 demo poster" width="100%"> | <img src="docs/poster-9x16.png" alt="9:16 vertical demo poster" width="100%"> |
|
|
64
|
+
|
|
65
|
+
[16:9 MP4](docs/hero.mp4) · [9:16 MP4](docs/hero-9x16.mp4) · [9:16 GIF](docs/hero-9x16.gif)
|
|
66
|
+
|
|
67
|
+
## Install
|
|
68
|
+
|
|
69
|
+
Install the CLI from the v0.4.0 release of this repository.
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
npm install --global git+https://github.com/gnawbit/tabretake.git#v0.4.0
|
|
73
|
+
tabretake setup
|
|
74
|
+
tabretake demo
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Requires Node 20.9+ and Git. Run `tabretake` from your working directory;
|
|
78
|
+
the bundled demo writes its output to `./demo`. On Linux, use
|
|
79
|
+
`tabretake setup --with-deps` if browser system libraries are missing.
|
|
80
|
+
ffmpeg and ffprobe are included as dependencies.
|
|
81
|
+
|
|
82
|
+
GitHub distributes the CLI as `@gnawbit/tabretake`. If you installed
|
|
83
|
+
`v0.3.3` or earlier, that release still uses `demo-reel` for the command and
|
|
84
|
+
Skill. Existing JSON stories work with `tabretake`.
|
|
85
|
+
|
|
86
|
+
For development, install from a checkout:
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
git clone https://github.com/gnawbit/tabretake
|
|
90
|
+
cd tabretake
|
|
91
|
+
npm ci
|
|
92
|
+
node bin/tabretake.mjs setup
|
|
93
|
+
node bin/tabretake.mjs doctor
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
The examples below use the source checkout. With the global installation,
|
|
97
|
+
replace `node bin/tabretake.mjs` with `tabretake`.
|
|
98
|
+
|
|
99
|
+
To add the agent workflow after setting up the CLI:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
npx skills@1.9.0 add "https://github.com/gnawbit/tabretake.git#v0.4.0" --skill tabretake
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Run this in the target project; add `--agent codex`, `--agent claude-code` or
|
|
106
|
+
`--agent cursor` to select a client. Skills CLI 1.9.0 needs Node 22.20+, while
|
|
107
|
+
TabRetake itself needs Node 20.9+. Tell your agent whether to use the global CLI
|
|
108
|
+
or a source checkout. Install the CLI and Skill from the same revision.
|
|
109
|
+
|
|
110
|
+
Claude Code users can install the plugin instead (CLI 2.1.292+):
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
claude plugin install tabretake --marketplace "gnawbit/tabretake#v0.4.0"
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Install the workflow through one of these routes; the plugin still needs the
|
|
117
|
+
TabRetake runtime installed above. It is a Claude Code plugin, not a Cowork
|
|
118
|
+
package or an MCP server. [Discovery checks and their limits](docs/agent-discovery.md)
|
|
119
|
+
document what has actually been verified.
|
|
120
|
+
Example requests:
|
|
121
|
+
|
|
122
|
+
- "Make a README GIF showing the signup flow at http://localhost:3000."
|
|
123
|
+
- "Create a portrait launch demo from my web app, with captions."
|
|
124
|
+
- "Regenerate the product walkthrough after these UI changes."
|
|
125
|
+
|
|
126
|
+
The agent plans a story and runs the CLI. For an existing recording, supply
|
|
127
|
+
the video and the moments to highlight instead.
|
|
128
|
+
|
|
129
|
+
## Quickstart
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
# 1. Check the environment
|
|
133
|
+
node bin/tabretake.mjs doctor
|
|
134
|
+
|
|
135
|
+
# 2. See it work on the bundled demo app
|
|
136
|
+
node bin/tabretake.mjs demo
|
|
137
|
+
|
|
138
|
+
# 3. Use it on your own app
|
|
139
|
+
node bin/tabretake.mjs plan --url https://your-app.com
|
|
140
|
+
node bin/tabretake.mjs init --url https://your-app.com
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Edit the generated `demo.json` to add your app's click/type steps, using
|
|
144
|
+
`plan.json` to find controls. The starter only waits on the page and will not
|
|
145
|
+
overwrite an existing story. Use `--out stories/demo.json` for another path.
|
|
146
|
+
|
|
147
|
+
From v0.3.3, plans include a `label` from ARIA references or
|
|
148
|
+
HTML labels and native select `options` with `label`, `value` and `disabled`.
|
|
149
|
+
Use these to identify controls;
|
|
150
|
+
`name` remains the HTML attribute and `selector` is the suggested CSS locator.
|
|
151
|
+
This is a DOM inventory, not a complete accessibility tree.
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
node bin/tabretake.mjs record --config demo.json
|
|
155
|
+
node bin/tabretake.mjs render --config demo/record.json --vertical
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
Output:
|
|
159
|
+
|
|
160
|
+
```
|
|
161
|
+
demo/
|
|
162
|
+
demo-16x9.mp4
|
|
163
|
+
demo-9x16.mp4
|
|
164
|
+
demo.gif
|
|
165
|
+
demo-9x16.gif
|
|
166
|
+
poster.png
|
|
167
|
+
poster-9x16.png
|
|
168
|
+
record.json
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
## The story file
|
|
172
|
+
|
|
173
|
+
### Preview and focus
|
|
174
|
+
|
|
175
|
+
Run `tabretake preview --config demo.json` to execute the story in a visible
|
|
176
|
+
browser before recording. Preview performs the actual clicks and edits against
|
|
177
|
+
your app. Use disposable demo data and reset it before recording. It reports
|
|
178
|
+
each step, preserves existing recordings, and writes only explicit `screenshot`
|
|
179
|
+
steps. Add `--headless --json` for automation and `--storage-state auth.json`
|
|
180
|
+
for authenticated flows.
|
|
181
|
+
|
|
182
|
+
After an action reveals a result, wait for it and focus the camera on it.
|
|
183
|
+
The target is measured after scrolling into view. A focus step holds that
|
|
184
|
+
position for its `pause`; add another focus step after subsequent layout changes.
|
|
185
|
+
|
|
186
|
+
```json
|
|
187
|
+
[
|
|
188
|
+
{ "action": "waitFor", "selector": "#result" },
|
|
189
|
+
{ "action": "focus", "selector": "#result", "caption": "Ready to share", "pause": 1200 }
|
|
190
|
+
]
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
Preview checks browser actions. Use a rendered clip to check zooms and captions.
|
|
194
|
+
|
|
195
|
+
```json
|
|
196
|
+
{
|
|
197
|
+
"url": "https://your-app.com",
|
|
198
|
+
"displayUrl": "your-app.com",
|
|
199
|
+
"viewport": { "width": 1440, "height": 810 },
|
|
200
|
+
"brand": { "background": "#070a12", "accent": "#6c5ce7" },
|
|
201
|
+
"steps": [
|
|
202
|
+
{ "action": "wait", "ms": 600 },
|
|
203
|
+
{
|
|
204
|
+
"action": "click",
|
|
205
|
+
"text": "New project",
|
|
206
|
+
"pause": 600,
|
|
207
|
+
"zoom": false,
|
|
208
|
+
"caption": "Start in one click"
|
|
209
|
+
},
|
|
210
|
+
{ "action": "wait", "ms": 900 },
|
|
211
|
+
{
|
|
212
|
+
"action": "type",
|
|
213
|
+
"selector": "input[name=project-name]",
|
|
214
|
+
"value": "Q4 Launch",
|
|
215
|
+
"pause": 350,
|
|
216
|
+
"caption": "Give it a name"
|
|
217
|
+
},
|
|
218
|
+
{ "action": "wait", "ms": 900 },
|
|
219
|
+
{
|
|
220
|
+
"action": "click",
|
|
221
|
+
"text": "Create project",
|
|
222
|
+
"pause": 900,
|
|
223
|
+
"zoom": false,
|
|
224
|
+
"caption": "Your workspace is ready"
|
|
225
|
+
}
|
|
226
|
+
]
|
|
227
|
+
}
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
Actions: `wait`, `goto`, `click`, `type`, `hover`, `focus`, `drag`, `scroll`, `press`,
|
|
231
|
+
`waitFor`, `screenshot`.
|
|
232
|
+
|
|
233
|
+
From v0.3.3, `click` waits for an enabled, unobstructed target.
|
|
234
|
+
Set step `timeout` in milliseconds (default 20,000); blocked clicks return
|
|
235
|
+
`STEP_TIMEOUT`. v0.3.2 and earlier do not reliably wait for clickable targets.
|
|
236
|
+
|
|
237
|
+
Locator fields are `selector`, `role` + `name` (or `text`), `name`, or `text`.
|
|
238
|
+
An explicit `selector` is tried first. From v0.4.0, label
|
|
239
|
+
matching tries exact buttons/links, then partial buttons/links, then plain text
|
|
240
|
+
(exact before partial). An explicit `role` restricts matching to that role,
|
|
241
|
+
with exact names first.
|
|
242
|
+
Each candidate keeps the first visible match. Use a scoped selector when labels
|
|
243
|
+
repeat or overlap. On v0.3.3 and earlier, a partial button label can beat an
|
|
244
|
+
exact link label: use `selector: "a[href='#/completed']"` instead of just
|
|
245
|
+
`text: "Completed"` when a “Clear completed” button is also present.
|
|
246
|
+
|
|
247
|
+
Tips:
|
|
248
|
+
|
|
249
|
+
- 3–5 steps, 12–25 seconds.
|
|
250
|
+
- Add a short `wait` after an action so the result and caption can land.
|
|
251
|
+
- Use `"zoom": false` when the interesting result is elsewhere on screen.
|
|
252
|
+
- Captions state the benefit, not the UI label.
|
|
253
|
+
|
|
254
|
+
Captions wrap to fit the frame and shrink modestly when needed.
|
|
255
|
+
If a caption cannot fit at a readable size, rendering asks you to shorten it
|
|
256
|
+
or split it across steps. A new caption replaces the previous one immediately.
|
|
257
|
+
|
|
258
|
+
### Camera movement
|
|
259
|
+
|
|
260
|
+
Click zooms ease between targets over 0.35 seconds. Set top-level
|
|
261
|
+
`"zoomDuration": 0.5` in a story or marks config, or override it with
|
|
262
|
+
`render --config demo/record.json --zoom-duration 0.5`. Use `0` for immediate
|
|
263
|
+
cuts and `"zoom": false` on a step to return to the full view. Rapid clicks
|
|
264
|
+
continue from the current camera position.
|
|
265
|
+
|
|
266
|
+
### Posters
|
|
267
|
+
|
|
268
|
+
Posters use a frame near the end to show the result. Set `"posterAt": 4.5`
|
|
269
|
+
at the top level of a story or recording-marks config to choose another frame.
|
|
270
|
+
For an existing timeline, `render --config demo/record.json --poster-at 4.5`
|
|
271
|
+
overrides that setting without recording again. Times are seconds into the
|
|
272
|
+
trimmed output, starting at zero, and must be shorter than the video.
|
|
273
|
+
|
|
274
|
+
### Vertical branding
|
|
275
|
+
|
|
276
|
+
The 9:16 output can carry a custom hook and CTA:
|
|
277
|
+
|
|
278
|
+
```json
|
|
279
|
+
"vertical": {
|
|
280
|
+
"badge": "Your product",
|
|
281
|
+
"titleLines": ["Ship faster", "without the busywork"],
|
|
282
|
+
"subtitle": "Native · Local · Private",
|
|
283
|
+
"cta": "your-app.com",
|
|
284
|
+
"watermark": false
|
|
285
|
+
}
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
`titleLines` is capped at two lines. `watermark: false` removes the small
|
|
289
|
+
TabRetake mark. Chinese text automatically uses a CJK font.
|
|
290
|
+
|
|
291
|
+
From v0.3.2, portrait cards fit the source video's aspect ratio. For a mobile
|
|
292
|
+
flow, inspect with `plan --viewport 390x844`, then record at the same viewport.
|
|
293
|
+
Render with `--vertical --zoom 1` to keep the full page in view; larger zooms
|
|
294
|
+
crop around focus points. Wide desktop recordings may still have small text.
|
|
295
|
+
|
|
296
|
+
## Commands
|
|
297
|
+
|
|
298
|
+
| Command | What it does |
|
|
299
|
+
|---|---|
|
|
300
|
+
| `tabretake --version` | Print the installed CLI version |
|
|
301
|
+
| `tabretake capabilities --json` | List supported commands, flags and JSON support |
|
|
302
|
+
| `tabretake doctor [--json]` | Check Node, Chromium, ffmpeg, fonts |
|
|
303
|
+
| `tabretake setup` | Install the Chromium version used by this CLI |
|
|
304
|
+
| `tabretake init --url <url>` | Create an editable story file |
|
|
305
|
+
| `tabretake validate --config demo.json [--json]` | Validate a story, marks or recorded timeline without recording |
|
|
306
|
+
| `tabretake plan --url <url>` | Screenshot + list interactive elements |
|
|
307
|
+
| `tabretake record --config demo.json` | Record the story |
|
|
308
|
+
| `tabretake preview --config demo.json` | Execute steps in a visible browser before recording |
|
|
309
|
+
| `tabretake render --config demo/record.json` | Render MP4 + GIF |
|
|
310
|
+
| `tabretake serve` | Serve the bundled demo app |
|
|
311
|
+
| `tabretake demo` | Record + render the bundled demo |
|
|
312
|
+
|
|
313
|
+
For agents, `capabilities --json` and `doctor --json` emit one JSON object on
|
|
314
|
+
stdout with `schemaVersion: 1` and the installed version. Diagnostic checks have
|
|
315
|
+
stable `id`, `required`, `status` and recovery `hint` fields on failure. Exit code
|
|
316
|
+
`1` means a required check failed; missing caption fonts are warnings (exit `0`
|
|
317
|
+
if required checks pass). Chromium is checked for installation, not launched.
|
|
318
|
+
JSON workflows and validation require v0.3.0 or newer.
|
|
319
|
+
|
|
320
|
+
`doctor` checks the whole toolkit. Rendering an existing recording or saved
|
|
321
|
+
timeline does not need Chromium. If `chromium` is the only failed required
|
|
322
|
+
check, skip browser setup and continue with `validate` and `render`; fix other
|
|
323
|
+
required errors first. Browser planning and recording still require Chromium.
|
|
324
|
+
|
|
325
|
+
Before recording, run `validate --config demo.json --json`. It checks types,
|
|
326
|
+
supported actions, required targets and unknown fields against the packaged
|
|
327
|
+
[JSON Schema](schemas/story.schema.json). Failures return exit `1` and errors
|
|
328
|
+
with a `code`, JSON Pointer `path` (for example `/steps/0/action`), `message` and
|
|
329
|
+
`hint`. Invalid JSON and unreadable files use an `error` object. Validation
|
|
330
|
+
does not open the browser or check selectors, login state or media files.
|
|
331
|
+
`record` and `render` also validate their input before changing output files.
|
|
332
|
+
For editor completion, add `"$schema": "https://raw.githubusercontent.com/gnawbit/tabretake/main/schemas/story.schema.json"`
|
|
333
|
+
to the config.
|
|
334
|
+
|
|
335
|
+
Useful flags:
|
|
336
|
+
|
|
337
|
+
`init`, `plan`, `record` and `render` also accept `--json`: stdout contains one
|
|
338
|
+
result object and progress goes to stderr. Success includes `command`, `ok`,
|
|
339
|
+
`version`, `schemaVersion` and an `artifacts` list with absolute paths, kinds and
|
|
340
|
+
byte sizes. Recording failures include a zero-based `error.step.index`, action,
|
|
341
|
+
JSON Pointer path and recovery hint. Fix the reported step before retrying.
|
|
342
|
+
Run manual `--login` in an interactive terminal without `--json`, then reuse
|
|
343
|
+
`--storage-state` in automation. Failed runs may leave partial files; only a
|
|
344
|
+
successful result's artifact list confirms the current run's outputs.
|
|
345
|
+
|
|
346
|
+
In v0.3.1 or newer, navigation failures return `PAGE_UNREACHABLE` with
|
|
347
|
+
URL/server/network checks, or `PAGE_HTTP_ERROR` with `error.status` for HTTP
|
|
348
|
+
4xx/5xx. Error pages are not recorded as successful demos. These errors omit
|
|
349
|
+
the target URL so credentials and query tokens are not echoed. `doctor` checks
|
|
350
|
+
dependencies; it cannot establish that an app is reachable.
|
|
351
|
+
|
|
352
|
+
From v0.3.2, manual `--login` navigation failures also omit the target URL.
|
|
353
|
+
HTTP 401/403 pages remain open for sign-in; other HTTP errors stop the command.
|
|
354
|
+
|
|
355
|
+
In v0.3.1 or newer, captions start when an action finishes, before its `pause`.
|
|
356
|
+
Use the pause as reading time. On v0.3.0, use `pause: 0` plus a separate `wait`
|
|
357
|
+
step instead. Re-record to update old timelines; re-rendering preserves timing.
|
|
358
|
+
|
|
359
|
+
```bash
|
|
360
|
+
--login # open a visible browser, log in once
|
|
361
|
+
--storage-state auth.json
|
|
362
|
+
--proxy http://127.0.0.1:10808
|
|
363
|
+
--viewport 1440x810
|
|
364
|
+
--headed # watch the recording happen
|
|
365
|
+
--vertical # also render 9:16 + vertical GIF
|
|
366
|
+
--video recording.mp4 # render an existing recording + marks
|
|
367
|
+
--no-gif
|
|
368
|
+
--no-captions
|
|
369
|
+
--zoom 1.28
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
## Login and protected pages
|
|
373
|
+
|
|
374
|
+
```bash
|
|
375
|
+
node bin/tabretake.mjs record --config demo.json --login
|
|
376
|
+
```
|
|
377
|
+
|
|
378
|
+
A visible browser opens. Log in manually in an interactive terminal. The session
|
|
379
|
+
is saved to `auth.json` locally and used for this recording. On later runs, or
|
|
380
|
+
after logging in with `plan --login`, pass it explicitly:
|
|
381
|
+
|
|
382
|
+
```bash
|
|
383
|
+
node bin/tabretake.mjs record --config demo.json --storage-state auth.json
|
|
384
|
+
```
|
|
385
|
+
|
|
386
|
+
Use an absolute state path when changing working directories. TabRetake never
|
|
387
|
+
asks for your password and never uploads cookies. Keep login state out of Git.
|
|
388
|
+
|
|
389
|
+
## How it works
|
|
390
|
+
|
|
391
|
+
<img src="docs/architecture.svg" alt="Story JSON goes into Playwright recording, then a timestamped event timeline and webm go into sharp + ffmpeg, producing MP4, GIF and poster" width="100%">
|
|
392
|
+
|
|
393
|
+
1. `plan` opens the page and inventories buttons, links and inputs.
|
|
394
|
+
2. `record` drives Chromium, moves the cursor, clicks, types and records.
|
|
395
|
+
3. Click timestamps become zoom keyframes.
|
|
396
|
+
4. `render` crops around each click, then composes the same timeline into a
|
|
397
|
+
16:9 browser canvas and a 9:16 vertical card, and encodes MP4 + GIF.
|
|
398
|
+
|
|
399
|
+
Because it drives a real browser, it works with React, Vue, Svelte, plain HTML,
|
|
400
|
+
SPAs and authenticated pages.
|
|
401
|
+
|
|
402
|
+
## Examples
|
|
403
|
+
|
|
404
|
+
Reproduce authenticated flows in [Vikunja](https://gnawbit.github.io/tabretake/vikunja/)
|
|
405
|
+
(task creation and Kanban drag) and [Memos](https://gnawbit.github.io/tabretake/memos/)
|
|
406
|
+
(rich-text notes and search). Both recipes pin unmodified upstream releases and
|
|
407
|
+
include downloadable stories, local setup and retake instructions.
|
|
408
|
+
|
|
409
|
+
The [manual demo workflow](.github/workflows/demo.yml) starts a pinned TodoMVC
|
|
410
|
+
build, waits for it, records the story and uploads MP4, GIF and poster artifacts.
|
|
411
|
+
Run **Actions → Regenerate TodoMVC demo → Run workflow** in your fork.
|
|
412
|
+
For your own app, replace its checkout/start command, readiness URL and story.
|
|
413
|
+
Keep demo data disposable. Review the generated assets before publishing them.
|
|
414
|
+
|
|
415
|
+
| Example | Story | Output |
|
|
416
|
+
|---|---|---|
|
|
417
|
+
| Northstar SaaS dashboard | [examples/story.json](examples/story.json) | [16:9 MP4](docs/hero.mp4) · [9:16 MP4](docs/hero-9x16.mp4) · [GIF](docs/hero.gif) |
|
|
418
|
+
|
|
419
|
+
Northstar is a fictional bundled app. Try three [runnable recipes](examples/README.md)
|
|
420
|
+
for a README GIF, first-project onboarding and repeatable release assets.
|
|
421
|
+
Run a preset from the source checkout (or use the installed `tabretake` command):
|
|
422
|
+
|
|
423
|
+
```bash
|
|
424
|
+
node bin/tabretake.mjs demo --story readme --port 0 --out demo-readme
|
|
425
|
+
node bin/tabretake.mjs demo --story onboarding --port 0 --out demo-onboarding
|
|
426
|
+
node bin/tabretake.mjs demo --story release --port 0 --out demo-release
|
|
427
|
+
```
|
|
428
|
+
|
|
429
|
+
## Use an existing screen recording
|
|
430
|
+
|
|
431
|
+
If a site blocks automation, or you are demoing a desktop or mobile app, record
|
|
432
|
+
the flow with OBS, Screen Studio, QuickTime or the OS recorder, then describe
|
|
433
|
+
where to zoom in `marks`:
|
|
434
|
+
|
|
435
|
+
```json
|
|
436
|
+
{
|
|
437
|
+
"displayUrl": "your-app.com",
|
|
438
|
+
"video": "recording.mp4",
|
|
439
|
+
"marks": [
|
|
440
|
+
{
|
|
441
|
+
"t": 2.1,
|
|
442
|
+
"x": 0.946,
|
|
443
|
+
"y": 0.048,
|
|
444
|
+
"caption": "Start a new project",
|
|
445
|
+
"zoom": false
|
|
446
|
+
},
|
|
447
|
+
{
|
|
448
|
+
"t": 4.1,
|
|
449
|
+
"x": 0.5,
|
|
450
|
+
"y": 0.468,
|
|
451
|
+
"caption": "Give it a name"
|
|
452
|
+
}
|
|
453
|
+
]
|
|
454
|
+
}
|
|
455
|
+
```
|
|
456
|
+
|
|
457
|
+
- `t` is seconds into the recording.
|
|
458
|
+
- `x` and `y` are normalized `0..1`; use `zoom: false` to keep the full frame.
|
|
459
|
+
- `duration` delays the caption after `t`, in seconds (default `0.6`);
|
|
460
|
+
use `0` to show it at the mark. It does not set how long the caption stays.
|
|
461
|
+
Captions last up to 2.8 seconds, ending earlier at the next caption or video end.
|
|
462
|
+
|
|
463
|
+
```bash
|
|
464
|
+
node bin/tabretake.mjs render \
|
|
465
|
+
--config story-video.json \
|
|
466
|
+
--video recording.mp4 \
|
|
467
|
+
--vertical
|
|
468
|
+
```
|
|
469
|
+
|
|
470
|
+
It produces the same 16:9 and 9:16 videos, GIFs and posters as a URL recording.
|
|
471
|
+
|
|
472
|
+
A minimal example lives at [examples/story-video.json](examples/story-video.json).
|
|
473
|
+
|
|
474
|
+
## Why not Screen Studio?
|
|
475
|
+
|
|
476
|
+
Different tools:
|
|
477
|
+
|
|
478
|
+
| | Screen Studio | TabRetake |
|
|
479
|
+
|---|---|---|
|
|
480
|
+
| Workflow | manual editing | a story file + one command |
|
|
481
|
+
| Repeatable | no | yes |
|
|
482
|
+
| Runs in CI | no | yes |
|
|
483
|
+
| Price | paid | free, MIT |
|
|
484
|
+
|
|
485
|
+
Use Screen Studio when you want frame-by-frame control. Use TabRetake when you
|
|
486
|
+
want a repeatable launch asset and a timeline you can commit.
|
|
487
|
+
|
|
488
|
+
## FAQ
|
|
489
|
+
|
|
490
|
+
**Is this a screen recorder?**
|
|
491
|
+
No. It is a repeatable pipeline: a story file + a browser + a renderer. The
|
|
492
|
+
recording is a side effect.
|
|
493
|
+
|
|
494
|
+
**Does it work on Windows?**
|
|
495
|
+
Yes. It is developed on Windows and uses npm-bundled ffmpeg binaries.
|
|
496
|
+
|
|
497
|
+
**Do I need an AI agent to use it?**
|
|
498
|
+
No. The CLI works standalone. The agent skill is a convenience: it can inspect
|
|
499
|
+
the page, write the story and run the commands for you.
|
|
500
|
+
|
|
501
|
+
**Can I record a site I don't own?**
|
|
502
|
+
Only with permission. Do not use it to scrape, bypass paywalls or evade
|
|
503
|
+
anti-bot systems.
|
|
504
|
+
|
|
505
|
+
**Do Chinese captions work?**
|
|
506
|
+
Yes. TabRetake picks a CJK font automatically: Microsoft YaHei on Windows,
|
|
507
|
+
PingFang on macOS, Noto Sans CJK on Linux. `doctor` checks it. If no CJK font is
|
|
508
|
+
installed, run `doctor` to see what is missing.
|
|
509
|
+
|
|
510
|
+
**Can I use the output commercially?**
|
|
511
|
+
Yes. The code is MIT. Make sure the page you record and the fonts/assets in it
|
|
512
|
+
are yours or licensed.
|
|
513
|
+
|
|
514
|
+
## Roadmap
|
|
515
|
+
|
|
516
|
+
- [x] 9:16 vertical export
|
|
517
|
+
- [x] Screen-recording input (`--video` + `marks`)
|
|
518
|
+
- [ ] Voiceover (TTS)
|
|
519
|
+
- [ ] Device frames (iPhone, Android, macOS)
|
|
520
|
+
- [ ] Brand presets
|
|
521
|
+
- [ ] Cloud rendering
|
|
522
|
+
|
|
523
|
+
## Contributing
|
|
524
|
+
|
|
525
|
+
Issues and PRs are welcome. Start with [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
526
|
+
Please do not commit `auth.json`, customer recordings or anything that contains
|
|
527
|
+
personal data.
|
|
528
|
+
|
|
529
|
+
## License
|
|
530
|
+
|
|
531
|
+
MIT — see [LICENSE](LICENSE).
|
|
532
|
+
|
|
533
|
+
---
|
|
534
|
+
|
|
535
|
+
If this saved you an afternoon, a star helps more people find it.
|