hyperframes-cli
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseHyperFrames CLI
HyperFrames CLI
The CLI turns HTML compositions into previews and rendered video. Everything runs through .
npx hyperframesbash
npx hyperframes <command>Requires Node.js >= 22 and FFmpeg. Run if anything fails.
npx hyperframes doctor该CLI可将HTML合成内容转换为预览效果和可渲染视频,所有操作都通过执行。
npx hyperframesbash
npx hyperframes <command>需要Node.js >= 22和FFmpeg环境。如果运行出现任何问题,请执行。
npx hyperframes doctorWorkflow
工作流
The natural sequence when building a composition:
- Scaffold — (new projects only)
npx hyperframes init my-video - Write — author HTML composition (see skill)
compose-video - Lint — to catch structural errors
npx hyperframes lint - Preview — to see it live in the studio
npx hyperframes preview - Render — to export video
npx hyperframes render
Lint before preview. It catches missing , overlapping tracks on the same , unregistered timelines, and other structural issues that silently produce broken output. A 2-second lint saves minutes debugging a blank screen. Both and auto-lint, but linting explicitly after editing gives you a chance to fix issues without waiting for the server or renderer to spin up.
data-composition-iddata-track-indexpreviewrender制作合成内容的标准流程:
- 项目初始化 — (仅新项目需要)
npx hyperframes init my-video - 内容编写 — 创作HTML合成内容(参考技能)
compose-video - Lint校验 — 排查结构错误
npx hyperframes lint - 预览 — 在工作室中实时查看效果
npx hyperframes preview - 渲染导出 — 导出视频
npx hyperframes render
预览前请先执行Lint校验。它可以检测出缺失的、相同下的轨道重叠、未注册的时间线,以及其他会悄无声息导致输出异常的结构问题。2秒钟的Lint校验可以帮你节省数分钟调试黑屏的时间。和命令都会自动执行Lint,但编辑完成后显式执行Lint可以让你在服务器或渲染器启动前就修复问题,无需等待。
data-composition-iddata-track-indexpreviewrenderScaffolding New Projects
新项目初始化
bash
npx hyperframes init my-video # interactive wizard
npx hyperframes init my-video --template warm-grain # pick a template
npx hyperframes init my-video --video clip.mp4 # with video file
npx hyperframes init my-video --audio track.mp3 # with audio file
npx hyperframes init my-video --non-interactive # skip prompts (CI/agents)Templates: , , , , , , , , .
blankwarm-grainplay-modeswiss-gridvignellidecision-treekinetic-typeproduct-promonyt-graphinitbash
npx hyperframes init my-video # 交互式向导
npx hyperframes init my-video --template warm-grain # 选择指定模板
npx hyperframes init my-video --video clip.mp4 # 导入视频文件
npx hyperframes init my-video --audio track.mp3 # 导入音频文件
npx hyperframes init my-video --non-interactive # 跳过提示(适用于CI/Agent场景)可选模板:, , , , , , , , 。
blankwarm-grainplay-modeswiss-gridvignellidecision-treekinetic-typeproduct-promonyt-graphinitLinting
Lint校验
bash
npx hyperframes lint # current directory
npx hyperframes lint ./my-project # specific project
npx hyperframes lint --verbose # include info-level findings
npx hyperframes lint --json # machine-readable output for scriptingLints and all files in . Reports errors (must fix), warnings (should fix), and info (with ).
index.htmlcompositions/--verboseWhen to lint:
- After writing or editing any composition file — always
- Before rendering — blocks on errors with
render, but linting first is faster--strict - After timing changes — overlapping clips on the same track are a common mistake
bash
npx hyperframes lint # 校验当前目录
npx hyperframes lint ./my-project # 校验指定项目
npx hyperframes lint --verbose # 输出信息级检测结果
npx hyperframes lint --json # 输出机器可读的JSON格式结果,适用于脚本调用Lint会校验以及目录下的所有文件,报告错误(必须修复)、警告(建议修复)和信息级提示(需添加参数)。
index.htmlcompositions/--verbose适用场景:
- 编写或编辑任意合成文件之后——务必执行
- 渲染导出之前——命令在
render模式下遇到错误会终止执行,但先执行Lint速度更快--strict - 修改时间配置之后——同一轨道下的片段重叠是常见错误
Previewing in the Studio
工作室预览
bash
npx hyperframes preview # serve current directory
npx hyperframes preview ./my-project # specific project
npx hyperframes preview --port 4567 # custom port (default 3002)Opens the studio in your browser automatically. Hot-reloads on file changes. Run from the project root (directory containing ).
index.htmlbash
npx hyperframes preview # 启动当前目录的预览服务
npx hyperframes preview ./my-project # 启动指定项目的预览服务
npx hyperframes preview --port 4567 # 自定义端口(默认3002)会自动在浏览器中打开工作室页面,文件变更时支持热重载。请在项目根目录(包含的目录)下运行该命令。
index.htmlRendering to Video
渲染导出视频
bash
npx hyperframes render # standard MP4
npx hyperframes render --output final.mp4 # named output
npx hyperframes render --quality draft # fast iteration
npx hyperframes render --fps 60 --quality high -o hd.mp4 # high quality
npx hyperframes render --format webm -o overlay.webm # transparent WebM
npx hyperframes render --docker -o deterministic.mp4 # reproducible| Flag | Options | Default | Notes |
|---|---|---|---|
| path | renders/name_timestamp.mp4 | Output file path |
| 24, 30, 60 | 30 | 60fps doubles render time |
| draft, standard, high | standard | Use draft while iterating |
| mp4, webm | mp4 | WebM supports transparency |
| 1-8 or auto | auto (half CPU cores, max 4) | Each spawns a Chrome process |
| flag | off | Byte-identical output across machines |
| flag | off | GPU-accelerated encoding |
| flag | off | Fail on lint errors |
| flag | off | Fail on errors AND warnings |
Quality guidance:
- while iterating on timing and layout — fast feedback
draft - for review and most deliverables
standard - only for final delivery where render time doesn't matter
high
bash
npx hyperframes render # 导出标准MP4格式
npx hyperframes render --output final.mp4 # 自定义输出文件名
npx hyperframes render --quality draft # 草稿画质,快速迭代
npx hyperframes render --fps 60 --quality high -o hd.mp4 # 高画质60帧导出
npx hyperframes render --format webm -o overlay.webm # 导出支持透明通道的WebM格式
npx hyperframes render --docker -o deterministic.mp4 # 可复现的一致性导出| 参数 | 可选值 | 默认值 | 说明 |
|---|---|---|---|
| 文件路径 | renders/name_timestamp.mp4 | 输出文件路径 |
| 24, 30, 60 | 30 | 60fps会使渲染时间翻倍 |
| draft, standard, high | standard | 迭代阶段建议使用draft模式 |
| mp4, webm | mp4 | WebM支持透明通道 |
| 1-8 或 auto | auto(CPU核心数的一半,最高4) | 每个工作进程对应一个Chrome进程 |
| 开关参数 | 关闭 | 跨机器导出字节完全一致的结果 |
| 开关参数 | 关闭 | GPU加速编码 |
| 开关参数 | 关闭 | 遇到Lint错误时终止导出 |
| 开关参数 | 关闭 | 遇到Lint错误或警告时都终止导出 |
画质建议:
- 调整时间线和布局时使用模式——反馈速度快
draft - 模式适用于审阅和大多数交付场景
standard - 仅当渲染时间不敏感的最终交付时使用模式
high
Troubleshooting
问题排查
bash
npx hyperframes doctor # check environment (Chrome, FFmpeg, Node, memory, disk)
npx hyperframes browser # manage bundled Chrome installation
npx hyperframes info # version and environment details
npx hyperframes upgrade # check for updatesRun first if rendering fails or produces unexpected results. Common issues:
doctor- Missing FFmpeg →
brew install ffmpeg - Missing Chrome →
npx hyperframes browser ensure - Low memory → close other apps (each render worker uses ~256MB)
bash
npx hyperframes doctor # 检查环境(Chrome、FFmpeg、Node、内存、磁盘)
npx hyperframes browser # 管理内置的Chrome安装
npx hyperframes info # 查看版本和环境详情
npx hyperframes upgrade # 检查版本更新如果渲染失败或输出结果不符合预期,请先执行命令。常见问题:
doctor- 缺失FFmpeg → 执行安装
brew install ffmpeg - 缺失Chrome → 执行安装
npx hyperframes browser ensure - 内存不足 → 关闭其他应用(每个渲染工作进程约占用256MB内存)
Other Commands
其他命令
bash
npx hyperframes compositions # list compositions in current project
npx hyperframes docs # open documentation in browser
npx hyperframes benchmark . # benchmark render performancebash
npx hyperframes compositions # 列出当前项目中的所有合成内容
npx hyperframes docs # 在浏览器中打开官方文档
npx hyperframes benchmark . # 测试渲染性能