Star 历史趋势
数据来源: GitHub API · 生成自 Stargazers.cn
README.md

webreel

Record scripted browser videos as MP4 files with sound effects, cursor animation, and keystroke overlays.

Documentation | Examples

Define steps in a JSON config (clicks, key presses, drags, pauses) and webreel drives a headless Chrome instance, captures screenshots at ~60fps, and encodes the result with ffmpeg.

Chrome and ffmpeg are downloaded automatically on first use to ~/.webreel if not already installed.

Quick Start

npm install webreel npx webreel init --name my-video --url https://example.com npx webreel record

Examples

custom-theme - Demonstrates fully customizing the cursor overlay and keystroke HUD appearance using a code editor page.

drag-and-drop - Demonstrates dragging elements between positions on a kanban board.

form-filling - Demonstrates typing into form fields and clicking a submit button, simulating a login flow.

gif-output - Demonstrates outputting the recording as an animated GIF instead of the default MP4.

hello-world - The simplest possible webreel example. Opens a landing page and clicks the call-to-action button.

keyboard-shortcuts - Demonstrates pressing key combos and displaying them in the keystroke HUD overlay. Uses a code editor page as the target.

mobile-viewport - Demonstrates recording at mobile device dimensions using a finance app interface.

modifier-clicks - Demonstrates clicking elements with modifier keys held down, simulating multi-select in a file manager.

multi-demo - Demonstrates defining multiple videos in a single config file, each producing its own output from the same page.

page-scrolling - Demonstrates scrolling the page and scrolling within a specific container element on a blog post layout.

screenshots - Demonstrates capturing PNG screenshots at specific points during a recording. Useful for generating static marketing assets or documentation images alongside videos.

shared-steps - Demonstrates using include to share common setup steps across videos. The shared steps dismiss a cookie consent banner before the main video steps run.

webm-output - Demonstrates outputting the recording as a WebM video using VP9 encoding.

Usage

Init

Scaffold a new config file:

webreel init webreel init --name login-flow --url https://myapp.com webreel init --name hero -o hero.config.json

This creates a webreel.config.json with a $schema for IDE autocompletion:

{ "$schema": "https://webreel.dev/schema/v1.json", "videos": { "my-video": { "url": "https://example.com", "viewport": { "width": 1080, "height": 1080 }, "defaultDelay": 500, "steps": [ { "action": "pause", "ms": 500 }, { "action": "click", "text": "Get Started" }, { "action": "key", "key": "cmd+a", "delay": 1000 } ] } } }

Record

Record videos:

webreel record webreel record hero login webreel record -c custom.config.json webreel record --watch webreel record --verbose

Preview

Run a video in a visible browser window without recording:

webreel preview webreel preview hero webreel preview hero --verbose

Composite

Re-composite videos from stored raw recordings and timelines without re-recording:

webreel composite webreel composite hero

Install

Download Chrome and ffmpeg to ~/.webreel. Both are also auto-downloaded on first run. Use --force to fix corrupted or broken binaries.

webreel install webreel install --force

Validate

Check config files for errors without running them:

webreel validate webreel validate -c custom.config.json

Help and Version

webreel --help webreel --version webreel record --help

Actions

ActionFieldsDescription
pausemsWait for a duration
clicktext or selector, optional within, modifiersMove cursor to an element and click
keykey (e.g. "cmd+z"), optional labelPress a key or key combo
typetext, optional target, charDelayType text character by character
scrolloptional x, y, selectorScroll the page or an element
waitselector or text, optional timeoutWait for an element to appear
screenshotoutputCapture a PNG screenshot
dragfrom and to (each with text/selector/within)Drag from one element to another
moveTotext or selector, optional withinMove cursor to an element
navigateurlNavigate to a new URL mid-video
hovertext or selector, optional withinHover over an element (triggers CSS)
selectselector, valueSelect a value in a dropdown

All steps (except pause) accept an optional delay field (ms to wait after the step). Use defaultDelay at the top-level or per-video to set a default.

Config options

Top-level

FieldDefaultDescription
$schema-JSON Schema URL for IDE autocompletion
outDirvideos/Default output directory for videos
baseUrl""Prepended to relative video URLs
viewport1080x1080Default browser viewport dimensions
theme-Default cursor and HUD overlay customization
include-Array of step files prepended to all videos
defaultDelay-Default delay (ms) after each step
videosrequiredObject mapping video names to their configs

Per-video

FieldDefaultDescription
urlrequiredURL to navigate to
baseUrlinheritedPrepended to relative URLs
viewportinheritedBrowser viewport dimensions
zoom-CSS zoom level applied to the page
waitFor-CSS selector to wait for before start
output<name>.mp4Output file path (.mp4, .gif, or .webm)
thumbnail{ time: 0 }Object with time (seconds) or enabled: false
includeinheritedArray of paths to JSON files whose steps are prepended
themeinheritedCursor and HUD overlay customization
defaultDelayinheritedDefault delay (ms) after each step

Development

Prerequisites

Setup

pnpm install pnpm build

Packages

PackageDescription
@webreel/coreChrome automation, recording, and overlays
webreelCLI that records videos from JSON configs

License

Apache-2.0

关于 About

Record scripted browser demos as video

语言 Languages

TypeScript84.9%
MDX12.2%
Shell1.6%
CSS0.7%
JavaScript0.6%

提交活跃度 Commit Activity

代码提交热力图
过去 52 周的开发活跃度
23
Total Commits
峰值: 22次/周
Less
More

核心贡献者 Contributors