--- title: CLI description: "Create, preview, and render HTML video compositions from the command line." --- The `hyperframes` CLI is the primary way to work with Hyperframes. It handles project creation, live preview, rendering, linting, and diagnostics — all from your terminal. ```bash npm install -g hyperframes # or use directly with npx npx hyperframes ``` ## When to Use **Use the CLI when you want to:** - Capture a website for video production (`capture`) - Create a new composition project from an example (`init`) - Preview compositions with live hot reload (`preview`) - Render compositions to MP4 locally or in Docker (`render`) - Lint compositions for structural issues (`lint`) - Inspect rendered visual layout for text overflow, clipped containers, and overlapping text, plus verify motion intent against the seeked timeline (`inspect`) - Capture key frames as PNG screenshots (`snapshot`) - Check your environment for missing dependencies (`doctor`) **Use a different package if you want to:** - Render programmatically from Node.js code — use the [producer](/packages/producer) - Build a custom frame capture pipeline — use the [engine](/packages/engine) - Embed a composition editor in your own web app — use the [studio](/packages/studio) - Parse or generate composition HTML in code — use [core](/packages/core) The CLI is the recommended starting point for all Hyperframes users. It wraps the producer, engine, and studio packages so you do not need to install them separately. ## Agent-Friendly by Default The CLI is **agent-friendly by default**: commands support explicit flags and parseable output so automation can run reliably. - Inputs can be passed via flags (for example, `--example`, `--video`, `--output`) - Missing required flags fail fast with a clear error and usage example - Output is plain text suitable for parsing Interactivity is command-specific. For example, `init` uses prompts on TTY by default; pass `--non-interactive` to force non-interactive mode. `--human-friendly` is also command-specific (for example, `catalog`). It is not a global flag on every command. ```bash # Fully non-interactive — all inputs from flags npx hyperframes init my-video --example blank --video video.mp4 npx hyperframes render --output output.mp4 --fps 30 --quality standard npx hyperframes upgrade --check --json ``` ```bash # Command-specific interactive flow npx hyperframes init my-video # Interactive picker supported by catalog npx hyperframes catalog --human-friendly ``` ### JSON Output and `_meta` Envelope All commands that support `--json` wrap their output with a `_meta` field containing version check info: ```json { "name": "my-video", "duration": 10.5, "_meta": { "version": "0.1.4", "latestVersion": "0.1.5", "updateAvailable": true } } ``` This allows agents to detect outdated versions from any command's output without running a separate upgrade check. The version data comes from a 24-hour cache — no network request is made during `--json` output. ### Passive Update Notices The CLI checks npm for newer versions in the background (cached 24 hours). If an update is available, a notice appears on stderr after command completion: ``` Update available: 0.1.4 → 0.1.5 Run: npx hyperframes@latest ``` This is suppressed in CI environments, non-TTY shells, and when `HYPERFRAMES_NO_UPDATE_CHECK=1` is set. ## Getting Started Scaffold a new composition from an example: ```bash npx hyperframes init --example warm-grain ``` You will be prompted for a project name, or pass it as an argument: ```bash npx hyperframes init my-video --example warm-grain ``` See [Examples](/examples) for all available examples. Start the development server with live hot reload: ```bash cd my-video npx hyperframes preview ``` The Hyperframes Studio opens in your browser. Edit `index.html` and the preview updates instantly. Check for structural issues before rendering: ```bash npx hyperframes lint ``` ``` ◆ Linting my-project/index.html ◇ 0 errors, 0 warnings ``` Produce the final video: ```bash npx hyperframes render --output output.mp4 ``` Render a specific composition instead of `index.html`: ```bash npx hyperframes render -c compositions/intro.html -o intro.mp4 ``` For deterministic output, add `--docker`: ```bash npx hyperframes render --docker --output output.mp4 ``` ## Commands ### `init` Create a new composition project from an example: ```bash # Agent mode (default) — --example is required npx hyperframes init my-video --example blank --video video.mp4 # Include Tailwind CSS browser-runtime support npx hyperframes init my-video --example blank --tailwind # Human mode — interactive prompts on TTY by default npx hyperframes init my-video ``` | Flag | Description | |------|-------------| | `--example, -e` | Example to scaffold (required in default mode, interactive in `--human-friendly`) | | `--resolution` | Canvas preset: `landscape` (1920×1080), `portrait` (1080×1920), `landscape-4k` (3840×2160), `portrait-4k` (2160×3840), `square` (1080×1080), `square-4k` (2160×2160). Aliases: `1080p`, `4k`, `uhd`, `1080p-square`, `square-1080p`, `4k-square`. Default: keep template dimensions. | | `--video, -V` | Path to a video file (MP4, WebM, MOV) | | `--audio, -a` | Path to an audio file (MP3, WAV, M4A) | | `--tailwind` | Add Tailwind CSS browser-runtime support to scaffolded HTML | | `--skip-skills` | Skip AI coding skills installation | | `--skip-transcribe` | Skip automatic whisper transcription | | `--model` | Whisper model for transcription (e.g. `small.en`, `medium.en`, `large-v3`) | | `--language` | Language code for transcription (e.g. `en`, `es`, `ja`). Filters non-target speech. | | Example | Description | |----------|-------------| | `blank` | Empty composition — just the scaffolding | | `warm-grain` | Cream aesthetic with grain texture | | `play-mode` | Playful elastic animations | | `swiss-grid` | Structured grid layout | | `vignelli` | Bold typography with red accents | In non-interactive mode, `--example` is required — the CLI errors with a usage example if missing. In interactive mode (default on TTY), you choose the example interactively. Pass `--non-interactive` to require `--example` via flag. When `--video` or `--audio` is provided, the CLI automatically transcribes the audio with Whisper and patches captions into the composition (use `--skip-transcribe` to disable). `--tailwind` injects the pinned Tailwind v4 browser runtime into scaffolded HTML and exposes a `window.__tailwindReady` promise that renders wait on before capturing frame 0. Use the `/hyperframes-core` skill when editing these projects so agents follow v4 CSS-first patterns instead of v3 `tailwind.config.js` and `@tailwind` directive patterns. The browser runtime is still intended for scaffolded projects and quick iteration; for fully offline or locked-down production renders, compile Tailwind to CSS and include the stylesheet directly. After scaffolding, the CLI installs AI coding skills for Claude Code, Gemini CLI, and Codex CLI (use `--skip-skills` to disable). See [`skills`](#skills) command. See [Examples](/examples) for full details. ### `add` Install a **block** or **component** from the registry into an existing project. Examples (full projects) are scaffolded with [`init`](#init); blocks and components are smaller units you add to a composition you already have. ```bash # Add a block (sub-composition scene) npx hyperframes add claude-code-window # Add a component (effect / snippet) npx hyperframes add shader-wipe # Target a different project dir npx hyperframes add shader-wipe --dir ./my-video # Headless / CI (skip clipboard; also: --json for a machine-readable result) npx hyperframes add shader-wipe --no-clipboard --json ``` | Flag | Description | |------|-------------| | `` (positional) | Registry item name (e.g. `claude-code-window`, `shader-wipe`) | | `--dir` | Project directory (defaults to the current working directory) | | `--no-clipboard` | Skip copying the include snippet to the clipboard | | `--json` | Print a machine-readable summary (written files + snippet) to stdout | `add` reads [`hyperframes.json`](#hyperframes-json) at the project root to know which registry to pull from and where to drop files. If the file is missing but the directory looks like a Hyperframes project (has `index.html`), a default `hyperframes.json` is written the first time you run `add`. Output for a block or component is a set of files plus a **paste snippet** — the `