You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+17Lines changed: 17 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -67,6 +67,23 @@ shotstack status 01ja7-x8m2k-... --watch
67
67
shotstack status 01ja7-x8m2k-... --output json
68
68
```
69
69
70
+
### `shotstack preview <file>`
71
+
72
+
Opens a `shotstack.studio` URL that loads the Edit JSON directly into the browser-based editor. No API call, no key, no charge — pure client-side encoding via the URL hash. Use it to hand a generated edit off to a human for review or quick tweaks before rendering.
73
+
74
+
```sh
75
+
shotstack preview my-template.json
76
+
# → opens browser silently
77
+
78
+
shotstack preview my-template.json --copy # also copies URL to clipboard
79
+
shotstack preview my-template.json --no-open # print URL, don't open browser
80
+
shotstack preview my-template.json --output json # emit {"url":"..."} on stdout
81
+
```
82
+
83
+
When a browser can be launched, the command is silent — the URL only opens in the browser. On a headless server (no `$DISPLAY`, no `xdg-open`), the URL is printed to stdout instead so you can copy it elsewhere.
84
+
85
+
Templates whose encoded URL exceeds ~6KB print a stderr warning. Browser URL limits vary; if you regularly exceed it, host the JSON publicly and link to it via `https://shotstack.studio/#src=<https-url>`.
86
+
70
87
### `shotstack feedback`
71
88
72
89
Opens a pre-filled GitHub issue with a sanitised dossier of your last 5 CLI invocations (render IDs, errors, exit codes). API keys and signed URLs are stripped at write time. You review and submit in your browser; nothing is transmitted automatically. Inspect the log at `~/.shotstack/log.jsonl`.
When a human is in the loop and may want to tweak the result, prefer **`shotstack preview <file>`** over `shotstack render`. By default it opens the browser to `https://shotstack.studio/#json=<base64url>` and prints the URL — the timeline loads directly into the browser-based editor. No API call, no key, no charge. The human can play, edit, and decide whether to render — saving credits when the AI's first attempt isn't quite right.
47
+
48
+
```sh
49
+
shotstack preview template.json # opens browser + prints URL
50
+
shotstack preview template.json --no-open # headless: just print the URL
51
+
shotstack preview template.json --output json # piping: {"url":"..."}, no browser
52
+
```
53
+
54
+
On headless systems (no `xdg-open`, no `$DISPLAY`) the browser launch silently no-ops; the URL is still printed. Safe to run anywhere.
55
+
56
+
Use `render` only when you're confident the JSON is final, or there's no human to review.
57
+
58
+
## Four CLI rules
46
59
47
60
1.**Pipe → `--output json`.** Default output is human-readable. When parsing programmatically or piping to another command, always pass `--output json`. The text format is not stable across versions.
48
61
49
62
2.**Use `--watch`, not a polling loop.**`shotstack status <id> --watch` exits when the render reaches `done` (exit 0) or `failed` (exit 1). Don't write `while true; do ...; sleep 3; done`.
50
63
51
-
3.**Fetch the current docs before generating timeline JSON.** The Shotstack API evolves; LLM training data is often stale. Pull <https://shotstack.io/docs/guide/llms-full.txt> for the current schema and examples before composing a timeline from scratch.
64
+
3.**Fetch the current docs before generating Edit JSON.** The Shotstack API evolves; LLM training data is often stale. Pull <https://shotstack.io/docs/guide/llms-full.txt> for the current schema and examples before composing an Edit from scratch.
65
+
66
+
4.**Hand off to a human via `preview` when uncertain.** Don't burn render credits iterating. Generate JSON → `shotstack preview` → human reviews/tweaks → render only when right.
52
67
53
-
## Authoring timeline JSON
68
+
## Authoring Edit JSON
54
69
55
-
These are the conventions agents most often get wrong. Read this section before generating any timeline JSON.
70
+
These are the conventions agents most often get wrong. Read this section before generating any Edit JSON.
56
71
57
72
### Before composing JSON: check the schema
58
73
59
74
Don't invent property names or enum values. The Shotstack schema is published — fetch one of these before composing JSON from scratch:
60
75
61
-
-<https://shotstack.io/docs/api/api.bundled.json> — single-file JSON Schema. Machine-validatable; load it once and validate locally instead of round-tripping the API.
76
+
-<https://shotstack.io/docs/api/api.edit.json> — single-file OpenAPI Schema. Machine-validatable; load it once and validate locally instead of round-tripping the API.
62
77
-<https://shotstack.io/docs/api/> — interactive HTML reference. Fastest for human scanning.
63
78
-<https://shotstack.io/docs/guide/llms-full.txt> — single-file LLM-friendly version of the full guide + reference.
64
79
-<https://github.com/shotstack/oas-api-definition/tree/main/schemas> — raw OpenAPI YAML, source of truth.
@@ -167,7 +182,7 @@ The render API supports many asset types. Use only the **current** ones; the dep
167
182
168
183
### AI-generated assets
169
184
170
-
`image-to-video` and `text-to-image` are billed per generation **even when invoked through the sandbox stage endpoint** (which is otherwise free). They are async — the render submits the AI job and waits. Renders containing AI assets take longer.
185
+
`image-to-video`, `text-to-speech`, and `text-to-image` are billed per generation **even when invoked through the sandbox stage endpoint** (which is otherwise free). They are async — the render submits the AI job and waits. Renders containing AI assets take longer.
171
186
172
187
## Fonts
173
188
@@ -220,10 +235,11 @@ The `font.family` value is the **font file basename** (without `.ttf`/`.otf`).
220
235
Authoritative sources, in order of preference:
221
236
222
237
-`shotstack --help` and `shotstack <command> --help` — current CLI flag listing
223
-
-<https://shotstack.io/docs/api/api.bundled.json> — JSON Schema for the render API (machine-validatable)
238
+
-<https://shotstack.io/docs/api/api.edit.json> — OpenAPI Schema for the render API (machine-validatable)
224
239
-<https://shotstack.io/docs/guide/llms-full.txt> — full API docs in LLM-friendly single file
225
240
-<https://github.com/shotstack/oas-api-definition/tree/main/schemas> — raw OpenAPI YAML, source of truth for property names and enums
226
-
-<https://shotstack.io/docs/api/> — interactive HTML reference
241
+
-<https://shotstack.io/docs/guide/> — interactive HTML docs and guides
242
+
-<https://shotstack.io/docs/api/> — interactive HTML API reference
Copy file name to clipboardExpand all lines: references/timeline.md
+5-9Lines changed: 5 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Timeline conventions
2
2
3
-
Detailed guide to track layering, the soundtrack vs audio distinction, and `timeline.fonts[]`. Read this when building any non-trivial timeline JSON.
3
+
Detailed guide to track layering, the soundtrack vs audio distinction, and `timeline.fonts[]`. Read this when building any non-trivial Edit JSON.
4
4
5
5
## Contents
6
6
@@ -74,13 +74,7 @@ If you put the video first and the captions last, the video covers the captions
74
74
75
75
## Soundtrack vs audio asset
76
76
77
-
There are two ways to add audio. Pick the right one.
78
-
79
-
| Use `timeline.soundtrack` when | Use `audio` asset when |
80
-
|---|---|
81
-
| One background music track for the entire timeline | Sound effects at specific times |
82
-
| Loop or fade the music | Voiceover synced to specific clips |
83
-
| You don't need to control timing | Multiple audio sources at different times |
77
+
Prefer `Audio` assets — they support custom timing, keyframes, and effects, and can do everything `timeline.soundtrack` can. Use `timeline.soundtrack` only when you want a single background track spanning the whole edit.
84
78
85
79
```json
86
80
{
@@ -94,7 +88,9 @@ There are two ways to add audio. Pick the right one.
**Fix:** if you're iterating quickly, render with `output.resolution: "preview"` first (512×288 @ 15fps) to validate the timeline shape before spending credits on full-resolution output.
93
93
94
-
## Stage credits exhausted
94
+
## Credits exhausted on stage environment
95
95
96
-
The `stage` environment uses test credits. They reset on a regular cadence but can be exhausted if you run many renders.
96
+
The `stage` environment uses no credits, but you do require a positive credit balance to make use of the sandbox.
97
97
98
-
**Fix:**wait for the reset, or run against `--env v1` (production credits, real money). Check current credit balance at <https://dashboard.shotstack.io>.
98
+
**Fix:**add more credits to your account. Check current credit balance at <https://app.shotstack.io>.
0 commit comments