Communitygithub.com

HyperFrames CLI

HyperFrames CLI 工具 — 提供 hyperframes init, lint, inspect, preview, render, transcribe, tts, doctor, browser, info, upgrade, compositions, docs, benchmark 等指令。可用於建立專案、程式碼檢查、驗證、視覺佈局檢查、在 Studio 中預覽、渲染影片、轉錄音訊、產生 TTS,或排除 HyperFrames 環境問題。

HyperFrames CLI 是什麼?

HyperFrames CLI 是一個全方位的指令列工具,專為使用 HyperFrames 框架建立基於 HTML 的影片組合而設計。它透過 `npx hyperframes` 執行,並依賴 Node.js >= 22 和 FFmpeg。主要功能包括:使用 `init` 從多個範本(如 blank、warm-grain、play-mode)建立專案;使用 `lint` 檢查 `data-composition-id`、重疊軌道和未註冊時間軸等問題;使用 `inspect` 在無頭 Chrome 中進行視覺佈局檢查,偵測文字溢出容器或畫布;使用 `preview` 啟動具備熱重載的 Studio 預覽伺服器;使用 `render` 輸出 MP4 或 WebM 格式的影片,並支援草稿、標準和高品質模式。此外,還提供 `transcribe`(基於 Whisper 的音訊轉錄)、`tts`(文字轉語音)、`doctor`(環境診斷)以及 `upgrade`(更新檢查)等實用工具。此工具鏈支援從開發到交付的完整工作流程,確保專案在渲染前已正確除錯和優化。

相容平台~Claude Code✓Codex CLI~Cursor
npx skills add https://github.com/libz-renlab-ai/TeamBrain/tree/HEAD/.pi/skills/hyperframes-cli

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

HyperFrames CLI 是做什麼的?

一切都透過 npx hyperframes 執行。需安裝 Node.js >= 22 及 FFmpeg。

工作流程

  1. 建立專案 — npx hyperframes init my-video
  2. 編寫 — 編寫 HTML 組合(參閱 hyperframes 技能)
  3. 程式碼檢查 — npx hyperframes lint
  4. 視覺檢查 — npx hyperframes inspect
  5. 預覽 — npx hyperframes preview
  6. 渲染 — npx hyperframes render

請在預覽前先執行 lint 和 inspect。lint 會檢查遺漏的 data-composition-id、重疊軌道及未註冊的時間軸。inspect 會在無頭 Chrome 中開啟渲染後的組合,掃描時間軸,並回報文字溢出氣泡/容器或畫布的問題。

建立專案

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 --example blank --tailwind # 搭配 Tailwind v4 瀏覽器執行環境
npx hyperframes init my-video --non-interactive       # 跳過提示 (CI/代理)

範本:blank、warm-grain、play-mode、swiss-grid、vignelli、decision-tree、kinetic-type、product-promo、nyt-graph。

init 會建立正確的檔案結構、複製媒體檔案、使用 Whisper 轉錄音訊,並安裝 AI 編碼技能。請使用此指令,而非手動建立檔案。

使用 --tailwind 時,請在編輯類別或主題標記之前,先呼叫 tailwind 技能。此建置範本使用 Tailwind v4.2 的瀏覽器執行環境,而非 Studio 的 Tailwind v3 設定。

程式碼檢查

npx hyperframes lint                  # 目前目錄
npx hyperframes lint ./my-project     # 指定專案
npx hyperframes lint --verbose        # 資訊層級結果
npx hyperframes lint --json           # 機器可讀格式

檢查 index.html 及 compositions/ 目錄中的所有檔案。回報錯誤(必須修正)、警告(建議修正)以及資訊(使用 --verbose)。

視覺檢查

npx hyperframes inspect                 # 檢查時間軸上的渲染佈局
npx hyperframes inspect ./my-project    # 指定專案
npx hyperframes inspect --json          # 代理可讀格式的結果
npx hyperframes inspect --samples 15    # 更密集的時間軸掃描
npx hyperframes inspect --at 1.5,4,7.25 # 明確的主要畫面時間戳

請在 lint 和 validate 之後使用此指令,特別適用於包含對話氣泡、卡片、字幕或緊密排版的組合。它會回報:

  • 延伸至最近視覺容器或氣泡外部的文字
  • 被自身固定寬/高框裁剪的文字
  • 超出組合畫布的文字
  • 逃離裁剪容器的子元素

