CLI Reference
Complete command reference for the Montaj CLI — every operation the UI performs is available from the terminal.
CLI Reference
Every operation is available from the terminal. montaj is the full command, mtj is the short alias.
Global Output Flags
Available on all commands:
--json # output result as JSON (for scripting and agent use)
--out <path> # specify output path (default: workspace/)
--quiet # suppress progress output, result only on stdoutTier 1 — Workflow Commands
The primary interface for most users.
montaj run ./clips --prompt "tight cuts, remove filler, 9:16"
# Runs default workflow against all clips in the directory
montaj run ./clips --workflow tight-reel --prompt "..."
# Runs a named workflow
montaj run --workflow animations --prompt "60s animated explainer, dark theme"
# Animation project — no source footage required
montaj serve
# Start local HTTP server + open UI at http://localhost:3000
montaj serve --network
# Bind to all network interfaces — accessible to other devices on the local network.
# WARNING: only use on trusted networks.
montaj render
# Render project.json [final] → final.mp4
montaj render --project ./workspace/project.json --out ./output/final.mp4
# Explicit paths
montaj render --clean
# Delete intermediate files after compositingmontaj run works headlessly — no UI, no montaj serve required.
Render Pipeline
montaj render runs three stages:
- Base video — trims and concatenates source clips via ffmpeg stream-copy
- Overlay segments — each JSX overlay is bundled with esbuild, rendered frame-by-frame in headless Chromium, and encoded to lossless FFV1/MKV
- Compose — a single
ffmpeg filter_complexoverlays all segments onto the base
Tier 2 — Workflow Management
montaj workflow list
# List all available workflows (native + custom)
montaj workflow new <name>
# Scaffold a new workflow file at workflows/<name>.json
montaj workflow edit <name>
# Open workflow in the node graph UI
montaj workflow run <name> ./clips --prompt "..."
# Run a specific workflow (alias for: montaj run --workflow <name>)Tier 3 — Steps
montaj step is the interface for running any step directly. Steps are discovered automatically across three scopes: built-in, user-global (~/.montaj/steps/), and project-local (./steps/).
montaj step --help # list all available steps
montaj step <name> --help # show params for a specific step
montaj step <name> --input <file> # run a step
montaj create-step <name> # scaffold steps/<name>.py + .json
montaj validate step <filename> # validate a step schema
montaj validate project <filename> # validate a project.json
montaj validate workflow <filename> # validate a workflow .jsonStep Chaining
Steps chain via stdout — the output path of one step becomes the --input of the next:
FILE=$(montaj step rm_fillers --input clip.mp4 --model base.en)
FILE=$(montaj step waveform_trim --input "$FILE")
FILE=$(montaj step resize --input "$FILE" --ratio 9:16)Tier 4 — Project Commands
montaj fetch --url "https://www.tiktok.com/@handle/video/123"
# Download a single video via yt-dlp
montaj fetch --url "https://www.tiktok.com/@handle" --limit 15 --out ./clips/
# Download up to N videos from a profile or playlist
montaj init --prompt "tight cuts, remove filler"
# Create empty project.json in current directory
montaj status
# Show current project.json state + step progress
montaj approve
# ai_video projects only — mark the storyboard as approvedStep Params Quick Reference
All steps accept --out <path>. Run montaj step <name> --help for full details.
| Step | Key params |
|---|---|
probe | — |
snapshot | --cols <n>, --rows <n> |
trim | --start <t>, --end <t> |
cut | --start <t>, --end <t> or --cuts <json> or --spec |
resize | --ratio <9:16|1:1|16:9> |
normalize | --target <youtube|podcast|broadcast|custom>, --lufs <n> |
extract_audio | --format <wav|mp3|aac> |
rm_fillers | --model <tiny.en|base.en|medium.en|large> |
waveform_trim | --threshold <dB>, --min-silence <s> |
rm_nonspeech | --model <base|small|medium>, --max-word-gap <s>, --sentence-edge <s> |
crop_spec | --keep <start:end> (repeatable), --out <path> |
virtual_to_original | --inverse |
transcribe | --model <base.en|medium.en>, --language <code> |
caption | --style <word-by-word|pop|karaoke|subtitle> |
stem-separation | --stems <vocals|drums|bass|other>, --out-dir <path> |
lyrics-sync | --lyrics <txt>, --model <base.en|medium.en>, --out <path> |
lyrics-render | --captions <json>, --audio <mp3>, --input <video>, --position, --color, --fontsize |
kling-generate | --prompt, --out, --first-frame, --last-frame, --ref-image (max 3), --duration, --mode, --aspect-ratio |
analyze-media | <input>, --prompt, --model, --json-output, --out |
generate-image | --prompt, --out, --provider <gemini|openai>, --ref-image, --size, --aspect-ratio |
CLI Flag Conventions
Two flags look similar and must not be conflated:
| Flag | Purpose |
|---|---|
--json | Wrap stdout in a JSON envelope for machine-readable output. Available on every command. |
--json-output | Ask the underlying model or API to return structured JSON data. Only on steps that call a model/API (e.g., analyze-media). |
Output Convention
All commands follow the same contract:
- stdout — the result: file path or JSON. Nothing else.
- stderr — errors only:
{"error":"code","message":"detail"} - exit 0 on success, exit 1 on failure