HyperFrames CLI
所有操作均通过 npx hyperframes 运行。需要 Node.js >= 22 和 FFmpeg。
工作流程
- 脚手架搭建 —
npx hyperframes init my-video - 编写 — 创作 HTML 合成(参见
hyperframes技能) - 代码检查 —
npx hyperframes lint - 预览 —
npx hyperframes preview - 渲染 —
npx hyperframes render
在预览前先进行代码检查 — 可以捕获缺失的 data-composition-id、重叠轨道、未注册的时间线等问题。
脚手架搭建
npx hyperframes init my-video # 交互式向导
npx hyperframes init my-video --example 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 场景)
模板:blank、warm-grain、play-mode、swiss-grid、vignelli、decision-tree、kinetic-type、product-promo、nyt-graph。
init 命令会创建正确的文件结构、复制媒体文件、使用 Whisper 转录音频,并安装 AI 编码技能。请使用它代替手动创建文件。
代码检查
npx hyperframes lint # 当前目录
npx hyperframes lint ./my-project # 指定项目
npx hyperframes lint --verbose # 显示信息级别的问题
npx hyperframes lint --json # 机器可读格式输出
检查 index.html 和 compositions/ 目录下的所有文件。报告错误(必须修复)、警告(建议修复)以及信息(使用 --verbose)。
预览
npx hyperframes preview # 提供当前目录服务
npx hyperframes preview --port 4567 # 自定义端口(默认 3002)
文件变更时自动热重载。会自动在浏览器中打开工作室。
渲染
npx hyperframes render # 标准 MP4
npx hyperframes render --output final.mp4 # 指定输出文件
npx hyperframes render --quality draft # 快速迭代
npx hyperframes render --fps 60 --quality high # 最终交付
npx hyperframes render --format webm # 透明 WebM
npx hyperframes render --docker # 字节一致输出
| 标志 | 选项 | 默认值 | 说明 |
|---|---|---|---|
--output | 路径 | renders/名称_时间戳.mp4 | 输出路径 |
--fps | 24、30、60 | 30 | 60fps 会使渲染时间翻倍 |
--quality | draft、standard、high | standard | draft 用于迭代 |
--format | mp4、webm | mp4 | WebM 支持透明度 |
--workers | 1-8 或 auto | auto | 每个工作者会启动一个 Chrome |
--docker | 标志 | 关闭 | 可复现输出 |
--gpu | 标志 | 关闭 | GPU 加速编码 |
--strict | 标志 | 关闭 | 遇到 lint 错误时失败 |
--strict-all | 标志 | 关闭 | 遇到错误和警告时都失败 |
质量建议: 迭代时使用 draft,审阅时使用 standard,最终交付时使用 high。
转录
npx hyperframes transcribe audio.mp3
npx hyperframes transcribe video.mp4 --model medium.en --language en
npx hyperframes transcribe subtitles.srt # 导入现有的字幕文件
npx hyperframes transcribe subtitles.vtt
npx hyperframes transcribe openai-response.json
文本转语音
npx hyperframes tts "文本内容" --voice af_nova --output narration.wav
npx hyperframes tts script.txt --voice bf_emma
npx hyperframes tts --list # 显示所有可用语音
故障排除
npx hyperframes doctor # 检查环境(Chrome、FFmpeg、Node、内存)
npx hyperframes browser # 管理捆绑的 Chrome
npx hyperframes info # 版本和环境详细信息
npx hyperframes upgrade # 检查更新
如果渲染失败,请先运行 doctor。常见问题:缺少 FFmpeg、缺少 Chrome、内存不足。
其他
npx hyperframes compositions # 列出项目中的合成
npx hyperframes docs # 打开文档
npx hyperframes benchmark . # 基准测试渲染性能