@gnawbit/tabretake 0.0.0-stage → 0.4.1

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