HyperFrames CLI
npm install -g hyperframes # 或使用 npx
命令
init
npx hyperframes init <名称> [--template blank|product|explainer|slideshow] [--fps 30] [--width 1920] [--height 1080]
lint
npx hyperframes lint [文件] [--fix] [--strict] [--json]
检查内容:有效的 data-hf-* 属性、时间格式、重叠片段、缺失时长、不可达资源、TTS 长度限制。
preview
npx hyperframes preview [文件] [--port 3000] [--open] [--scene <场景名>] [--time <时间>]
实时开发服务器,支持进度条拖拽、场景选择器和热重载。
render
export HEYGEN_API_KEY=您的密钥
npx hyperframes render [文件] [--out 输出.mp4] [--format mp4|webm|gif] [--quality 85] [--scene <场景名>]
doctor
npx hyperframes doctor
检查 Node ≥ 18、API 密钥、网络连接、资源路径、配置语法。
hyperframes.config.json
{
"version": 1,
"entry": "index.html",
"output": "./output.mp4",
"canvas": { "width": 1920, "height": 1080, "fps": 30 },
"render": { "quality": 85, "format": "mp4" },
"tts": { "defaultVoice": "en-US-neural-f1", "speed": 1.0 },
"assets": { "baseUrl": "./assets" }
}
环境变量
| 变量 | 描述 |
|---|---|
HEYGEN_API_KEY | 渲染必需 |
HEYGEN_REGION | us(默认)或 eu |
HF_LOG_LEVEL | debug、info、warn、error |
开发循环
npx hyperframes init my-video --template product
cd my-video
# 编辑 index.html
npx hyperframes lint
npx hyperframes preview --open
npx hyperframes render --out output.mp4