@mevdragon/vidfarm-devcli 0.2.1 → 0.2.2

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.
@@ -2,12 +2,11 @@
2
2
 
3
3
  Standalone GitHub-distributable package for the Vidfarm `template_0000` starter template.
4
4
 
5
- This package exists for two operational reasons:
5
+ This package exists to give third-party developers a concrete example of the Vidfarm template contract.
6
6
 
7
- - keep the template code in its own private GitHub repo for manual admin review/import
8
- - preserve the exact checked-in config and build shape the release admin will later promote to shared Remotion AWS and the production Docker image
7
+ Developers should treat this repo as an authoring and review unit.
9
8
 
10
- Developers should treat this repo as an authoring and review unit, not as an authorized deployment unit.
9
+ When a template is ready, it is handed off for Vidfarm admin review and approval before it becomes available on the hosted platform.
11
10
 
12
11
  Every new template should keep its source-format research checked in:
13
12
 
@@ -15,33 +14,21 @@ Every new template should keep its source-format research checked in:
15
14
  - `research/preview/` for the screenshots or source video the DNA analyzers inspect
16
15
  - `src/template-dna.ts` for the generated viral and visual DNA that feed the published template metadata
17
16
 
18
- The production release flow is:
19
-
20
- 1. developer pushes template code to GitHub
21
- 2. admin reviews the repo and selects a commit from `production`
22
- 3. admin publishes the approved Remotion site bundle to shared AWS
23
- 4. admin imports and activates the approved commit in Vidfarm
24
- 5. admin rebuilds and redeploys the production Docker image
25
-
26
- Template authors do not publish directly to shared Remotion Lambda and do not directly promote templates into production Docker.
27
-
28
17
  Production integration settings are checked into `template.config.json`. AI agents and developers should treat that file as the source of truth for:
29
18
 
30
19
  - project identity
31
20
  - `template_id` as the self-issued UUIDv4 platform identifier
32
21
  - `slug_id` as the human-readable stable slug
33
- - GitHub repo target
34
- - production source branch
35
- - Remotion region/function/bucket/site/composition settings
36
- - release control expectations for admin promotion
22
+ - the template module path
23
+ - the local Remotion composition settings used by the starter template
37
24
 
38
25
  ## Included
39
26
 
40
27
  - `SKILL.md` for customer AI-agent usage
41
28
  - `src/template.ts` for the Vidfarm platform contract
42
- - `src/remotion/*` for local and cloud video rendering
29
+ - `src/remotion/*` for local video rendering
43
30
  - `src/lib/images.ts` for non-cropping portrait normalization
44
- - `composition.json` sample props for cloud render smoke tests
31
+ - `composition.json` sample props for local render tests
45
32
 
46
33
  ## Template behavior
47
34
 
