Installation
Requirements
Section titled “Requirements”| Requirement | Why |
|---|---|
| Node.js >= 22 | Declared in engines. rereel uses built-in fetch and node:crypto and has no runtime dependencies. |
ffmpeg and ffprobe in PATH |
Probing media, concatenating chunks, silencedetect, loudness measurement, the audio mix and the final mux. FFmpeg 7.1 and later are supported, including 9.x. Older builds fall back to -filter_complex_script automatically. |
A Remotion project (for build only) |
rereel does not bundle Remotion. It runs the remotion CLI from your template. |
tar |
Only when a template is fetched from storage (template.source: "storage"). |
freeze, hydrate, validate, inspect and patch do not need Remotion. validate, inspect and patch do not need FFmpeg either, so they run in lightweight CI images.
How Remotion is invoked
Section titled “How Remotion is invoked”During build, rereel copies your template into <reel_dir>/build/template/ (skipping node_modules, .remotion, out and props) and runs the first Remotion binary it finds:
$REREEL_REMOTION_BIN, if setbuild/template/node_modules/.bin/remotionnpx remotion
node_modules is cloned from the source template when it exists. Otherwise rereel runs npm ci (or npm install if there is no package-lock.json) once and caches the result in ~/.cache/rereel/node_modules/. Install remotion and @remotion/cli in the template project itself, not in the project that runs rereel.
Install
Section titled “Install”npm install -D @mathrunet/rereelThis installs the rereel binary. Run it with npx rereel or from an npm script. Without installing:
npx @mathrunet/rereel --helpThe rest of these docs use npx @mathrunet/rereel. If rereel is installed in the project, npx rereel is equivalent.
Install the agent skill (optional)
Section titled “Install the agent skill (optional)”If you work with a coding agent, install the rereel skill as well:
/plugin install rereel --marketplace mathrunet/rereelThat line is for Claude Code. For Codex, Cursor and other agents, run npx skills add mathrunet/rereel. See Using rereel with AI agents for the alternatives.
Verify
Section titled “Verify”npx @mathrunet/rereel --helpffmpeg -versionffprobe -version--help (or -h, or running with no arguments) prints usage to stderr and exits with code 0. Every other command prints a single JSON line to stdout.
Environment variables
Section titled “Environment variables”| Variable | Effect |
|---|---|
REREEL_FFMPEG_BIN |
Path to ffmpeg (default ffmpeg). |
REREEL_FFPROBE_BIN |
Path to ffprobe (default ffprobe). |
REREEL_REMOTION_BIN |
Remotion CLI used by build. |
REREEL_TEMPLATES_DIR |
Root for builtin templates: <dir>/<template.name>/package.json. |
REREEL_STORAGE_CONFIG |
Path to a storage config, if --storage-config is not passed. See Storage providers. |
TypeScript API
Section titled “TypeScript API”The same functions the CLI uses are exported from the package entry (ESM only):
import { validateReel, inspectReel, rippleShiftReel } from "@mathrunet/rereel";
const res = validateReel("./reels/ep01");if (!res.valid) console.error(res.errors);See the API reference.