# CLI Command Reference

> Complete reference for every aifilm command and option — doctor, new, render, and style management.

Every creator workflow is available from one simple command: **`aifilm`**.

## Quick Summary

| Command | Purpose |
|---|---|
| `aifilm --version` | Show the installed `aifilm` version (`0.1.0`) |
| `aifilm doctor` | Verify FFmpeg (`libx264`) and Playwright Chromium are ready |
| `aifilm new <dir>` | Create a portable starter project (`film.yaml` + `film.schema.json`) |
| `aifilm render <film> --out <mp4>` | Render a fast preview or gated full-HD MP4 |
| `aifilm style list` | List all built-in and installed third-party visual styles |
| `aifilm style new <name> [--package]` | Scaffold a new custom visual style pack |
| `aifilm style validate <name> [--film <yaml>]` | Check a style pack against the film quality gates |

---

## `aifilm doctor`

Checks that FFmpeg with H.264 (`libx264`) encoding and Playwright's headless Chromium shell can launch locally.

```bash
aifilm doctor
```

---

## `aifilm new <directory>`

Creates a standalone project directory containing `film.yaml` and a local copy of `film.schema.json` for editor autocomplete.

```bash
aifilm new my-explainer
```

---

## `aifilm render <film.yaml> --out <output.mp4>`

Compiles and renders your film locally to an H.264 MP4 file.

| Flag | Default | Description |
|---|---|---|
| `--out <path>` | *(required)* | Destination `.mp4` path |
| `--edit <name>` | `cut` | Which edit (or `cam:<name>`) from `film.yaml` to render |
| `--style <name>` | From `film.yaml` | Temporarily override the visual style (`realistic`, `blueprint_ink`, etc.) |
| `--final` | Off (preview) | Run G0–G3 quality gates and render full-HD (`1920×1080` or `1080×1920`) at 24 fps |
| `--overwrite` | Off (protected) | Allow replacing an existing output `.mp4` file |

### Examples

```bash
# Fast 640x360 @ 12 fps preview
aifilm render hello/film.yaml --out hello.mp4

# Preview in Realistic 3D style
aifilm render hello/film.yaml --style realistic --out realistic.mp4

# Render a specific camera only
aifilm render hello/film.yaml --edit cam:portrait --out camera-check.mp4

# Gated full-HD 1920x1080 @ 24 fps final export
aifilm render hello/film.yaml --final --out hello-hd.mp4 --overwrite
```

---

## `aifilm style`

Manage built-in and third-party style packs:

```bash
aifilm style list
aifilm style new my_style --package
aifilm style validate my_style --film hello/film.yaml
```

## Related pages

- [Python SDK](https://film.praison.ai/docs/guides/python-sdk.md)
- [Step-by-Step Setup](https://film.praison.ai/docs/getting-started/install.md)
- [Troubleshooting & FAQ](https://film.praison.ai/docs/reference/troubleshooting.md)