@@ -87,35 +74,3 @@ vidfarm analyze-visual-dna --template-dir .
87
74
  ```
88
75
 
89
76
  If you scaffold a template with `vidfarm generate-template` and provide `--source-preview-dir`, the CLI will run both analyzers automatically unless `--skip-dna-analysis` is set.
90
-
91
- ## Shared Remotion AWS
92
-
93
- Expected shared infra:
94
-
95
- - region: stored in `template.config.json`
96
- - function: stored in `template.config.json`
97
- - bucket: stored in `template.config.json`
98
-
99
- The only runtime secrets expected from the execution environment are AWS credentials. The production Remotion topology is intentionally checked into `template.config.json`, not spread across `.env` values.
100
-
101
- These shared-AWS operations are release-admin tasks. Template developers should not run them against the shared production AWS account.
102
-
103
- Release admin create-site:
104
-
105
- ```bash
106
- npm run admin:create-site
107
- ```
108
-
109
- Release admin cloud render smoke test:
110
-
111
- ```bash
112
- npm run admin:render:cloud
113
- ```
114
-
115
- Release admin cloud render from a real stage-1 manifest:
116
-
117
- ```bash
118
- npm run admin:render:cloud -- --manifest /abs/path/to/template-0000.json
119
- ```
120
-
121
- Use the manifest mode when you want the cloud render verification to include the actual composited slide frames with text overlays, not just the static sample props.
@@ -5,8 +5,8 @@ Use this template when the customer wants a fast vertical slideshow for TikTok-s
5
5
  Operational rule:
6
6
 
7
7
  - template developers author and test this template locally
8
- - only the release admin publishes the approved Remotion site bundle to shared AWS
9
- - only the release admin promotes the approved template into production Docker
8
+ - the hosted platform later runs the approved template behind the standard Vidfarm API wrapper
9
+ - a Vidfarm admin reviews and approves the template before it is made available in production
10
10
 
11
11
  Inputs:
12
12
 
@@ -51,7 +51,7 @@ Allowed text background colors:
51
51
  - `light_gray`
52
52
  - `dark_gray`
53
53
 
54
- REST API routes for this template:
54
+ Typical routes for this template:
55
55
 
56
56
  - `GET /templates/template_0000`
57
57
  - `GET /templates/template_0000/skill`
@@ -2,19 +2,16 @@
2
2
  "name": "vidfarm_template_0000",
3
3
  "version": "1.0.0",
4
4
  "private": true,
5
- "description": "Standalone Vidfarm template_0000 project for authoring, admin review, and controlled production promotion.",
5
+ "description": "Standalone Vidfarm template_0000 starter project for local template authoring.",
6
6
  "type": "module",
7
7
  "scripts": {
8
8
  "check": "tsc -p tsconfig.json --noEmit",
9
9
  "build": "tsc -p tsconfig.json",
10
- "studio": "remotion studio src/remotion/index.tsx",
11
- "admin:create-site": "node ./scripts/create-site.mjs",
12
- "admin:render:cloud": "node ./scripts/render-cloud.mjs"
10
+ "studio": "remotion studio src/remotion/index.tsx"
13
11
  },
14
12
  "dependencies": {
15
13
  "@remotion/bundler": "4.0.355",
16
14
  "@remotion/cli": "4.0.355",
17
- "@remotion/lambda": "4.0.355",
18
15
  "@remotion/renderer": "4.0.355",
19
16
  "react": "^18.3.1",
20
17
  "react-dom": "^18.3.1",
@@ -22,7 +19,7 @@
22
19
  "sharp": "^0.34.2"
23
20
  },
24
21
  "devDependencies": {
25
- "@mevdragon/vidfarm-devcli": "^0.2.0",
22
+ "@mevdragon/vidfarm-devcli": "^0.2.2",
26
23
  "@types/node": "^24.0.1",
27
24
  "@types/react": "^18.3.23",
28
25
  "@types/react-dom": "^18.3.7",
@@ -2,21 +2,16 @@
2
2
  "template_id": "4c7a7e1a-7f35-4f30-9f86-9c8a63c7f2db",
3
3
  "slug_id": "template_0000",
4
4
  "project_name": "vidfarm_template_0000",
5
- "github_repo": "mevdragon/vidfarm_template_0000",
6
- "source_branch": "production",
5
+ "github_repo": "your-org/your-template-repo",
6
+ "source_branch": "main",
7
7
  "skill_path": "SKILL.md",
8
8
  "template_module_path": "src/template.js",
9
- "release_controls": {
10
- "shared_remotion_publish": "admin_only",
11
- "platform_activation": "admin_only",
12
- "production_docker_promotion": "admin_only"
13
- },
14
9
  "remotion": {
15
- "region": "us-east-1",
16
- "function_name": "remotion-render-4-0-355-mem2048mb-disk2048mb-180sec",
17
- "bucket_name": "remotionlambda-useast1-ujg7c0h43q",
10
+ "region": "local",
11
+ "function_name": "",
12
+ "bucket_name": "",
18
13
  "site_name": "vidfarm-template-0000",
19
- "serve_url": "https://remotionlambda-useast1-ujg7c0h43q.s3.us-east-1.amazonaws.com/sites/vidfarm-template-0000/index.html",
14
+ "serve_url": "",
20
15
  "composition_id": "template-0000",
21
16
  "entry_point": "src/remotion/index.tsx",
22
17
  "props_file": "composition.json",
@@ -1,311 +0,0 @@
1
- # New Repo AWS Remotion Handoff
2
-
3
- This document is for a fresh repo that wants to keep using the current shared Remotion AWS setup.
4
-
5
- It is not a description of how this repo is organized. It is the operating contract a new repo should follow.
6
-
7
- ## Live AWS resources to reuse
8
-
9
- These were verified from AWS on 2026-05-16:
10
-
11
- - AWS account: `994816277608`
12
- - Region: `us-east-1`
13
- - Remotion render bucket: `remotionlambda-useast1-ujg7c0h43q`
14
- - Shared Lambda function: `remotion-render-4-0-355-mem2048mb-disk2048mb-180sec`
15
- - Lambda ARN: `arn:aws:lambda:us-east-1:994816277608:function:remotion-render-4-0-355-mem2048mb-disk2048mb-180sec`
16
- - Lambda execution role: `arn:aws:iam::994816277608:role/remotion-lambda-role`
17
- - Lambda runtime: `nodejs20.x`
18
- - Lambda architecture: `arm64`
19
- - Lambda timeout: `180`
20
- - Lambda memory: `2048`
21
- - Lambda ephemeral storage: `2048`
22
-
23
- The bucket is in `us-east-1` and site URLs follow this pattern:
24
-
25
- ```text
26
- https://remotionlambda-useast1-ujg7c0h43q.s3.us-east-1.amazonaws.com/sites/<site-name>/index.html
27
- ```
28
-
29
- ## New repo rule set
30
-
31
- The new repo should treat AWS in two layers:
32
-
33
- 1. Shared infrastructure you are reusing
34
- 2. Repo-specific site bundle you will publish
35
-
36
- Shared infrastructure:
37
-
38
- - the AWS account
39
- - the Remotion render bucket
40
- - the existing Lambda render function
41
- - the Lambda execution role
42
-
43
- Repo-specific asset:
44
-
45
- - your new site bundle under `sites/<site-name>/index.html`
46
-
47
- That means a new repo does not need to deploy a new Lambda function just to render a new composition. It only needs to:
48
-
49
- 1. use the same Remotion major/minor version as the shared Lambda
50
- 2. publish a new site bundle
51
- 3. render against that site URL and the shared function name
52
-
53
- ## Required package versions
54
-
55
- The shared Lambda is tied to Remotion `4.0.355`, so the new repo should pin:
56
-
57
- ```json
58
- {
59
- "dependencies": {
60
- "@remotion/cli": "4.0.355",
61
- "@remotion/lambda": "4.0.355",
62
- "@remotion/renderer": "4.0.355",
63
- "remotion": "4.0.355"
64
- }
65
- }
66
- ```
67
-
68
- If you upgrade Remotion later, treat that as shared infra work, not normal app work.
69
-
70
- ## What the new repo should configure
71
-
72
- The new repo should store these values in env or a small config module:
73
-
74
- ```bash
75
- REMOTION_REGION=us-east-1
76
- REMOTION_FUNCTION_NAME=remotion-render-4-0-355-mem2048mb-disk2048mb-180sec
77
- REMOTION_BUCKET_NAME=remotionlambda-useast1-ujg7c0h43q
78
- REMOTION_SITE_NAME=my-new-site
79
- REMOTION_SERVE_URL=https://remotionlambda-useast1-ujg7c0h43q.s3.us-east-1.amazonaws.com/sites/my-new-site/index.html
80
- REMOTION_COMPOSITION_ID=MyComposition
81
- ```
82
-
83
- Do not hard-code old values like `tweet-to-tiktok-2`.
84
-
85
- ## Publish flow for the new repo
86
-
87
- The new repo should publish its own dedicated site name:
88
-
89
- ```bash
90
- npx -y --package remotion@4.0.355 remotion lambda sites create src/index.ts \
91
- --site-name=my-new-site \
92
- --region=us-east-1
93
- ```
94
-
95
- That writes your bundle into the shared bucket under:
96
-
97
- ```text
98
- sites/my-new-site/index.html
99
- ```
100
-
101
- Use a dedicated site name per repo or per video format. Do not reuse another repo’s site name unless you intentionally want one repo to overwrite another repo’s published bundle.
102
-
103
- ## Render flow for the new repo
104
-
105
- CLI:
106
-
107
- ```bash
108
- npx -y --package remotion@4.0.355 remotion lambda render \
109
- "https://remotionlambda-useast1-ujg7c0h43q.s3.us-east-1.amazonaws.com/sites/my-new-site/index.html" \
110
- "MyComposition" \
111
- --props="./src/my-format/composition.json" \
112
- --region="us-east-1" \
113
- --timeout="120000" \
114
- --function-name="remotion-render-4-0-355-mem2048mb-disk2048mb-180sec" \
115
- --frames-per-lambda=100
116
- ```
117
-
118
- Node:
119
-
120
- ```ts
121
- import { renderMediaOnLambda } from "@remotion/lambda/client";
122
-
123
- await renderMediaOnLambda({
124
- region: "us-east-1",
125
- functionName: "remotion-render-4-0-355-mem2048mb-disk2048mb-180sec",
126
- serveUrl:
127
- "https://remotionlambda-useast1-ujg7c0h43q.s3.us-east-1.amazonaws.com/sites/my-new-site/index.html",
128
- composition: "MyComposition",
129
- inputProps: {},
130
- codec: "h264",
131
- timeoutInMilliseconds: 120000,
132
- privacy: "private",
133
- });
134
- ```
135
-
136
- ## IAM: what already exists on the Lambda side
137
-
138
- The current Lambda execution role is:
139
-
140
- - `arn:aws:iam::994816277608:role/remotion-lambda-role`
141
-
142
- Trust policy:
143
-
144
- - principal: `lambda.amazonaws.com`
145
- - action: `sts:AssumeRole`
146
-
147
- Attached managed policy:
148
-
149
- - `arn:aws:iam::994816277608:policy/remotion-lambda-policy`
150
-
151
- The attached policy currently grants:
152
-
153
- - `s3:ListAllMyBuckets` on `*`
154
- - `s3:CreateBucket`
155
- - `s3:ListBucket`
156
- - `s3:PutBucketAcl`
157
- - `s3:GetObject`
158
- - `s3:DeleteObject`
159
- - `s3:PutObjectAcl`
160
- - `s3:PutObject`
161
- - `s3:GetBucketLocation`
162
- on `arn:aws:s3:::remotionlambda-*`
163
- - `lambda:InvokeFunction`
164
- on `arn:aws:lambda:*:*:function:remotion-render-*`
165
- - `logs:CreateLogGroup`
166
- on `/aws/lambda-insights`
167
- - `logs:CreateLogStream`
168
- - `logs:PutLogEvents`
169
- on `/aws/lambda/remotion-render-*` and `/aws/lambda-insights:*`
170
-
171
- The new repo does not need to recreate this role if it is reusing the existing shared Lambda.
172
-
173
- ## IAM: what the new repo runner should have
174
-
175
- There are two separate permission sets to think about.
176
-
177
- ### Option A: publish site bundles and render, but do not manage shared infra
178
-
179
- This is the safest default for a new repo.
180
-
181
- The repo runner needs enough permission to:
182
-
183
- - upload a site bundle into the shared Remotion bucket
184
- - render with the existing Lambda function
185
- - optionally inspect function metadata
186
-
187
- Recommended policy shape:
188
-
189
- ```json
190
- {
191
- "Version": "2012-10-17",
192
- "Statement": [
193
- {
194
- "Sid": "RemotionBucketAccess",
195
- "Effect": "Allow",
196
- "Action": [
197
- "s3:CreateBucket",
198
- "s3:ListBucket",
199
- "s3:GetBucketLocation",
200
- "s3:GetObject",
201
- "s3:PutObject",
202
- "s3:DeleteObject",
203
- "s3:PutBucketAcl",
204
- "s3:PutObjectAcl"
205
- ],
206
- "Resource": [
207
- "arn:aws:s3:::remotionlambda-useast1-ujg7c0h43q",
208
- "arn:aws:s3:::remotionlambda-useast1-ujg7c0h43q/*"
209
- ]
210
- },
211
- {
212
- "Sid": "RemotionRenderInvoke",
213
- "Effect": "Allow",
214
- "Action": [
215
- "lambda:InvokeFunction",
216
- "lambda:GetFunctionConfiguration"
217
- ],
218
- "Resource": [
219
- "arn:aws:lambda:us-east-1:994816277608:function:remotion-render-4-0-355-mem2048mb-disk2048mb-180sec"
220
- ]
221
- }
222
- ]
223
- }
224
- ```
225
-
226
- If the repo uses Remotion commands that list functions or sites, add:
227
-
228
- - `lambda:ListFunctions`
229
-
230
- If the repo needs broader compatibility across future Remotion function versions, widen the Lambda ARN to:
231
-
232
- - `arn:aws:lambda:us-east-1:994816277608:function:remotion-render-*`
233
-
234
- ### Option B: also allow shared infra changes
235
-
236
- Only use this if the new repo is allowed to:
237
-
238
- - redeploy the shared Lambda function
239
- - rotate or replace the Lambda execution role
240
- - manage future Remotion infra upgrades
241
-
242
- That requires more than render permissions. At minimum, expect to need permissions in these areas:
243
-
244
- - `lambda:*` for create/update of the Remotion function family
245
- - `iam:PassRole` for `remotion-lambda-role`
246
- - potentially IAM role/policy create/update if Remotion is allowed to create or change roles
247
- - S3 bucket/object permissions on the shared Remotion bucket
248
- - CloudWatch Logs permissions
249
-
250
- Do not give this to a normal app repo unless that repo really owns shared infrastructure.
251
-
252
- ## Recommended IAM split
253
-
254
- For a clean handoff, use two identities:
255
-
256
- 1. `remotion-app-runner`
257
- For normal repo use. Can publish sites and render videos.
258
- 2. `remotion-infra-admin`
259
- Rarely used. Can redeploy shared Lambda infra and manage IAM if needed.
260
-
261
- That prevents a content-format repo from accidentally mutating the shared Remotion backend.
262
-
263
- ## What the new repo should not do
264
-
265
- - Do not store long-lived AWS keys in repo `.env` files.
266
- - Do not hard-code old site names from previous repos.
267
- - Do not assume this repo’s multi-site router pattern is required.
268
- - Do not redeploy the shared Lambda function during ordinary composition work.
269
-
270
- ## Suggested new repo scripts
271
-
272
- `package.json`:
273
-
274
- ```json
275
- {
276
- "scripts": {
277
- "create-site": "npx -y --package remotion@4.0.355 remotion lambda sites create src/index.ts --site-name=$REMOTION_SITE_NAME --region=$REMOTION_REGION",
278
- "render:cloud": "npx -y --package remotion@4.0.355 remotion lambda render $REMOTION_SERVE_URL $REMOTION_COMPOSITION_ID --props=./src/composition.json --region=$REMOTION_REGION --function-name=$REMOTION_FUNCTION_NAME --timeout=120000 --frames-per-lambda=100"
279
- }
280
- }
281
- ```
282
-
283
- If shell interpolation in `package.json` is awkward in your environment, wrap these in small shell scripts instead.
284
-
285
- ## Bootstrap checklist for the new repo
286
-
287
- 1. Pin Remotion packages to `4.0.355`.
288
- 2. Add the config variables listed above.
289
- 3. Create a new dedicated site name.
290
- 4. Use a non-admin AWS identity that can publish and render.
291
- 5. Publish the site bundle once.
292
- 6. Run one smoke render against the shared function.
293
- 7. Save the resulting serve URL and composition ID in repo config.
294
-
295
- ## Verified facts vs inferred guidance
296
-
297
- Verified from AWS:
298
-
299
- - account id
300
- - region
301
- - bucket name
302
- - function name
303
- - function config
304
- - Lambda execution role name
305
- - attached Lambda execution policy
306
-
307
- Not directly readable with the current AWS identity:
308
-
309
- - the current IAM policies attached to the calling IAM user `remotion-user`
310
-
311
- Because of that, the caller policy in this document is the recommended minimum policy for a new repo runner, derived from the live setup and the operations the new repo needs to perform.