> ## Documentation Index
> Fetch the complete documentation index at: https://docs.khanhng.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Demo Studio engine commands (ds.py)

> ds.py runs every Demo Studio pipeline step: init, voice, music, capture, plan, compile, render, export, all and version, each on a project and version.

Every Demo Studio pipeline step is one `ds.py` command run on a project folder and a version (`v1`, `v2` and so on). Claude runs these for you; this page is for reading its progress or rebuilding a version yourself.

```bash theme={null}
python3 $ENGINE/ds.py <step> <project_dir> <version>
```

`$ENGINE` is the `engine/` folder of the `demo-video` skill. Run `bash $ENGINE/setup.sh` first in every session.

| Command | What it does |
| - | - |
| `init <project_dir> "<Project Name>"` | Create the project folder, `brief.yaml` and a v1 build with templates |
| `voice <project_dir> <v>` | Verify and time the voice clips (`clips.yaml` to `words.json`), with a recogniser cross-check per clip |
| `music <project_dir> <v> <music file>` | Analyse the track: tempo, bars, sections and ending (to `music.json`) |
| `capture <project_dir> <v>` | Capture the real UI (`capture.json` to `snap/`) |
| `plan <project_dir> <v>` | Script, words and music to `timeline.json`; prints sentences, captions and the music edit, and warns on fast captions |
| `compile <project_dir> <v>` | Build the scenes, run the layout and coverage checks (about 3 s) and render `preview_sheet.jpg` |
| `render <project_dir> <v> [--draft]` | Mix the audio and render the captioned and clean videos (about 3 minutes per minute of video) |
| `export <project_dir> <v> [--no-tests]` | Package deliverables in `out/<v>/` and run the acceptance gate (about 2 minutes) |
| `all <project_dir> <v>` | Run plan, compile, render and export in order |
| `version <project_dir> <from_v> <to_v>` | Start a revision by copying the specs of one version into a new build folder |

## Re-run the acceptance gate only

```bash theme={null}
python3 $ENGINE/acceptance/run_acceptance.py <build_dir> --tests
```

Add `--only layout,coverage` for a 3-second layout check.

## Project files

Each build folder (`build/vN/`) holds the specs Claude writes:

| File | Holds |
| - | - |
| `clips.yaml` | Voice clips: file, source, the exact spoken text, and an optional `lexicon` for brand words |
| `script.yaml` | Sentence order, gaps, anchors on music hits, caption display forms and music settings |
| `capture.json` | The [UI capture plan](https://docs.khanhng.com/demo-studio/capture-plan.md) |
| `scenes.yaml` | The [scene spec](https://docs.khanhng.com/demo-studio/scene-spec.md) |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.