錯誤應在渲染前修正。警告會提供給代理審查;加上 --strict 可在出現警告時也導致失敗。重複的靜態問題預設會摺疊,以便 JSON 輸出在 LLM 上下文中保持簡潔。如果溢出是為了進場/退場動畫而設計的,請在元素或其祖先上標記 data-layout-allow-overflow。如果裝飾性元素不應被審計,請標記 data-layout-ignore。

npx hyperframes layout 仍可作為相容性別名,用於執行相同的視覺檢查。

預覽

npx hyperframes preview                   # 提供目前目錄
npx hyperframes preview --port 4567       # 自訂連接埠(預設 3002)

檔案變更時會自動熱重載。會自動在瀏覽器中開啟 Studio。

將專案交回給使用者時,請使用 Studio 專案 URL,而非原始碼 index.html 路徑:

http://localhost:<port>/#project/<project-name>

請使用預覽輸出中的實際連接埠及專案目錄名稱。例如,在 codex-openai-video 目錄中執行 npx hyperframes preview --port 3017 後,應回報 http://localhost:3017/#project/codex-openai-video。

請將 index.html 視為僅供原始碼上下文參考。將其連結為實作檔案是可以的,但不要將其標記為專案或預覽表面。

渲染

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/name_timestamp.mp4輸出路徑
--fps24, 30, 603060fps 會使渲染時間加倍
--qualitydraft, standard, highstandarddraft 用於迭代
--formatmp4, webmmp4WebM 支援透明度
--workers1-8 或 autoauto每個工作者會啟動一個 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 .    # 基準測試渲染效能

Individual skills in this repo

This repo contains 5 individual skills — each has its own dedicated page.

libz-renlab-ai/TeamBrain

Asset preprocessing for HyperFrames compositions — text-to-speech narration (Kokoro), audio/video transcription (Whisper), and background removal for transparent overlays (u2net). Use when generating voiceover from text, transcribing speech for captions, removing the background from a video or image to use as a transparent overlay, choosing a TTS voice or whisper model, or chaining these (TTS → transcribe → captions). Each command downloads its own model on first run.

libz-renlab-ai/TeamBrain

Install and wire registry blocks and components into HyperFrames compositions. Use when running hyperframes add, installing a block or component, wiring an installed item into index.html, or working with hyperframes.json. Covers the add command, install locations, block sub-composition wiring, component snippet merging, and registry discovery.

libz-renlab-ai/TeamBrain

Create video compositions, animations, title cards, overlays, captions, voiceovers, audio-reactive visuals, and scene transitions in HyperFrames HTML. Use when asked to build any HTML-based video content, add captions or subtitles synced to audio, generate text-to-speech narration, create audio-reactive animation (beat sync, glow, pulse driven by music), add animated text highlighting (marker sweeps, hand-drawn circles, burst lines, scribble, sketchout), or add transitions between scenes (crossfades, wipes, reveals, shader transitions). Covers composition authoring, timing, media, and the full video production workflow. For CLI commands (init, lint, preview, render, transcribe, tts) see the hyperframes-cli skill.

libz-renlab-ai/TeamBrain

Translate an existing Remotion (React-based) video composition into a HyperFrames HTML composition. Use ONLY when the user explicitly asks to port, convert, migrate, translate, or rewrite a Remotion composition as HyperFrames — for example "port my Remotion project to HyperFrames", "convert this Remotion code to HyperFrames", "migrate from Remotion", "translate this Remotion comp", or "rewrite this as HyperFrames HTML". Do NOT use when (a) the user is authoring a NEW HyperFrames composition, even if they have or are A/B-testing a similar Remotion video; (b) the user mentions Remotion in passing without asking for migration; (c) the user shares Remotion code as reference material rather than asking for a translation; (d) the user asks for "the same video as my Remotion one" without explicitly asking to migrate the source — treat that as a fresh HyperFrames build. When in doubt, default to authoring a native HyperFrames composition with the `hyperframes` skill instead. Skill detects unsupported patterns (use...

libz-renlab-ai/TeamBrain

Capture a website and create a HyperFrames video from it. Use when: (1) a user provides a URL and wants a video, (2) someone says "capture this site", "turn this into a video", "make a promo from my site", (3) the user wants a social ad, product tour, or any video based on an existing website, (4) the user shares a link and asks for any kind of video content. Even if the user just pastes a URL — this is the skill to use.

相關技能