Skip to content

Commit 22a6cb8

Browse files
Derk Zomerdazzatronus
authored andcommitted
feat: Shotstack CLI v0.1 — render, status, feedback, flight recorder, JS bundle, release workflow
0 parents  commit 22a6cb8

26 files changed

Lines changed: 2217 additions & 0 deletions

.github/ISSUE_TEMPLATE/bug.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Bug, feature request, or question
2+
description: Report an issue, request a feature, or ask a question.
3+
labels: ["needs-triage"]
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
Tip: run `shotstack feedback` from your terminal to pre-fill this form with your environment and a sanitised dossier of your last 5 CLI invocations. Review the pre-filled body in your browser before submitting.
9+
- type: textarea
10+
id: details
11+
attributes:
12+
label: Details
13+
description: Describe the bug, feature request, or question. If you used `shotstack feedback`, the dossier will appear here automatically.
14+
placeholder: |
15+
## Environment
16+
- Shotstack CLI: 0.1.x
17+
- OS: ...
18+
19+
## What I expected vs what happened
20+
...
21+
validations:
22+
required: true

.github/workflows/release.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags: ['v*']
6+
7+
permissions:
8+
id-token: write
9+
contents: read
10+
11+
jobs:
12+
publish:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: oven-sh/setup-bun@v2
17+
- uses: actions/setup-node@v4
18+
with:
19+
node-version: '22'
20+
registry-url: 'https://registry.npmjs.org'
21+
- run: npm install -g npm@latest
22+
- run: bun install --frozen-lockfile
23+
- run: bun run typecheck
24+
- run: bun test
25+
- run: bun run build
26+
- run: npm publish --provenance

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
node_modules/
2+
dist/
3+
.env
4+
.env.*
5+
*.log
6+
.DS_Store
7+
.idea/
8+
.vscode/

README.md

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
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

Comments
 (0)