Code2MP4 has two CLIs serving different audiences:
| CLI | Audience | Purpose |
|---|---|---|
od |
Coding agents | Media generation, health checks (dispatches to REST API) |
code2mp4 |
Developers | Project scaffolding, rendering, quality checks, campaign packaging |
This document defines the developer-facing code2mp4 CLI.
code2mp4 <command> [options]
All commands operate on a project directory. The project root is resolved by walking up from the current working directory for a code2mp4.config.json or falling back to ./projects/<name>.
Scaffold a new video project from a template.
code2mp4 init [name] [options]
Options:
--template, -t Template to use (product-launch, oss-intro, release-notes)
--name, -n Project name (defaults to template name)
--dir, -d Target directory (defaults to ./projects/<name>)
--non-interactive Skip discovery questions, use template defaultsWhat it does:
- Creates the project directory with
code2mp4.config.json - Copies the selected template's files
- Generates
brief.jsonfrom discovery questions (or template defaults) - Outputs the project path and next steps
Example:
code2mp4 init --template product-launch --name "widgetx-v2"
# → Created project at projects/widgetx-v2/
# → Next: code2mp4 storyboard projects/widgetx-v2Alias for code2mp4 init — create a new project.
Generate a storyboard from a brief.
code2mp4 storyboard <project-dir> [options]
Options:
--brief Brief file path (default: <project-dir>/brief.json)
--motion, -m Motion system override
--output, -o Output path (default: <project-dir>/storyboard.json)What it does:
- Reads
brief.jsonandscript.json(if present) - Composes the Director Agent prompt
- Runs the agent to generate a storyboard
- Validates the storyboard against the brief
- Writes
storyboard.json
Generate motion source from a storyboard.
code2mp4 build <project-dir> [options]
Options:
--storyboard, -s Storyboard file path
--scene, -n Build a specific scene only (by id or number)
--retry, -r Retry a failed sceneWhat it does:
- Reads
storyboard.json - Runs the Scene Agent for each scene (or specified scene)
- Writes scene HTML fragments
- Assembles into a complete HyperFrames composition
- Writes the composition to
<project-dir>/.hf-cache/<timestamp>/index.html
Render the assembled composition to MP4.
code2mp4 render <project-dir> [options]
Options:
--quality, -q Render quality: draft, standard, high (default: standard)
--fps, -f Frames per second (default: 30)
--resolution, -r Output resolution: hd, fhd, 4k (default: fhd)
--format Output format: mp4, webm (default: mp4)
--output, -o Output file path (default: <project-dir>/output.mp4)
--variables Composition variable overrides (JSON string)What it does:
- Detects the latest composition directory in
.hf-cache/ - Runs quality pre-checks (lint, inspect)
- Spawns
npx hyperframes renderwith the specified options - Streams render progress to stdout
- Writes the MP4 file
Run quality checks against a project.
code2mp4 check <project-dir> [options]
Options:
--output, -o Output path (default: <project-dir>/quality-report.json)
--strict Treat warnings as errorsWhat it does:
- Reads all project artifacts (brief, script, storyboard, composition)
- Runs the Video Review Theater across 7 dimensions:
- Hook strength
- Script quality (anti-AI phrase detection)
- Readability (text density, font sizes, safe zones)
- Motion quality (animation variety, determinism)
- Platform suitability (aspect ratio, duration, silent-safe)
- Brand consistency (palette, fonts, logo)
- Render determinism (lint, inspect)
- Writes
quality-report.json - Exits 0 on pass, 1 on failure (errors) or 2 on warnings
Example CI integration:
- name: Quality check
run: code2mp4 check ./projects/release-video --strictGenerate platform variants from one motion source.
code2mp4 variants <project-dir> [options]
Options:
--all Generate all platform variants
--aspect Specific aspect ratio: 16:9, 9:16, 1:1, 4:5
--duration Specific duration variant in seconds
--audio-mode Audio mode: full, music-only, silent, captionedWhat it does:
- Reads the project brief for format variants
- Generates
render.config.jsonfor each variant - Renders each variant (or re-uses existing renders)
- Writes variant MP4s to
<project-dir>/variants/
Build a complete campaign package from rendered variants.
code2mp4 package <project-dir> [options]
Options:
--output, -o Output directory (default: <project-dir>/campaign/)What it does:
- Collects all rendered MP4 variants
- Generates cover images per platform
- Generates social media copy per platform
- Generates SRT captions (if voiceover exists)
- Writes
campaign/package.json(campaign manifest) - Outputs the package directory structure
Output structure:
campaign/
videos/
output-16x9-30s.mp4
output-9x16-15s.mp4
output-1x1-15s.mp4
covers/
youtube-thumb.jpg
instagram-cover.jpg
github-preview.gif
captions/
landscape-30s.srt
portrait-15s.srt
copy/
tweet.md
linkedin-post.md
release-notes.md
package.json
code2mp4 [command] [options]
Global:
--help, -h Show help
--version, -v Show version
--quiet, -q Suppress output except errors
--json Output as JSON (for CI/agent consumption)
--project, -p Project directory (override auto-detection)Project configuration is stored in code2mp4.config.json at the project root:
{
"version": 1,
"engine": "hyperframes",
"defaults": {
"quality": "standard",
"fps": 30,
"resolution": "fhd",
"format": "mp4"
}
}| Command | Status |
|---|---|
code2mp4 init |
Template system ready, CLI entry point pending |
code2mp4 build |
Multi-stage pipeline implemented, CLI wiring pending |
code2mp4 render |
Bridge functions ready, CLI wiring pending |
code2mp4 check |
Quality report schema defined, reviewer skill created, implementation pending |
code2mp4 variants |
Schema defined, implementation pending |
code2mp4 package |
Campaign manifest schema defined, implementation pending |
The Code2MP4 CLI dispatcher exposed through C2M_BIN handles agent-facing media generate / media wait / health commands.