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 <t>]
提供即時開發伺服器,包含時間軸拖曳、場景選擇與熱重載功能。
render
export HEYGEN_API_KEY=your_key
npx hyperframes render [檔案] [--out output.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