Commands
Every built-in command and its payload.
Every edit is a command: project.dispatch({ type, payload }). This page lists the 26 built-in commands with their payload fields, generated from project.commandCatalog() (JSON Schema). Times are integer microseconds. How commands behave, and the errors they throw: Commands.
| Command | What it does |
|---|---|
project/set-settings | Change composition settings (width, height, fps; NTSC rates like 29.97 are stored exactly as 30000/1001, or pass frameRate {num, den}). |
asset/add | Register a media asset (video, audio, image, font) by id and src. |
asset/remove | Remove an asset. |
asset/set-property | Set or clear an asset's name and provenance (source, license, attribution). |
track/add | Add a track. |
track/remove | Remove a track and every clip on it. |
track/reorder | Move a track to a new index in the render order (0 = bottom layer). |
track/rename | Rename a track. |
track/set-property | Set a track property: muted, solo, locked, or hidden (hidden tracks aren't drawn; audio follows muted). |
clip/add | Add a clip (video, text, caption, …) to a track at a timeline position. |
clip/remove | Remove a clip. |
clip/move | Move a clip to a new timeline start (and optionally another track). |
clip/trim | Change a clip's in-point (trimStartUs) and/or duration without moving other clips. |
clip/split | Split a clip in two at a timeline position; the right half gets newClipId. |
clip/duplicate | Duplicate an existing clip to a new id, optionally at a new position. |
clip/set-property | Set a clip property (transform fields, volume, audio fades, text content, …) as a static value. |
keyframe/set | Set a keyframe for an animatable property, with optional easing. |
keyframe/remove | Remove the keyframe at an exact time (and anchor) for one property of a clip. |
keyframe/clear | Remove ALL keyframes for one property of a clip. |
effect/add | Add an effect to a clip's effect stack (omitted params take defaults). |
effect/update | Update an effect's params (and/or enabled flag) in place. |
effect/remove | Remove one effect from a clip by index. |
effect/reorder | Move an effect to a new index in the clip's stack (stack order = application order). |
transition/add | Add a transition (crossDissolve, dipToBlack, dipToWhite, wipe, slide) across the cut between two adjacent clips. |
transition/update | Update a transition's duration, kind, or params. |
transition/remove | Remove a transition. |
Project
Guide: Project & time
project/set-settings
Change composition settings (width, height, fps; NTSC rates like 29.97 are stored exactly as 30000/1001, or pass frameRate {num, den}).
| Field | Type | Required | Notes |
|---|---|---|---|
width | integer | > 0 | |
height | integer | > 0 | |
fps | number | > 0 | |
frameRate | { num, den } | ||
name | string |
Asset
Guide: Assets
asset/add
Register a media asset (video, audio, image, font) by id and src. Metadata only — nothing is decoded.
| Field | Type | Required | Notes |
|---|---|---|---|
id | string | yes | non-empty |
kind | "video" | "audio" | "image" | "font" | yes | |
src | string | yes | non-empty |
durationUs | integer | > 0 | |
width | integer | > 0 | |
height | integer | > 0 | |
fps | number | > 0 | |
family | string | non-empty | |
weight | integer | ≥ 100, ≤ 900 | |
style | "normal" | "italic" | ||
weightRange | [integer, integer] | ||
name | string | non-empty | |
source | { provider, id, url } | ||
license | { id, url, commercial, attributionRequired } | ||
attribution | string | non-empty |
asset/remove
Remove an asset. Fails while any clip still references it.
| Field | Type | Required | Notes |
|---|---|---|---|
id | string | yes | non-empty |
asset/set-property
Set or clear an asset's name and provenance (source, license, attribution). null clears a field.
| Field | Type | Required | Notes |
|---|---|---|---|
id | string | yes | non-empty |
name | string | null | ||
source | { provider, id, url } | null | ||
license | { id, url, commercial, attributionRequired } | null | ||
attribution | string | null |
Track
Guide: Tracks
track/add
Add a track. Track order defines layering: later tracks render on top.
| Field | Type | Required | Notes |
|---|---|---|---|
id | string | yes | non-empty |
kind | "video" | "audio" | yes | |
name | string | ||
index | integer | ≥ 0 |
track/remove
Remove a track and every clip on it.
| Field | Type | Required | Notes |
|---|---|---|---|
id | string | yes | non-empty |
track/reorder
Move a track to a new index in the render order (0 = bottom layer).
| Field | Type | Required | Notes |
|---|---|---|---|
trackId | string | yes | non-empty |
index | integer | yes | ≥ 0 |
track/rename
Rename a track.
| Field | Type | Required | Notes |
|---|---|---|---|
trackId | string | yes | non-empty |
name | string | yes | non-empty |
track/set-property
Set a track property: muted, solo, locked, or hidden (hidden tracks aren't drawn; audio follows muted).
| Field | Type | Required | Notes |
|---|---|---|---|
trackId | string | yes | non-empty |
muted | boolean | ||
solo | boolean | ||
locked | boolean | ||
hidden | boolean |
Clip
Guide: Clips
clip/add
Add a clip (video, text, caption, …) to a track at a timeline position. Times are microseconds.
kind: "video"
| Field | Type | Required | Notes |
|---|---|---|---|
kind | "video" | yes | |
id | string | yes | non-empty |
trackId | string | yes | non-empty |
assetId | string | yes | non-empty |
startUs | integer | yes | ≥ 0 |
durationUs | integer | yes | > 0 |
trimStartUs | integer | ≥ 0, default 0 | |
volume | number | ≥ 0, default 1 | |
fadeInUs | integer | ≥ 0 | |
fadeOutUs | integer | ≥ 0 | |
transform | { x, y, scale, rotation, opacity } |
kind: "audio"
| Field | Type | Required | Notes |
|---|---|---|---|
kind | "audio" | yes | |
id | string | yes | non-empty |
trackId | string | yes | non-empty |
assetId | string | yes | non-empty |
startUs | integer | yes | ≥ 0 |
durationUs | integer | yes | > 0 |
trimStartUs | integer | ≥ 0, default 0 | |
volume | number | ≥ 0, default 1 | |
fadeInUs | integer | ≥ 0 | |
fadeOutUs | integer | ≥ 0 | |
transform | { x, y, scale, rotation, opacity } |
kind: "image"
| Field | Type | Required | Notes |
|---|---|---|---|
kind | "image" | yes | |
id | string | yes | non-empty |
trackId | string | yes | non-empty |
assetId | string | yes | non-empty |
startUs | integer | yes | ≥ 0 |
durationUs | integer | yes | > 0 |
transform | { x, y, scale, rotation, opacity } |
kind: "text"
| Field | Type | Required | Notes |
|---|---|---|---|
kind | "text" | yes | |
id | string | yes | non-empty |
trackId | string | yes | non-empty |
startUs | integer | yes | ≥ 0 |
durationUs | integer | yes | > 0 |
text | string | yes | |
fontFamily | string | default "sans-serif" | |
fontSizePx | number | > 0, default 48 | |
color | string | default "#ffffff" | |
fontWeight | integer | ≥ 100, ≤ 900 | |
fontStyle | "normal" | "italic" | ||
lineHeight | number | > 0, ≤ 5 | |
letterSpacing | number | ≥ -0.5, ≤ 2 | |
textAlign | "left" | "center" | "right" | ||
transform | { x, y, scale, rotation, opacity } |
kind: "caption"
| Field | Type | Required | Notes |
|---|---|---|---|
kind | "caption" | yes | |
id | string | yes | non-empty |
trackId | string | yes | non-empty |
startUs | integer | yes | ≥ 0 |
durationUs | integer | yes | > 0 |
words | { text, startUs, durationUs }[] | yes | |
style | { preset, fontFamily, fontSizeFrac, color, highlightColor, backgroundColor, … } | default | |
transform | { x, y, scale, rotation, opacity } |
kind: "html"
| Field | Type | Required | Notes |
|---|---|---|---|
kind | "html" | yes | |
id | string | yes | non-empty |
trackId | string | yes | non-empty |
startUs | integer | yes | ≥ 0 |
durationUs | integer | yes | > 0 |
template | string | yes | non-empty |
params | Record<string, string | number | boolean> | default | |
widthPx | integer | > 0 | |
heightPx | integer | > 0 | |
animated | boolean | ||
animationOffsetUs | integer | ≥ 0 | |
transform | { x, y, scale, rotation, opacity } |
Variant
| Field | Type | Required | Notes |
|---|---|---|---|
kind | string | yes | non-empty |
id | string | yes | non-empty |
trackId | string | yes | non-empty |
startUs | integer | yes | ≥ 0 |
durationUs | integer | yes | > 0 |
props | Record<string, unknown> | default | |
transform | { x, y, scale, rotation, opacity } |
clip/remove
Remove a clip. Transitions attached to it are dropped.
| Field | Type | Required | Notes |
|---|---|---|---|
clipId | string | yes | non-empty |
clip/move
Move a clip to a new timeline start (and optionally another track).
| Field | Type | Required | Notes |
|---|---|---|---|
clipId | string | yes | non-empty |
startUs | integer | ≥ 0 | |
trackId | string | non-empty |
clip/trim
Change a clip's in-point (trimStartUs) and/or duration without moving other clips.
| Field | Type | Required | Notes |
|---|---|---|---|
clipId | string | yes | non-empty |
startUs | integer | ≥ 0 | |
durationUs | integer | > 0 | |
trimStartUs | integer | ≥ 0 |
clip/split
Split a clip in two at a timeline position; the right half gets newClipId.
| Field | Type | Required | Notes |
|---|---|---|---|
clipId | string | yes | non-empty |
atUs | integer | yes | > 0 |
newClipId | string | non-empty |
clip/duplicate
Duplicate an existing clip to a new id, optionally at a new position.
| Field | Type | Required | Notes |
|---|---|---|---|
clipId | string | yes | non-empty |
newClipId | string | non-empty | |
startUs | integer | ≥ 0 | |
trackId | string | non-empty |
clip/set-property
Set a clip property (transform fields, volume, audio fades, text content, …) as a static value.
| Field | Type | Required | Notes |
|---|---|---|---|
params | Record<string, string | number | boolean> | ||
animated | boolean | ||
template | string | non-empty | |
unsetParams | string[] | ||
widthPx | integer | null | ||
heightPx | integer | null | ||
clipId | string | yes | non-empty |
transform | { x, y, scale, rotation, opacity } | ||
volume | number | ≥ 0 | |
fadeInUs | integer | null | ||
fadeOutUs | integer | null | ||
text | string | ||
fontFamily | string | ||
fontSizePx | number | > 0 | |
color | string | ||
fontWeight | integer | null | ||
fontStyle | "normal" | "italic" | null | ||
lineHeight | number | null | ||
letterSpacing | number | null | ||
textAlign | "left" | "center" | "right" | null | ||
style | { preset, fontFamily, fontSizeFrac, color, highlightColor, backgroundColor, … } | ||
words | { text, startUs, durationUs }[] |
Keyframe
Guide: Keyframes & animation
keyframe/set
Set a keyframe for an animatable property, with optional easing. Time is relative to the clip's visible start, or with anchor "end" measured back from its end (use that for exit animations so they follow trims).
| Field | Type | Required | Notes |
|---|---|---|---|
clipId | string | yes | non-empty |
property | "x" | "y" | "scale" | "rotation" | "opacity" | "volume" | yes | |
timeUs | integer | yes | ≥ 0 |
anchor | "start" | "end" | ||
value | number | yes | |
easing | "linear" | "hold" | "easeIn" | "easeOut" | "easeInOut" | { kind, x1, y1, x2, y2 } | { kind } | default "linear" |
keyframe/remove
Remove the keyframe at an exact time (and anchor) for one property of a clip.
| Field | Type | Required | Notes |
|---|---|---|---|
clipId | string | yes | non-empty |
property | "x" | "y" | "scale" | "rotation" | "opacity" | "volume" | yes | |
timeUs | integer | yes | ≥ 0 |
anchor | "start" | "end" |
keyframe/clear
Remove ALL keyframes for one property of a clip.
| Field | Type | Required | Notes |
|---|---|---|---|
clipId | string | yes | non-empty |
property | "x" | "y" | "scale" | "rotation" | "opacity" | "volume" |
Effect
Guide: Effects
effect/add
Add an effect to a clip's effect stack (omitted params take defaults). Built-in kinds: colorAdjust, mono, invert, warm, cool, hueShift, vibrance, exposure, contrastCurve, gamma, channelSwap, duotone, gradientMap, colorPop, solarize, threshold, posterize, sepia, vintage, polaroid, kodachrome, technicolor, thermal, grain, tealOrange, noir, bleachBypass, crossProcess, faded, matte, goldenHour, moonlight, cyberpunk, vaporwave, cyanotype, infrared, lomo, nightVision, pixelate, halftone, dotMatrix, crosshatch, neonEdges, sketch, emboss, sharpen, toon, oilPaint, hexPixelate, retro8bit, dither, frostedGlass, rgbSplit, scanlines, crt, vhs, glitch, tvStatic, lensFringe, blur, vignette, glow, dreamy, tiltShift, zoomBlur, motionBlur, colorVignette, lightLeak, fisheye, pinch, swirl, wave, ripple, mirrorX, mirrorY, kaleidoscope, chromaKey, letterbox, roundedCorners; or a registered custom kind.
| Field | Type | Required | Notes |
|---|---|---|---|
clipId | string | yes | non-empty |
kind | string | yes | non-empty |
params | Record<string, unknown> | ||
enabled | boolean | default true | |
index | integer | ≥ 0 | |
effectId | string | non-empty |
effect/update
Update an effect's params (and/or enabled flag) in place.
| Field | Type | Required | Notes |
|---|---|---|---|
clipId | string | yes | non-empty |
effectId | string | yes | non-empty |
params | Record<string, unknown> | ||
enabled | boolean |
effect/remove
Remove one effect from a clip by index.
| Field | Type | Required | Notes |
|---|---|---|---|
clipId | string | yes | non-empty |
effectId | string | yes | non-empty |
effect/reorder
Move an effect to a new index in the clip's stack (stack order = application order).
| Field | Type | Required | Notes |
|---|---|---|---|
clipId | string | yes | non-empty |
effectId | string | yes | non-empty |
index | integer | yes | ≥ 0 |
Transition
Guide: Transitions
transition/add
Add a transition (crossDissolve, dipToBlack, dipToWhite, wipe, slide) across the cut between two adjacent clips.
| Field | Type | Required | Notes |
|---|---|---|---|
id | string | non-empty | |
kind | string | yes | non-empty |
fromClipId | string | yes | non-empty |
toClipId | string | yes | non-empty |
durationUs | integer | yes | > 0 |
params | Record<string, unknown> |
transition/update
Update a transition's duration, kind, or params.
| Field | Type | Required | Notes |
|---|---|---|---|
transitionId | string | yes | non-empty |
durationUs | integer | > 0 | |
params | Record<string, unknown> |
transition/remove
Remove a transition.
| Field | Type | Required | Notes |
|---|---|---|---|
transitionId | string | yes | non-empty |