|
| 1 | +# Shotstack CLI |
| 2 | + |
| 3 | +Command-line interface for the [Shotstack](https://shotstack.io) video rendering API. Built for humans and AI coding agents. |
| 4 | + |
| 5 | +```sh |
| 6 | +shotstack render template.json |
| 7 | +shotstack status <render-id> --watch |
| 8 | +``` |
| 9 | + |
| 10 | +## Install |
| 11 | + |
| 12 | +```sh |
| 13 | +# npm (global) |
| 14 | +npm i -g @shotstack/cli |
| 15 | + |
| 16 | +# one-shot via npx |
| 17 | +npx @shotstack/cli render template.json |
| 18 | + |
| 19 | +# one-shot via bun (~100x faster than npx for cached invocations) |
| 20 | +bunx @shotstack/cli render template.json |
| 21 | +``` |
| 22 | + |
| 23 | +All three install paths use the same `@shotstack/cli` package on npm. |
| 24 | + |
| 25 | +## Authentication |
| 26 | + |
| 27 | +Set your API key as an environment variable: |
| 28 | + |
| 29 | +```sh |
| 30 | +export SHOTSTACK_API_KEY=sk_... |
| 31 | +``` |
| 32 | + |
| 33 | +Get a key at <https://shotstack.io>. |
| 34 | + |
| 35 | +## Environments |
| 36 | + |
| 37 | +Pick the API environment with `--env` or `SHOTSTACK_ENV`. Defaults to `v1` (production). |
| 38 | + |
| 39 | +| `--env` | Endpoint | |
| 40 | +|---|---| |
| 41 | +| `stage` | `https://api.shotstack.io/edit/stage` | |
| 42 | +| `v1` (default) | `https://api.shotstack.io/edit/v1` | |
| 43 | + |
| 44 | +```sh |
| 45 | +shotstack render template.json --env stage |
| 46 | +SHOTSTACK_ENV=stage shotstack render template.json |
| 47 | +``` |
| 48 | + |
| 49 | +## Commands |
| 50 | + |
| 51 | +### `shotstack render <file>` |
| 52 | + |
| 53 | +Submits a Shotstack Edit JSON to the render API. Returns a render ID. |
| 54 | + |
| 55 | +```sh |
| 56 | +shotstack render my-template.json |
| 57 | +shotstack render my-template.json --output json |
| 58 | +``` |
| 59 | + |
| 60 | +### `shotstack status <id>` |
| 61 | + |
| 62 | +Polls the render status. Use `--watch` to poll continuously until the render completes. |
| 63 | + |
| 64 | +```sh |
| 65 | +shotstack status 01ja7-x8m2k-... |
| 66 | +shotstack status 01ja7-x8m2k-... --watch |
| 67 | +shotstack status 01ja7-x8m2k-... --output json |
| 68 | +``` |
| 69 | + |
| 70 | +### `shotstack feedback` |
| 71 | + |
| 72 | +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`. |
| 73 | + |
| 74 | +## Output |
| 75 | + |
| 76 | +Default is human-readable. Pass `--output json` for machine-readable output. Exit codes: |
| 77 | + |
| 78 | +- `0` success |
| 79 | +- `1` permanent error (4xx, validation, missing API key) |
| 80 | +- `2` transient/retryable error (5xx, network) |
| 81 | + |
| 82 | +## For AI agents |
| 83 | + |
| 84 | +This repo ships a [`SKILL.md`](./SKILL.md) at the root, following the [Agent Skills open standard](https://agentskills.io). Works with Claude Code, Codex, Cursor, Copilot, Gemini CLI, and 50+ other agents. |
| 85 | + |
| 86 | +```sh |
| 87 | +npx skills add shotstack/shotstack-cli |
| 88 | +``` |
| 89 | + |
| 90 | +The skill loads at session start (~50-100 tokens metadata) and teaches the agent three things `--help` doesn't: |
| 91 | + |
| 92 | +- Always pass `--output json` when piping |
| 93 | +- Use `shotstack status --watch` instead of writing a polling loop |
| 94 | +- Fetch the current timeline schema from <https://shotstack.io/docs/llms.txt> before submitting |
| 95 | + |
| 96 | +## Telemetry |
| 97 | + |
| 98 | +Every API request includes two headers so we can split CLI traffic in dashboards: |
| 99 | + |
| 100 | +- `x-shotstack-origin: cli` |
| 101 | +- `x-shotstack-environment: stage | v1` |
| 102 | + |
| 103 | +No other data is sent. The CLI never phones home; it only talks to the Shotstack API. |
| 104 | + |
| 105 | +## Licence |
| 106 | + |
| 107 | +Apache 2.0. |
0 commit comments