OpenShorts — make a short video from one sentence
The user gives a topic, an article URL, or a script. You do everything else: install, health-check, script, footage, voice, captions, render, publish pack. Deliver file paths at the end. Do not stop after explaining the steps.
Required behavior
- Ask the user for at most one thing, once: an API key for a text model (DeepSeek / Kimi / GLM / OpenAI-compatible…) only if
openshorts newreports a missing key. Everything else (footage, voice, rendering) is free and needs no key. - Do not ask for confirmation before installing, running
doctor, installing the bundled ffmpeg, or rendering. Send one short progress line, then execute. - Run long commands in the foreground with a timeout of at least 15 minutes. Do not poll with
sleep/lsloops. - On failure read only the last 30 lines of output; OpenShorts prints the real cause (missing libass, missing key, quality-check items), not just an exit code.
- Never print API keys or the contents of
~/.ao/~/.openshorts/config.json.
Defaults
Unless the user says otherwise: Chinese talking-head explainer, 60 s, 1080×1920, free Edge TTS voice, Wikimedia Commons / Pexels footage, captions burned in, AI-content label on. Output goes to ~/OpenShorts/<project>/. For English use --lang en (script, voice and caption line-breaking switch together).
Execution
1. Install (once)
node -v # must be >= 20
npx openshorts version # installs on first use; no clone needed
Alternative: use the MCP server instead of the CLI
If your host supports MCP, register npx openshorts mcp and call create_video → poll job_status every 20–30 s → doctor on failure. It runs the same pipeline as the CLI steps below and returns the same file paths; prefer it when the host would otherwise time out on a 10-minute shell command.
2. Health check — do not skip
node bin/openshorts.mjs doctor
If it says ffmpeg lacks libass (captions cannot be burned in — Homebrew's ffmpeg has this problem), run:
node bin/openshorts.mjs install-ffmpeg # ~40 MB, pinned build with sha256 check, installed to ~/.openshorts/bin only
3. Write the script
node bin/openshorts.mjs new koubo-kepu --topic "<topic or full script>" # Chinese
node bin/openshorts.mjs new --lang en --topic "<topic or full script>" # English
Add --local-dir <folder> to prefer the user's own footage, --voice <id> to pick a voice (npm run voices lists them). If the command reports a missing text-model key, ask the user for one key, then configure it once:
DEEPSEEK_API_KEY=<key> node bin/openshorts.mjs new koubo-kepu --topic "<topic>" # any provider the engine knows: DEEPSEEK_API_KEY / MOONSHOT_API_KEY / OPENAI_API_KEY …
The command prints the project path: ~/OpenShorts/<project>/project.json.
4. Estimate, render, pack
node bin/openshorts.mjs estimate ~/OpenShorts/<project>/project.json # cost is ¥0 on the default path; tells the expected wait
node bin/openshorts.mjs run ~/OpenShorts/<project>/project.json # footage → voice → captions → mp4 + quality check
node bin/openshorts.mjs export ~/OpenShorts/<project>/project.json --platform douyin # or shorts / bilibili / channels
run reuses finished shots on re-runs; run … --only s2 redoes one shot. openshorts rm <project.json> --yes deletes a project the user no longer wants (ask first — it removes the whole folder). If run ends with quality-check ⛔ items, report them verbatim to the user instead of calling it done.
Exit handling
On success run prints:
✓ 成片:/Users/…/OpenShorts/<project>/<project>.mp4(58.3s,出片用时 47 秒)
字幕:…/<project>.srt
封面:…/<project>-cover.jpg
发布文案:…/<project>-发布文案.txt
Return those four paths plus the publish pack directory from export. If the output contains ⛔, return the message as-is and stop; do not retry blindly.
Notes for the agent
- Everything runs on the user's machine; no video is uploaded anywhere. Only the script step calls the user's own text-model API.
openshorts drama --plan -i story="…"previews the cost of an AI mini-drama before spending anything; only rundramawithout--planafter the user has seen the estimate.- Web UI alternative:
npm run openshortsopens http://127.0.0.1:4174 (the same pipeline, four steps).