media-use
heygen-com/hyperframes
Resolve media needs (BGM, SFX, image, icon) into frozen local files with one command.
What is media-use?
media-use is an Agent Media OS that converts any media request into a cached, registered local file. Call `resolve` with a type and natural-language intent; it searches HeyGen catalogs, downloads the best match, freezes it locally, and returns a single file path. Use when composing videos or projects that need background music, sound effects, images, or icons.
- Resolve four media types (bgm, sfx, image, icon) via single `resolve` command
- Search HeyGen audio catalog (10k+ tracks), bundled SFX library, and asset search (75k+ vectors)
- Cache results locally in `.media/` with manifest and human-readable inventory
- Adopt existing `assets/` directories into the manifest with metadata extraction
- Return one-line output to agent; keep all search noise and candidates on disk
- Support cross-project reuse via global cache at `~/.media/`
How to install media-use
npx skills add https://github.com/heygen-com/hyperframes --skill media-use- Node.js environment with npx
- ffprobe (for metadata extraction on adopt)
- heygen CLI >= v0.1.6 installed and authenticated with HEYGEN_API_KEY
How to use media-use
- 1.Install the skill: `npx skills add https://github.com/heygen-com/hyperframes --skill media-use`
- 2.Set up heygen CLI: `curl -fsSL https://static.heygen.ai/cli/install.sh | bash` and authenticate with `export HEYGEN_API_KEY=<your-key>`
- 3.Call resolve with type and intent: `node <SKILL_DIR>/scripts/resolve.mjs --type bgm --intent "upbeat tech launch" --project .`
- 4.Receive one-line output with resolved file path and metadata
- 5.Read `.media/index.md` to view full inventory of resolved assets
- 6.Optionally adopt existing assets: `node <SKILL_DIR>/scripts/resolve.mjs --adopt --project .`
Use cases
- Retrieve background music for a video composition by describing mood or genre
- Find sound effects (whoosh, click, alert) without manual library browsing
- Locate images and gradients for video backgrounds by intent description
- Discover icons matching a project theme or brand
- Bulk-import and organize existing media assets from legacy projects
- Video composition agents and automation workflows
- Content creators building multimedia projects programmatically
- Teams managing reusable media libraries across multiple projects
- Developers integrating HeyGen assets into agent-driven pipelines
media-use FAQ
resolve falls through the cascade (project cache → global cache → provider search). If no provider can resolve, it prints a diagnostic to stderr and returns no result.
Assets are cached in `~/.media/` by content hash (SHA-256). Subsequent resolves for the same prompt hit the global cache; promote assets explicitly with `organize --promote <id>` for cross-project reuse.
Yes. Place files in `assets/` and run `--adopt` to register them in the manifest with extracted metadata (duration, dimensions).
manifest.jsonl stores full JSON records; index.md shows id, type, duration (audio), dimensions (images), path, and description for quick reference.
Yes, set HEYGEN_API_KEY environment variable. The heygen CLI must be >= v0.1.6 and on PATH for provider searches to work.
Full instructions (SKILL.md)
Source of truth, from heygen-com/hyperframes.
name: media-use
description: Agent Media OS — resolve any media need (BGM, SFX, image, icon) into a frozen local file + ledger record. One verb (resolve) handles the full cascade — project cache, global cache, HeyGen catalog search, freeze, register. Keeps search noise on disk, hands the agent a path. Use when a composition needs background music, sound effects, images, or icons.
media-use
Resolve media needs into frozen local files. One verb, four types, zero context noise.
When to use
Call resolve whenever a composition needs media — background music, sound effects, images, or icons. media-use searches the HeyGen catalog, downloads the best match, freezes it locally, and registers it in a manifest. The agent gets back one line; all search noise stays on disk.
Resolve
node <SKILL_DIR>/scripts/resolve.mjs --type <type> --intent "<description>" --project <dir>
Returns one line: resolved <id> → <path> (<type>, <metadata>)
Types
| Type | What it finds | Provider |
|---|---|---|
bgm | Background music | HeyGen audio catalog (10k+ tracks) |
sfx | Sound effects | Bundled 19-file library + HeyGen catalog |
image | Photos, backgrounds | HeyGen asset search (75k+ vectors) |
icon | Icons, logos | HeyGen asset search (type=icon) |
Examples
# Background music
node <SKILL_DIR>/scripts/resolve.mjs --type bgm --intent "upbeat tech launch" --project .
# → resolved bgm_001 → .media/audio/bgm/bgm_001.mp3 (bgm, 25s)
# Sound effect
node <SKILL_DIR>/scripts/resolve.mjs --type sfx --intent "whoosh" --project .
# → resolved sfx_001 → .media/audio/sfx/sfx_001.mp3 (sfx, 0.57s)
# Image
node <SKILL_DIR>/scripts/resolve.mjs --type image --intent "gradient tech background" --project .
# → resolved image_001 → .media/images/image_001.jpg (image)
# Icon
node <SKILL_DIR>/scripts/resolve.mjs --type icon --intent "rocket" --project .
# → resolved icon_001 → .media/images/icon_001.png (icon, transparent)
Flags
| Flag | Description |
|---|---|
--type, -t | Media type: bgm, sfx, image, icon |
--intent, -i | What you need (natural language) |
--entity, -e | Entity name for cache matching (optional) |
--project, -p | Project directory (default: .) |
--adopt | Bulk-import existing assets/ into manifest |
--json | Output JSON instead of one-line result |
How it works
- Check project
.media/manifest.jsonlfor exact-prompt match - Scan existing
assets/directory for unregistered files matching the need - Check global cache
~/.media/for reusable asset - Search via provider (HeyGen audio catalog, HeyGen asset search)
- Freeze file to
.media/<type>/, register in manifest, regenerateindex.md
The agent gets back one line. Candidates, scores, provenance stay on disk.
Adopt existing projects
Most HyperFrames projects already have assets in assets/. media-use adopts them:
node <SKILL_DIR>/scripts/resolve.mjs --adopt --project .
# → adopted 9 assets from assets/
# bgm_001 → assets/bgm/mango-fizz.mp3 (bgm, 146.6s)
# image_001 → assets/images/avatar.jpg (image, 400×400)
ffprobe extracts real duration and dimensions. During resolve, unregistered files in assets/ matching the intent are adopted on the fly.
Reading the inventory
After resolve or adopt, read .media/index.md for the full inventory:
# .media · 4 assets
id type dur dims path description
bgm_001 bgm 25s — .media/audio/bgm/bgm_001.mp3 upbeat tech launch
sfx_001 sfx 0.6s — .media/audio/sfx/sfx_001.mp3 whoosh
image_001 image — 1920×1080 .media/images/image_001.jpg gradient tech background
icon_001 icon — 200×200 .media/images/icon_001.png rocket
Cross-project reuse
Assets are cached automatically on resolve. Subsequent resolves for the same prompt hit the global cache at ~/.media/ — no re-download, no provider call. Promote an asset explicitly with organize --promote <id> to make it reusable across all projects.
Files
.media/manifest.jsonl— machine SSOT, one JSON record per line.media/index.md— agent-readable table (id, type, dur, dims, path, description)~/.media/— global cross-project reuse cache (content-addressed, SHA-256)
CLI tools used
| Tool | Purpose | Required? |
|---|---|---|
ffprobe | Probe duration, dimensions, codec on adopt | Yes |
heygen | Audio catalog, asset search | For providers |
Install the heygen CLI (single static binary, no runtime) and authenticate:
curl -fsSL https://static.heygen.ai/cli/install.sh | bash # installs latest to ~/.local/bin
heygen update # if already installed: needs >= v0.1.6
export HEYGEN_API_KEY=<your-key> # or: heygen auth login --key <key>
Requires heygen >= v0.1.6 — the providers tag requests with the allowlisted --headers 'X-HeyGen-Client-Source: media-use' flag, added in v0.1.6. asset search is a pre-launch command hidden from heygen --help, but it runs. Without a heygen on PATH (or a valid key) the providers print a one-line diagnostic to stderr and resolve falls through to "no provider could resolve".
Related skills
More from heygen-com/hyperframes and the wider catalog.
hyperframes
Router and entry skill for video authoring—renders video from HTML with intent-based workflow selection.
hyperframes-cli
CLI for HyperFrames video composition: scaffold, lint, validate, render locally or on AWS Lambda.
hyperframes-registry
Install and wire reusable blocks and components into HyperFrames compositions via registry.
remotion-to-hyperframes
Port existing Remotion (React) video compositions to HyperFrames HTML—one-way translation only.
hyperframes-media
Audio and media engine for HyperFrames: TTS, background music, sound effects, transcription, captions, and background removal.
gsap
GSAP animation reference for HyperFrames compositions with timelines, easing, and performance optimization.