asset-import
Installation
SKILL.md
Asset Import — local video into Pireel
When the user gives a local video path ("把 ~/Desktop/talk.mp4 剪一下"), do NOT tell them to open the browser and upload manually — import it yourself with the bundled helper script, then edit through the normal Pireel tools.
The helper
scripts/import-media.mjs (relative to this skill file). Node ≥ 20, zero npm dependencies. It:
- Computes the content signature (
name:size:mtime— the same fingerprint the browser uses, so the same file is one object however it enters). - Uploads the bytes to Pireel cloud storage via presigned PUT. Re-imports of the same file are dedup-skipped server-side ("bytes already in cloud").
- If
ffprobeis available: probes duration/width/height and the audio-track start offset. - If
ffmpegis available and the file has audio: extracts a small AAC track, uploads it, and runs Pireel's transcription — the transcript lands on the project immediately. - Registers everything on a project (server-side, conservative targeting) and prints a JSON summary.
Full flow: import_media (no args, MCP) → token → run helper with --token → read the JSON → get_state.