@shotstack/cli 0.13.0 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/shotstack.js +26 -25
- package/package.json +1 -1
- package/skills/shotstack/SKILL.md +4 -2
- package/skills/shotstack/references/beat-sync.md +3 -1
- package/skills/shotstack/references/html5-effects.md +1 -1
- package/skills/shotstack/references/html5-snippets.md +3 -3
- package/skills/shotstack/references/html5.md +41 -7
- package/skills/shotstack/references/ingest.md +12 -0
- package/skills/shotstack/shared/agent-core.md +3 -2
package/package.json
CHANGED
|
@@ -15,9 +15,9 @@ This skill loads in **terminal-based AI agents** (Claude Code, Cursor, Codex CLI
|
|
|
15
15
|
|
|
16
16
|
## Check versions once per session
|
|
17
17
|
|
|
18
|
-
This skill is version **0.
|
|
18
|
+
This skill is version **0.15.0** and needs `@shotstack/cli` **0.15.0** or later. Before the first `shotstack` command in a session:
|
|
19
19
|
|
|
20
|
-
1. Run `shotstack --version`. If it is older than 0.
|
|
20
|
+
1. Run `shotstack --version`. If it is older than 0.15.0, tell the user: what this skill documents, such as the html5 size steps from `ingest upload --watch`, is missing until they run `npm install -g @shotstack/cli@latest`.
|
|
21
21
|
2. Run `npm view @shotstack/cli version`. If it is newer than this skill's version, tell the user an update is available and ask whether to install it. Only on a yes, run `npx skills update shotstack -y` and `npm install -g @shotstack/cli@latest`. Never update without asking. `npx skills check` is not a read-only check: it installs the update.
|
|
22
22
|
|
|
23
23
|
If a check fails (no network, no npm, a sandbox), skip it and carry on.
|
|
@@ -90,6 +90,8 @@ SRC=$(shotstack ingest upload ./clip.mp4 --watch --output json | tail -n1 | jq -
|
|
|
90
90
|
# …then reference "$SRC" as an asset.src in your Edit JSON and run `shotstack render`.
|
|
91
91
|
```
|
|
92
92
|
|
|
93
|
+
This includes images and fonts for an `html5` page: put the URL in its `html` or `css`.
|
|
94
|
+
|
|
93
95
|
The bare command (no `--watch`) returns only an `id`; the hosted `source` URL does not exist until ingestion is `ready`. Always `--watch` (or follow up with `shotstack ingest status <id> --watch`) when you need the URL.
|
|
94
96
|
|
|
95
97
|
Other ingest subcommands: `ingest fetch <url>` (host a copy of a remote URL), `ingest status <id>`, `ingest list`, `ingest delete <id>`. **Read [`references/ingest.md`](references/ingest.md) for the full upload→render workflow, status values, and supported file types.**
|
|
@@ -18,8 +18,10 @@ Host a local file with `shotstack ingest upload <file> --watch`. Generate a trac
|
|
|
18
18
|
|
|
19
19
|
Analysis is free, takes 15–30 s and reads the first 10 minutes of the track.
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
The `src` must be a direct, public link to an audio or video file: share pages and redirects are refused.
|
|
22
22
|
<!-- surface:cli -->
|
|
23
|
+
It needs an API key (`shotstack login`).
|
|
24
|
+
|
|
23
25
|
```sh
|
|
24
26
|
shotstack analyze https://shotstack-assets.s3.amazonaws.com/music/unminus/lit.mp3 --output json > map.json
|
|
25
27
|
```
|
|
@@ -102,7 +102,7 @@ What you can build inside one `html5` clip, listed by the effect you'd reach for
|
|
|
102
102
|
- **WebGL, shaders, 3D models:** use CSS 2.5D and SVG filters.
|
|
103
103
|
- **Video or audio inside the clip:** put footage and sound on other timeline tracks; `html5` is the graphics layer.
|
|
104
104
|
- **Scroll, drag or pointer-driven animation:** capture is time-driven only.
|
|
105
|
-
- **Remote
|
|
105
|
+
- **Remote scripts, and images or fonts you haven't ingested:** inline them as `data:` URIs. Images and fonts you ingested work by URL; see [`html5.md`](html5.md).
|
|
106
106
|
|
|
107
107
|
## Cost
|
|
108
108
|
|
|
@@ -16,8 +16,8 @@ Read [`html5.md`](html5.md) for the rules these obey. The non-negotiables:
|
|
|
16
16
|
- **Size the clip to the content, not the canvas.** `html, body` pinned to the clip's `width`/`height`; place with `offset` (`{x:0,y:0}` is centred, `y` positive is up). Use **px**, never `vw`/`vh`/`%`.
|
|
17
17
|
- **The body is transparent by default** — the clip composites over the layers below (only set an opaque background if you want one).
|
|
18
18
|
- **Canvas only from the seek hook.** Draw canvas 2D inside `window.__shotstackSeek(ms)`, never in a `requestAnimationFrame` loop. WebGL is blank in the cloud render. SVG or positioned DOM is usually lighter.
|
|
19
|
-
- **No network.** gsap (with its plugins), anime, d3 and lottie are preloaded; external `<script src>`, `fetch`, remote `<img>`, and remote fonts are all CSP-blocked
|
|
20
|
-
- **Fonts:** `timeline.fonts[]` does **not** reach `html5` and remote `@font-face` is blocked. These snippets name a display font first but render in the `system-ui` fallback unless you
|
|
19
|
+
- **No network.** gsap (with its plugins), anime, d3 and lottie are preloaded; external `<script src>`, `fetch`, remote `<img>`, and remote fonts are all CSP-blocked. Inline them as `data:` URIs, or use the URL of an image or font you ingested (see [`html5.md`](html5.md)).
|
|
20
|
+
- **Fonts:** `timeline.fonts[]` does **not** reach `html5` and remote `@font-face` is blocked. These snippets name a display font first but render in the `system-ui` fallback unless you load the font, from an ingested font's URL or a `data:` `@font-face`.
|
|
21
21
|
- **Use unique element IDs for GSAP targets, not `:nth-child` or compound CSS selectors.** Studio preview doesn't resolve `.parent:nth-child(n) .child` patterns; `#id` works everywhere. When animating repeated elements (list rows, bars, cards), generate a unique ID per item (`id="row0"`, `id="bar0"`) rather than relying on structural selectors.
|
|
22
22
|
|
|
23
23
|
Coordinates below assume a **1080×1920 vertical** canvas; adjust `offset` for other sizes.
|
|
@@ -48,7 +48,7 @@ The reference entrance: opacity, blur and a 16 px rise settle **together** off o
|
|
|
48
48
|
}
|
|
49
49
|
```
|
|
50
50
|
|
|
51
|
-
`base` (0.6 s) entrance on `power3.out`, then a `hold` (1.5 s) settle. Swap `{{title}}` via top-level `merge[]`. `Clash Display` falls back to `system-ui` unless you
|
|
51
|
+
`base` (0.6 s) entrance on `power3.out`, then a `hold` (1.5 s) settle. Swap `{{title}}` via top-level `merge[]`. `Clash Display` falls back to `system-ui` unless you load it, from an ingested font's URL or a `data:` `@font-face` (see Fonts above).
|
|
52
52
|
|
|
53
53
|
---
|
|
54
54
|
|
|
@@ -11,7 +11,7 @@ This is the **modern replacement for the deprecated `html` asset.** `html5` runs
|
|
|
11
11
|
- Required and optional fields
|
|
12
12
|
- Preloaded libraries
|
|
13
13
|
- The browser harness (deterministic auto-seek)
|
|
14
|
-
- Sandbox restrictions: no network,
|
|
14
|
+
- Sandbox restrictions: no network; ingested images and fonts by URL, everything else inline
|
|
15
15
|
- Sizing
|
|
16
16
|
- 3D: what renders in preview and render
|
|
17
17
|
- Worked example: animated lower-third (GSAP)
|
|
@@ -89,25 +89,59 @@ Frames are captured by **seeking** the animation to each timestamp, not by playi
|
|
|
89
89
|
|
|
90
90
|
**Duration comes from the clip's `length`** — there's no animation-duration auto-detection. Size your animation to run within (or fill) the clip's `length`.
|
|
91
91
|
|
|
92
|
-
## Sandbox restrictions: no network,
|
|
92
|
+
## Sandbox restrictions: no network, ingested files by URL
|
|
93
93
|
|
|
94
94
|
The iframe renders under a strict Content-Security-Policy (`default-src 'none'`), in both Studio preview and cloud render. Nothing is fetched from the network at render time:
|
|
95
95
|
|
|
96
96
|
- **No external `<script src=>`.** Only the bundled GSAP/anime.js/D3/Lottie run (they're inlined for you). Another library would have to be inlined into your `js` — and must be seekable.
|
|
97
97
|
- **No `fetch` / `XMLHttpRequest`** (`connect-src 'none'`). Bundle any data inline — e.g. the JS array in the bar-chart example.
|
|
98
|
-
- **No remote images** (`img-src 'self' data: blob:`).
|
|
99
|
-
- **No remote fonts** (`font-src 'self' data:`)
|
|
98
|
+
- **No remote images** (`img-src 'self' data: blob:`), except images you ingested (below). Otherwise embed images as `data:` URIs. A `data:image/svg+xml` background is fine.
|
|
99
|
+
- **No remote fonts** (`font-src 'self' data:`), except fonts you ingested (below). See *Fonts in HTML5*.
|
|
100
|
+
|
|
101
|
+
### Images and fonts you ingested
|
|
102
|
+
|
|
103
|
+
Reference an ingested image or font by its `source` URL, straight from `html` or `css`: an `<img src>`, a CSS `url()` or an `@font-face` `src`. Before capture the renderer fetches each file and inlines it, so the page itself still makes no request.
|
|
104
|
+
|
|
105
|
+
<!-- surface:cli -->
|
|
106
|
+
Upload with `shotstack ingest upload`, or host a copy of a URL with `shotstack ingest fetch`:
|
|
107
|
+
|
|
108
|
+
```sh
|
|
109
|
+
PHOTO=$(shotstack ingest upload ./hero.jpg --watch --output json | tail -n1 | jq -r .source)
|
|
110
|
+
FONT=$(shotstack ingest upload ./Brand.woff2 --watch --output json | tail -n1 | jq -r .source)
|
|
111
|
+
```
|
|
112
|
+
<!-- /surface -->
|
|
113
|
+
|
|
114
|
+
```css
|
|
115
|
+
@font-face { font-family: 'Brand'; src: url(<FONT>) format('woff2'); }
|
|
116
|
+
.hero { background: url(<PHOTO>) center / cover; }
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
- **Same account and environment only.** A file ingested on `stage` works in `stage` renders, not in `v1`, and another account's files are refused. Every other remote URL is still blocked.
|
|
120
|
+
- **10 MiB per file, 25 MiB per page.** A file counts once for every place the page references it, so reference a large image once (a CSS class, say) and reuse the class.
|
|
121
|
+
- **Size images to the clip.** A photo much larger than the clip makes a heavier page and a slower capture. If the source has a WebP rendition named `html5-512`, `html5-1024`, `html5-2048` or `html5-4096`, the renderer uses the smallest one that covers the clip's longest edge; otherwise it uses the original.
|
|
122
|
+
<!-- surface:cli -->
|
|
123
|
+
- `shotstack ingest upload --watch` and `ingest fetch --watch` request those renditions for an image and wait up to 60 s for them, so the `source` URL is all the page needs.
|
|
124
|
+
<!-- /surface -->
|
|
125
|
+
- **A file that can't be used fails the render**, for example one that's missing, too large, or not an image or font.
|
|
126
|
+
- **Studio's preview doesn't load ingested files yet**, so they show as missing there. The render is unaffected.
|
|
127
|
+
<!-- surface:cli -->
|
|
128
|
+
- Until Studio supports them, check the page with `shotstack render <file> --env stage --watch`.
|
|
129
|
+
<!-- /surface -->
|
|
100
130
|
|
|
101
131
|
### Fonts in HTML5
|
|
102
132
|
|
|
103
|
-
`timeline.fonts[]` does **not** apply to `html5` assets (it loads fonts for `rich-text` / `rich-caption` only), and a remote `@font-face` URL (Google Fonts, etc.) is CSP-blocked.
|
|
133
|
+
`timeline.fonts[]` does **not** apply to `html5` assets (it loads fonts for `rich-text` / `rich-caption` only), and a remote `@font-face` URL (Google Fonts, etc.) is CSP-blocked. Three ways to get a custom font into an `html5` clip:
|
|
104
134
|
|
|
105
|
-
1. **
|
|
135
|
+
1. **Ingest it and use its URL** (see *Images and fonts you ingested*).
|
|
136
|
+
<!-- surface:cli -->
|
|
137
|
+
For a Google Font, `shotstack ingest fetch` the font file's `fonts.gstatic.com` URL and use the hosted copy.
|
|
138
|
+
<!-- /surface -->
|
|
139
|
+
2. **Inline it as a `data:` `@font-face`** — base64-encode the `.woff2` / `.ttf`:
|
|
106
140
|
```css
|
|
107
141
|
@font-face { font-family: 'Brand'; src: url('data:font/woff2;base64,<…>') format('woff2'); }
|
|
108
142
|
.title { font-family: 'Brand', sans-serif; }
|
|
109
143
|
```
|
|
110
|
-
|
|
144
|
+
3. **Use a system family** (`system-ui`, `Arial`, `Georgia`, …) — resolves with no load, but each machine picks its own font, so text in Studio's preview won't match the cloud render exactly. Embed a font whenever the text must match.
|
|
111
145
|
|
|
112
146
|
An unresolved family silently falls back to the browser default — the render won't fail, but the text won't be your font. For a single styled line, a `rich-text` asset (which *does* use `timeline.fonts[]`; verified catalogue in `shared/agent-core.md`) is simpler than a `data:` font embed.
|
|
113
147
|
|
|
@@ -78,6 +78,18 @@ shotstack studio edit.json
|
|
|
78
78
|
Remember `tracks[0]` is the **top** layer (see `shared/agent-core.md`), so the
|
|
79
79
|
logo track sits above the video.
|
|
80
80
|
|
|
81
|
+
## Images and fonts in an html5 page
|
|
82
|
+
|
|
83
|
+
An `html5` page can use images and fonts you ingested by putting their
|
|
84
|
+
`source` URLs in its `html` or `css` (`<img src>`, CSS `url()`, `@font-face`).
|
|
85
|
+
The file must belong to the same account and environment as the render. Limits
|
|
86
|
+
and details are in [`html5.md`](html5.md).
|
|
87
|
+
|
|
88
|
+
With `--watch`, an image upload or fetch also requests smaller WebP copies
|
|
89
|
+
(`html5-512` up to `html5-4096`, only those smaller than the image) and waits
|
|
90
|
+
up to 60 s for them. They're listed under `outputs.renditions`; the renderer
|
|
91
|
+
picks one for the clip size, so keep using the `source` URL.
|
|
92
|
+
|
|
81
93
|
## Fetch a remote URL instead of uploading
|
|
82
94
|
|
|
83
95
|
If the media is already at a URL but you want Shotstack to host its own copy
|
|
@@ -168,8 +168,9 @@ Pick `output.resolution` (preset) OR `output.size.width`+`output.size.height` (c
|
|
|
168
168
|
| `sd` | 1024×576 @ 25 |
|
|
169
169
|
| `hd` | 1280×720 @ 25 (default) |
|
|
170
170
|
| `1080` | 1920×1080 @ 25 |
|
|
171
|
+
| `4k` | 3840×2160 @ 25 (Pro, Scale and Volume plans) |
|
|
171
172
|
|
|
172
|
-
Custom sizes must be divisible by 2.
|
|
173
|
+
Custom sizes must be divisible by 2, up to 3840px on each side (1920px for `gif`). Video can be up to 3840×2160 pixels in any shape, for example 2160×3840 for vertical 4K; larger sizes are rejected. Video above 1920×1080 pixels needs a plan that includes 4K.
|
|
173
174
|
|
|
174
175
|
## Merge fields
|
|
175
176
|
|
|
@@ -231,7 +232,7 @@ Use only the **current** asset types; the deprecated ones still parse but should
|
|
|
231
232
|
| `audio` | Audio clip placed at a specific time on the timeline, or AI-generated speech or music from a `prompt`. |
|
|
232
233
|
| `rich-text` | Styled text overlay with full typography control. **Use this instead of `text`/`html`/`title`.** |
|
|
233
234
|
| `svg` | Vector graphics from raw SVG markup: `src` starts with `<svg`, never a URL or `data:` URI (the render fails). See **`svg` assets** below. |
|
|
234
|
-
| `html5` | Self-contained HTML/CSS/JS page rendered in an iframe (motion graphics, charts, animated overlays). Preloads gsap with its plugins (SplitText, DrawSVG, MorphSVG, MotionPath, Flip and more), d3, anime and lottie. See `references/html5.md`. **Never use the deprecated `html` asset.** |
|
|
235
|
+
| `html5` | Self-contained HTML/CSS/JS page rendered in an iframe (motion graphics, charts, animated overlays). Preloads gsap with its plugins (SplitText, DrawSVG, MorphSVG, MotionPath, Flip and more), d3, anime and lottie. Images and fonts: the URL of a file you ingested, or a `data:` URI; other remote URLs are blocked. See `references/html5.md`. **Never use the deprecated `html` asset.** |
|
|
235
236
|
| `rich-caption` | Word-level animated captions sourced from audio, video, or subtitle files. See `references/caption.md`. |
|
|
236
237
|
| `luma` | Luma matte for masking effects. |
|
|
237
238
|
|