@scenerok/cli 1.0.4 → 1.0.5

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.
Files changed (57) hide show
  1. package/dist/commands/skills.d.ts.map +1 -1
  2. package/dist/commands/skills.js +42 -1
  3. package/dist/commands/validate.d.ts.map +1 -1
  4. package/dist/commands/validate.js +26 -4
  5. package/dist/lib/api.d.ts +2 -0
  6. package/dist/lib/api.d.ts.map +1 -1
  7. package/examples/system/3-tips-fitness.vid +45 -0
  8. package/examples/system/ecom-product-launch.vid +31 -0
  9. package/examples/system/glitch-title.vid +17 -0
  10. package/examples/system/meme-remix.vid +15 -0
  11. package/examples/system/minimal-text-reel.vid +11 -0
  12. package/examples/system/product-launch.vid +18 -0
  13. package/examples/system/rokmilk-chocolate-promo.vid +24 -0
  14. package/examples/system/testimonial-cut.vid +16 -0
  15. package/examples/system/ugc-testimonial-voiceover.vid +33 -0
  16. package/examples/system/voice-visual-promo.vid +21 -0
  17. package/package.json +2 -1
  18. package/skills/aider/SKILL.md +18 -8
  19. package/skills/aider/vidscript-guide.md +29 -9
  20. package/skills/aider/vidscript-sample.md +22 -14
  21. package/skills/aider/vidscript-strict.md +95 -0
  22. package/skills/claude/SKILL.md +18 -8
  23. package/skills/claude/vidscript-guide.md +26 -7
  24. package/skills/claude/vidscript-sample.md +22 -14
  25. package/skills/claude/vidscript-strict.md +95 -0
  26. package/skills/codex/SKILL.md +18 -8
  27. package/skills/codex/vidscript-guide.md +29 -9
  28. package/skills/codex/vidscript-sample.md +22 -14
  29. package/skills/codex/vidscript-strict.md +95 -0
  30. package/skills/cursor/SKILL.md +18 -8
  31. package/skills/cursor/vidscript-guide.md +29 -9
  32. package/skills/cursor/vidscript-sample.md +22 -14
  33. package/skills/cursor/vidscript-strict.md +95 -0
  34. package/skills/opencode/SKILL.md +18 -8
  35. package/skills/opencode/vidscript-guide.md +29 -9
  36. package/skills/opencode/vidscript-sample.md +22 -14
  37. package/skills/opencode/vidscript-strict.md +95 -0
  38. package/skills/skills/aider/SKILL.md +190 -0
  39. package/skills/skills/aider/vidscript-guide.md +375 -0
  40. package/skills/skills/aider/vidscript-sample.md +29 -0
  41. package/skills/skills/aider/vidscript-strict.md +95 -0
  42. package/skills/skills/claude/SKILL.md +190 -0
  43. package/skills/skills/claude/vidscript-guide.md +375 -0
  44. package/skills/skills/claude/vidscript-sample.md +29 -0
  45. package/skills/skills/claude/vidscript-strict.md +95 -0
  46. package/skills/skills/codex/SKILL.md +190 -0
  47. package/skills/skills/codex/vidscript-guide.md +375 -0
  48. package/skills/skills/codex/vidscript-sample.md +29 -0
  49. package/skills/skills/codex/vidscript-strict.md +95 -0
  50. package/skills/skills/cursor/SKILL.md +190 -0
  51. package/skills/skills/cursor/vidscript-guide.md +375 -0
  52. package/skills/skills/cursor/vidscript-sample.md +29 -0
  53. package/skills/skills/cursor/vidscript-strict.md +95 -0
  54. package/skills/skills/opencode/SKILL.md +190 -0
  55. package/skills/skills/opencode/vidscript-guide.md +375 -0
  56. package/skills/skills/opencode/vidscript-sample.md +29 -0
  57. package/skills/skills/opencode/vidscript-strict.md +95 -0
@@ -1 +1 @@
1
- {"version":3,"file":"skills.d.ts","sourceRoot":"","sources":["../../src/commands/skills.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA4FpC,eAAO,MAAM,aAAa,SAqDvB,CAAC"}
1
+ {"version":3,"file":"skills.d.ts","sourceRoot":"","sources":["../../src/commands/skills.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAkIpC,eAAO,MAAM,aAAa,SA4DvB,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { Command } from 'commander';
2
2
  import chalk from 'chalk';
3
- import { existsSync, copyFileSync, mkdirSync } from 'node:fs';
3
+ import { existsSync, copyFileSync, mkdirSync, readdirSync } from 'node:fs';
4
4
  import { join, dirname } from 'node:path';
5
5
  import { homedir } from 'node:os';
6
6
  function getPlatformConfig(platform) {
@@ -13,6 +13,7 @@ function getPlatformConfig(platform) {
13
13
  { source: 'skills/opencode/SKILL.md', dest: 'SKILL.md' },
14
14
  { source: 'skills/opencode/vidscript-guide.md', dest: 'vidscript-guide.md' },
15
15
  { source: 'skills/opencode/vidscript-sample.md', dest: 'vidscript-sample.md' },
16
+ { source: 'skills/opencode/vidscript-strict.md', dest: 'vidscript-strict.md' },
16
17
  ],
17
18
  },
18
19
  claude: {
@@ -22,6 +23,7 @@ function getPlatformConfig(platform) {
22
23
  { source: 'skills/claude/SKILL.md', dest: 'SKILL.md' },
23
24
  { source: 'skills/claude/vidscript-guide.md', dest: 'vidscript-guide.md' },
24
25
  { source: 'skills/claude/vidscript-sample.md', dest: 'vidscript-sample.md' },
26
+ { source: 'skills/claude/vidscript-strict.md', dest: 'vidscript-strict.md' },
25
27
  ],
26
28
  },
27
29
  codex: {
@@ -31,6 +33,7 @@ function getPlatformConfig(platform) {
31
33
  { source: 'skills/codex/SKILL.md', dest: 'SKILL.md' },
32
34
  { source: 'skills/codex/vidscript-guide.md', dest: 'vidscript-guide.md' },
33
35
  { source: 'skills/codex/vidscript-sample.md', dest: 'vidscript-sample.md' },
36
+ { source: 'skills/codex/vidscript-strict.md', dest: 'vidscript-strict.md' },
34
37
  ],
35
38
  },
36
39
  cursor: {
@@ -40,6 +43,7 @@ function getPlatformConfig(platform) {
40
43
  { source: 'skills/cursor/SKILL.md', dest: 'SKILL.md' },
41
44
  { source: 'skills/cursor/vidscript-guide.md', dest: 'vidscript-guide.md' },
42
45
  { source: 'skills/cursor/vidscript-sample.md', dest: 'vidscript-sample.md' },
46
+ { source: 'skills/cursor/vidscript-strict.md', dest: 'vidscript-strict.md' },
43
47
  ],
44
48
  },
45
49
  aider: {
@@ -49,6 +53,7 @@ function getPlatformConfig(platform) {
49
53
  { source: 'skills/aider/SKILL.md', dest: 'SKILL.md' },
50
54
  { source: 'skills/aider/vidscript-guide.md', dest: 'vidscript-guide.md' },
51
55
  { source: 'skills/aider/vidscript-sample.md', dest: 'vidscript-sample.md' },
56
+ { source: 'skills/aider/vidscript-strict.md', dest: 'vidscript-strict.md' },
52
57
  ],
53
58
  },
54
59
  };
@@ -76,6 +81,35 @@ async function findSkillSource(sourcePath) {
76
81
  }
77
82
  return null;
78
83
  }
84
+ async function findExamplesDir() {
85
+ const moduleExamples = join(dirname(new URL(import.meta.url).pathname), '../../examples/system');
86
+ if (existsSync(moduleExamples))
87
+ return moduleExamples;
88
+ const cwdPackage = join(process.cwd(), 'packages/reelforge-cli/examples/system');
89
+ if (existsSync(cwdPackage))
90
+ return cwdPackage;
91
+ try {
92
+ const { execSync } = await import('node:child_process');
93
+ const globalRoot = execSync('npm root -g', { encoding: 'utf-8' }).trim();
94
+ const globalPath = join(globalRoot, '@scenerok', 'cli', 'examples/system');
95
+ if (existsSync(globalPath))
96
+ return globalPath;
97
+ }
98
+ catch {
99
+ // ignore
100
+ }
101
+ return null;
102
+ }
103
+ function installExampleTemplates(skillDir, examplesSource) {
104
+ const examplesDest = join(skillDir, 'examples', 'system');
105
+ mkdirSync(examplesDest, { recursive: true });
106
+ for (const name of readdirSync(examplesSource)) {
107
+ if (!name.endsWith('.vid'))
108
+ continue;
109
+ copyFileSync(join(examplesSource, name), join(examplesDest, name));
110
+ console.log(chalk.green(` ✓ examples/system/${name}`));
111
+ }
112
+ }
79
113
  export const skillsCommand = new Command('skills')
80
114
  .description('Install SceneRok skills to your agent')
81
115
  .addCommand(new Command('install')
@@ -103,6 +137,13 @@ export const skillsCommand = new Command('skills')
103
137
  copyFileSync(source, dest);
104
138
  console.log(chalk.green(` ✓ ${file.dest}`));
105
139
  }
140
+ const examplesSource = await findExamplesDir();
141
+ if (examplesSource) {
142
+ installExampleTemplates(config.skillDir, examplesSource);
143
+ }
144
+ else {
145
+ console.log(chalk.yellow(' ⚠️ Skipping examples/system (bundled templates not found)'));
146
+ }
106
147
  console.log(chalk.cyan(`\\n✅ Skills installed to ${config.skillDir}\\n`));
107
148
  console.log(chalk.dim('Your agent can now compose VidScripts and render videos!'));
108
149
  console.log(chalk.dim('Try: Ask your agent to "create a product promo video using scenerok"'));
@@ -1 +1 @@
1
- {"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../src/commands/validate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,eAAO,MAAM,eAAe,SAqCxB,CAAC"}
1
+ {"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../src/commands/validate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAkBpC,eAAO,MAAM,eAAe,SAkDxB,CAAC"}
@@ -2,9 +2,18 @@ import { Command } from 'commander';
2
2
  import chalk from 'chalk';
3
3
  import { readFileSync } from 'node:fs';
4
4
  import { validateVidscript } from '../lib/api.js';
5
+ function collectValidationErrors(result) {
6
+ if (result.errors && result.errors.length > 0) {
7
+ return result.errors;
8
+ }
9
+ if (result.error) {
10
+ return [result.error];
11
+ }
12
+ return ['Validation failed (no error details returned by server)'];
13
+ }
5
14
  export const validateCommand = new Command('validate')
6
15
  .description('Validate a VidScript file')
7
- .argument('<file>', 'Path to .vidscript file')
16
+ .argument('<file>', 'Path to .vid or .vidscript file')
8
17
  .action(async (file) => {
9
18
  let vidscript;
10
19
  try {
@@ -18,8 +27,19 @@ export const validateCommand = new Command('validate')
18
27
  const result = await validateVidscript(vidscript);
19
28
  if (result.valid) {
20
29
  console.log(chalk.green('\\n✅ VidScript is valid\\n'));
21
- console.log(` Scenes: ${result.scenes}`);
22
- console.log(` Duration: ${result.duration}s`);
30
+ if (result.statements != null) {
31
+ console.log(` Statements: ${result.statements}`);
32
+ }
33
+ if (result.scenes != null) {
34
+ console.log(` Scenes: ${result.scenes}`);
35
+ }
36
+ if (result.duration != null) {
37
+ console.log(` Duration: ${result.duration}s`);
38
+ }
39
+ const pluginCalls = result.pluginCalls;
40
+ if (pluginCalls != null) {
41
+ console.log(` Plugin calls: ${pluginCalls}`);
42
+ }
23
43
  if (result.warnings && result.warnings.length > 0) {
24
44
  console.log(chalk.yellow('\\n Warnings:'));
25
45
  for (const warning of result.warnings) {
@@ -29,7 +49,9 @@ export const validateCommand = new Command('validate')
29
49
  }
30
50
  else {
31
51
  console.log(chalk.red('\\n❌ VidScript is invalid\\n'));
32
- console.log(` Error: ${result.error}`);
52
+ for (const err of collectValidationErrors(result)) {
53
+ console.log(` • ${err}`);
54
+ }
33
55
  process.exit(1);
34
56
  }
35
57
  console.log('');
package/dist/lib/api.d.ts CHANGED
@@ -5,9 +5,11 @@ declare class ApiError extends Error {
5
5
  }
6
6
  export declare function validateVidscript(vidscript: string): Promise<{
7
7
  valid: boolean;
8
+ statements?: number;
8
9
  scenes?: number;
9
10
  duration?: number;
10
11
  warnings?: string[];
12
+ errors?: string[];
11
13
  error?: string;
12
14
  }>;
13
15
  export declare function submitRender(vidscript: string, resolution?: string, templateId?: number): Promise<{
@@ -1 +1 @@
1
- {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/lib/api.ts"],"names":[],"mappings":"AASA,cAAM,QAAS,SAAQ,KAAK;IAGjB,MAAM,EAAE,MAAM;IACd,YAAY,CAAC,EAAE,OAAO;gBAF7B,OAAO,EAAE,MAAM,EACR,MAAM,EAAE,MAAM,EACd,YAAY,CAAC,EAAE,OAAO,YAAA;CAKhC;AAkED,wBAAsB,iBAAiB,CAAC,SAAS,EAAE,MAAM;WAE9C,OAAO;aACL,MAAM;eACJ,MAAM;eACN,MAAM,EAAE;YACX,MAAM;GAEjB;AAED,wBAAsB,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM;cAEhF,MAAM;YACR,MAAM;gBACF,MAAM;oBACF,MAAM;eACX,MAAM;iBACJ,MAAM;aACV,MAAM;kBACD,MAAM;gBACR,MAAM,GAAG,IAAI;GAE5B;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AAM;cACR,MAAM;GAEnB;AAED,wBAAsB,cAAc,CAAC,UAAU,EAAE,MAAM;YAE3C,MAAM;mBACC,MAAM;iBACR,MAAM;iBACN,MAAM;YACX,MAAM;GAEjB;AAED,OAAO,EAAE,QAAQ,EAAE,CAAC"}
@@ -0,0 +1,45 @@
1
+ # 3 Tips Fitness Reel - Reusable Template
2
+ # Demonstrates dynamic timing [-] blocks + xAI video generation per tip (explicit import form)
3
+
4
+ import xai from "@scenerok/xai"
5
+
6
+ # === INPUTS (user provides these) ===
7
+ input tip1_text = "{{tip1_text | Tip 1 goes here}}"
8
+ input tip2_text = "{{tip2_text | Tip 2 goes here}}"
9
+ input tip3_text = "{{tip3_text | Tip 3 goes here}}"
10
+ input cta_text = "{{cta_text | Save this for later}}"
11
+
12
+ # === DYNAMIC TIP SECTIONS ===
13
+ # Each [-] block auto-calculates duration based on content
14
+ [-] = text tip1_text, style: title, position: center, color: "#FFFFFF", size: 64, align: center
15
+
16
+ # xAI generates a fresh visual for this specific tip
17
+ [-] = video xai.imagine(
18
+ "Cinematic fitness shot: " + tip1_text,
19
+ aspect_ratio: "9:16",
20
+ resolution: "1k"
21
+ )
22
+
23
+ [-] = text tip2_text, style: title, position: center, color: "#FFFFFF", size: 64, align: center
24
+
25
+ [-] = video xai.imagine(
26
+ "Cinematic fitness shot: " + tip2_text,
27
+ aspect_ratio: "9:16",
28
+ resolution: "1k"
29
+ )
30
+
31
+ [-] = text tip3_text, style: title, position: center, color: "#FFFFFF", size: 64, align: center
32
+
33
+ [-] = video xai.imagine(
34
+ "Cinematic fitness shot: " + tip3_text,
35
+ aspect_ratio: "9:16",
36
+ resolution: "1k"
37
+ )
38
+
39
+ # === CTA + BRANDING ===
40
+ [- 2s] = text cta_text, style: cta, position: bottom, color: "#FF0055", size: 48
41
+
42
+ # Subtle brand watermark
43
+ [-] = text "SceneRok", style: watermark, position: "85%, 92%", color: "#888888", size: 28, opacity: 0.6
44
+
45
+ output to "3-tips-fitness.mp4", resolution: "1080x1920", fps: 30
@@ -0,0 +1,31 @@
1
+ # Ecom Product Launch Reel - Reusable Template
2
+ # Shows product + lifestyle shot generated by xAI (@scenerok/xai), with strong CTA
3
+
4
+ import xai from "@scenerok/xai"
5
+
6
+ # === INPUTS ===
7
+ input product_name = "{{product_name | Your Product}}"
8
+ input hook_text = "{{hook_text | The one thing that actually works}}"
9
+ input price = "{{price | $49}}"
10
+ input cta_text = "{{cta_text | Shop Now}}"
11
+
12
+ # === HOOK ===
13
+ [0s .. 3s] = text hook_text, style: hook, position: center, color: "#FFFFFF", size: 72, align: center
14
+
15
+ # === PRODUCT VISUAL (xAI generated lifestyle video) ===
16
+ [3s .. 10s] = video xai.imagine(
17
+ "Premium lifestyle product shot of " + product_name + ", cinematic lighting, modern aesthetic, 9:16 vertical",
18
+ aspect_ratio: "9:16",
19
+ resolution: "1k"
20
+ )
21
+
22
+ # === PRICE + URGENCY ===
23
+ [8s .. 12s] = text "Only " + price, style: price, position: "center, 70%", color: "#FF0055", size: 56
24
+
25
+ # === STRONG CTA ===
26
+ [- 3s] = text cta_text, style: cta, position: bottom, color: "#FFFFFF", size: 64, stroke: "#000000", stroke_width: 4
27
+
28
+ # Subtle brand element
29
+ [-] = text "SceneRok", style: watermark, position: "85%, 92%", color: "#888888", size: 26, opacity: 0.5
30
+
31
+ output to "product-launch.mp4", resolution: "1080x1920", fps: 30
@@ -0,0 +1,17 @@
1
+ # Glitch Title
2
+ # A stylized intro with glitch effects and bold typography.
3
+ # Great for gaming, tech, or edgy brand content.
4
+
5
+ input background = "{{background_clip}}"
6
+
7
+ [0s .. 5s] = background
8
+ background.Trim(start: 0s, end: 5s)
9
+ background.Opacity(value: 0.8, duration: 5s)
10
+
11
+ [0.5s .. 3s] = text "{{title}}", font: "Bebas Neue", position: center, color: "#00FF88", size: 72, stroke: "#000000", stroke_width: 4, x: "50%", y: "45%", align: center, letter_spacing: 4
12
+
13
+ [3.2s .. 4.5s] = text "{{subtitle}}", font: "Oswald", position: center, color: "#FF0055", size: 96, stroke: "#000000", stroke_width: 4, x: "50%", y: "60%", align: center, rotation: 2, shadow_color: "#00FF88", shadow_blur: 8
14
+
15
+ [0s .. 5s] = filter "glitch", intensity: 0.4
16
+
17
+ output to "glitch-title.mp4", resolution: "1080x1920", fps: 30
@@ -0,0 +1,15 @@
1
+ # Meme Remix
2
+ # Fast-cut format with top and bottom text overlays.
3
+ # Perfect for reaction clips, punchline edits, and viral-style content.
4
+
5
+ input clip = "{{reaction_clip}}"
6
+
7
+ [0s .. 4s] = clip
8
+ clip.Trim(start: 0s, end: 4s)
9
+ clip.Speed(factor: 1.2)
10
+
11
+ [0.1s .. 1.5s] = text "{{hook_text}}", style: title, position: top, color: "#FFFFFF", size: 56, stroke: "#000000", stroke_width: 3
12
+
13
+ [2.5s .. 3.8s] = text "{{punchline}}", style: title, position: bottom, color: "#EF4444", size: 64, stroke: "#000000", stroke_width: 4
14
+
15
+ output to "meme-remix.mp4", resolution: "1080x1920", fps: 30
@@ -0,0 +1,11 @@
1
+ # Minimal Text Reel v2
2
+ # A clean text-only reel demonstrating advanced typography:
3
+ # dynamic placement, rotation, Google Fonts, shadows, letter spacing.
4
+
5
+ [0s .. 2.5s] = text "{{headline}}", font: "Bebas Neue", size: 96, color: "#FFFFFF", x: "50%", y: "30%", align: center, letter_spacing: 8, shadow_color: "#FF0055", shadow_blur: 10, shadow_offset_x: 4, shadow_offset_y: 4
6
+
7
+ [2s .. 4s] = text "{{subtitle}}", font: "Inter", size: 48, color: "#00FF88", x: "50%", y: "55%", align: center, rotation: -3, opacity: 0.9
8
+
9
+ [3.5s .. 5.5s] = text "{{cta}}", font: "Space Grotesk", size: 44, color: "#6366F1", x: "50%", y: "75%", align: center, shadow_color: "#000000", shadow_blur: 16, shadow_offset_y: 6
10
+
11
+ output to "minimal-text-reel.mp4", resolution: "1080x1920", fps: 30
@@ -0,0 +1,18 @@
1
+ # Product Launch
2
+ # Showcase a product with bold headlines and a clear call-to-action.
3
+ # Uses a subtle vignette filter for cinematic depth.
4
+
5
+ input hero = "{{hero_clip}}"
6
+
7
+ [0s .. 6s] = hero
8
+ hero.Trim(start: 0s, end: 6s)
9
+
10
+ [0.3s .. 2.3s] = text "{{headline}}", style: title, position: top, color: "#FFFFFF", size: 64, stroke: "#000000", stroke_width: 3
11
+
12
+ [2.5s .. 4.5s] = text "{{description}}", style: caption, position: center, color: "#F3F4F6", size: 36, stroke: "#000000", stroke_width: 2
13
+
14
+ [4.5s .. 5.8s] = text "{{cta}}", style: title, position: bottom, color: "#F59E0B", size: 52, stroke: "#000000", stroke_width: 3
15
+
16
+ [0s .. 6s] = filter "vignette", intensity: 0.35
17
+
18
+ output to "product-launch.mp4", resolution: "1080x1920", fps: 30
@@ -0,0 +1,24 @@
1
+ # RokMilk Chocolate Milkshake — 15s promo (correct VidScript v2 patterns)
2
+ # Requires: scenerok secrets set XAI_API_KEY=... (or configured on scenerok.com account)
3
+
4
+ import xai from "@scenerok/xai"
5
+
6
+ # Generated visuals — one clip per segment; prompts must use straight double quotes only
7
+ [-] = video xai.imagine("Cinematic slow-motion pour of rich creamy chocolate milk into a sleek modern 250ml carton on marble, warm studio lighting, shallow depth of field, 9:16 vertical", aspect_ratio: "9:16", duration: 5)
8
+
9
+ [-] = video xai.imagine("Elegant rotating product shot of premium chocolate milk carton labeled RokMilk, brown and gold palette, soft bokeh, advertising visual, 9:16 vertical", aspect_ratio: "9:16", duration: 5)
10
+
11
+ [-] = video xai.imagine("Silky chocolate milk swirl in glass with RokMilk carton blurred in background, golden light, appetizing food cinematography, 9:16 vertical", aspect_ratio: "9:16", duration: 5)
12
+
13
+ [0s .. 2.5s] = text "RokMilk", font: "Bebas Neue", size: 80, color: "#FFD700", x: "50%", y: "18%", align: center, stroke: "#3E1C00", stroke_width: 4, letter_spacing: 6, animate: fadeIn(0.6s)
14
+
15
+ [2s .. 5s] = text "Chocolate Milkshake", font: "Outfit", size: 56, color: "#FFFFFF", x: "50%", y: "45%", align: center, stroke: "#3E1C00", stroke_width: 3, animate: riseIn(0.8s)
16
+
17
+ [5s .. 8s] = text "250ml of Pure Indulgence", font: "Inter", size: 42, color: "#F3E5AB", x: "50%", y: "55%", align: center, stroke: "#3E1C00", stroke_width: 2, animate: slideY(40, 0, 0.8s)
18
+
19
+ [11s .. 14s] = text "visit your nearest grocery store", font: "Bebas Neue", size: 48, color: "#FFD700", x: "50%", y: "82%", align: center, stroke: "#3E1C00", stroke_width: 4, letter_spacing: 3, animate: fadeIn(1s)
20
+
21
+ [0s .. 15s] = filter "vignette", intensity: 0.3
22
+ [0s .. 15s] = filter "saturation", value: 1.12
23
+
24
+ output to "rokmilk-chocolate-promo.mp4", resolution: "1080x1920", fps: 30, background: "#1A0F05"
@@ -0,0 +1,16 @@
1
+ # Testimonial Cut
2
+ # A quote-focused format with a subtle vintage feel.
3
+ # Great for customer stories, reviews, and social proof clips.
4
+
5
+ input speaker = "{{speaker_clip}}"
6
+
7
+ [0s .. 5s] = speaker
8
+ speaker.Trim(start: 0s, end: 5s)
9
+
10
+ [0.5s .. 3s] = text "{{quote}}", style: subtitle, position: center, color: "#FFFFFF", size: 42, stroke: "#000000", stroke_width: 2
11
+
12
+ [3.2s .. 4.8s] = text "{{attribution}}", style: caption, position: bottom, color: "#D1D5DB", size: 32, stroke: "#000000", stroke_width: 2
13
+
14
+ [0s .. 5s] = filter "sepia", intensity: 0.3
15
+
16
+ output to "testimonial.mp4", resolution: "1080x1920", fps: 30
@@ -0,0 +1,33 @@
1
+ # UGC Testimonial with Voiceover - Reusable Template
2
+ # Uses xAI (via explicit import) for TTS voiceover + generated visuals
3
+
4
+ import xai from "@scenerok/xai"
5
+
6
+ # === INPUTS ===
7
+ input quote = "{{quote | This product completely changed how I work}}"
8
+ input customer_name = "{{customer_name | Sarah K.}}"
9
+ input product_name = "{{product_name | SceneRok}}"
10
+
11
+ # === VOICEOVER + VISUAL ===
12
+ [-] = audio xai.tts(
13
+ quote + ". " + customer_name + " from " + product_name,
14
+ voice: "eve",
15
+ speed: 1.05
16
+ )
17
+
18
+ [-] = video xai.imagine(
19
+ "Cinematic lifestyle shot representing: " + quote + ", premium modern aesthetic, 9:16 vertical",
20
+ aspect_ratio: "9:16",
21
+ resolution: "1k"
22
+ )
23
+
24
+ # === QUOTE TEXT (appears while voiceover plays) ===
25
+ [-] = text "\"" + quote + "\"", style: quote, position: center, color: "#FFFFFF", size: 52, align: center
26
+
27
+ # === ATTRIBUTION ===
28
+ [- 2s] = text "— " + customer_name, style: attribution, position: "center, 75%", color: "#CCCCCC", size: 32
29
+
30
+ # === BRANDING ===
31
+ [-] = text "Made with SceneRok", style: watermark, position: "85%, 92%", color: "#888888", size: 24, opacity: 0.6
32
+
33
+ output to "ugc-testimonial.mp4", resolution: "1080x1920", fps: 30
@@ -0,0 +1,21 @@
1
+ # Voice + Visual Promo
2
+ # Combines main footage with voiceover or music and layered titles.
3
+
4
+ input main = "{{main_video}}"
5
+ input voice = "{{voiceover_audio}}"
6
+
7
+ [0s .. 12s] = main
8
+ main.Trim(start: 0s, end: 12s)
9
+
10
+ [0s .. 12s] = audio voice, volume: 0.9
11
+
12
+ [0.5s .. 3s] = text "{{title}}", font: "Inter", size: 68, color: "{{brand_color}}", x: "50%", y: "22%", align: center, stroke: "#111827", stroke_width: 3
13
+
14
+ [3s .. 7s] = text "{{subtitle}}", font: "Inter", size: 34, color: "#F3F4F6", x: "50%", y: "50%", align: center, stroke: "#0F172A", stroke_width: 2
15
+
16
+ [7s .. 11s] = text "{{cta}}", font: "Inter", size: 56, color: "#FFFFFF", x: "50%", y: "78%", align: center, stroke: "#000000", stroke_width: 3
17
+
18
+ [0s .. 12s] = filter "vignette", intensity: 0.22
19
+ [0s .. 12s] = filter "saturation", value: 1.12
20
+
21
+ output to "voice-visual-promo.mp4", resolution: "1080x1920", fps: 30
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scenerok/cli",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "SceneRok CLI - Create videos from your terminal and agent workflows",
5
5
  "type": "module",
6
6
  "bin": {
@@ -10,6 +10,7 @@
10
10
  "files": [
11
11
  "dist",
12
12
  "skills",
13
+ "examples",
13
14
  "README.md"
14
15
  ],
15
16
  "scripts": {
@@ -86,18 +86,20 @@ import music from "@elevenlabs/music" # generative music
86
86
  use intro at [-] with { clip: main, headline: "Welcome" }
87
87
  ```
88
88
 
89
- ### Plugin Calls
89
+ ### Plugin Calls (required import)
90
90
 
91
91
  ```vidscript
92
- import eleven from "/tts"
92
+ import xai from "@scenerok/xai"
93
93
 
94
- [-] = audio eleven.tts("Welcome to SceneRok", voice: "Rachel")
95
- [-] = video xai.imagine("Cinematic product shot", aspect_ratio: "9:16")
96
- [-] = audio music("upbeat launch soundtrack", duration: 12, instrumental: true)
97
- [-] = audio xai.tts("Next line", voice: "eve")
94
+ [-] = video xai.imagine("Cinematic product shot", aspect_ratio: "9:16", duration: 5)
95
+ [-] = audio xai.tts("Welcome to SceneRok", voice: "eve")
98
96
  ```
99
97
 
100
- Package-style plugin calls are supported inside time blocks. Use `video ...` for generated visual clips and `audio ...` for generated speech, music, and other generated audio.
98
+ **Always** add `import xai from "@scenerok/xai"` before any `xai.imagine` / `xai.tts` call or `animate: fadeIn(...)` helper. Calls without import fail validation with `Unknown function 'xai.imagine'`.
99
+
100
+ Put plugin calls **directly** in time blocks — never `let clip = xai.imagine(...)`.
101
+
102
+ Read `vidscript-strict.md` for anti-patterns and `examples/system/*.vid` for copy-paste templates (installed with `scenerok skills install`).
101
103
 
102
104
  ### Placeholders
103
105
 
@@ -165,7 +167,15 @@ Always ask clarifying questions about:
165
167
  - Desired duration and style
166
168
  - Whether they want to start from a template or from scratch
167
169
 
170
+ ## Reference files (in this skill folder)
171
+
172
+ | File | Purpose |
173
+ |------|---------|
174
+ | `vidscript-guide.md` | Full grammar reference |
175
+ | `vidscript-strict.md` | **Read first** — rules that prevent common agent mistakes |
176
+ | `vidscript-sample.md` | Minimal promo with xAI import |
177
+ | `examples/system/*.vid` | Official SceneRok templates (text-only, product launch, xAI reels) |
178
+
168
179
  ## Full Reference
169
180
 
170
- For exhaustive grammar documentation, visit:
171
181
  https://scenerok.com/docs/vidscript
@@ -2,6 +2,22 @@
2
2
 
3
3
  VidScript is a declarative DSL for composing short-form videos. Write a script, render an MP4.
4
4
 
5
+ ## Agent quick start (read before composing)
6
+
7
+ 1. **Import plugins** — `import xai from "@scenerok/xai"` before `xai.imagine`, `xai.tts`, or `animate: fadeIn(...)`.
8
+ 2. **Validate early** — `scenerok validate file.vid` (errors show as `Line N:C — message`).
9
+ 3. **Copy working examples** — see `examples/system/` in this skill folder (e.g. `minimal-text-reel.vid`, `ecom-product-launch.vid`, `rokmilk-chocolate-promo.vid`).
10
+ 4. **Strict rules** — see `vidscript-strict.md` for invalid patterns (bare `xai.imagine`, `audio music(...), volume:`, nested quotes in prompts).
11
+
12
+ ### Common validation failures
13
+
14
+ | Symptom | Fix |
15
+ |---------|-----|
16
+ | `Unknown function 'xai.imagine'` | Add `import xai from "@scenerok/xai"` at top |
17
+ | `Unknown function 'fadeIn'` | Same import (animation helpers are plugin-backed) |
18
+ | `Expected ... but "," found` | Do not put `, volume:` after a plugin call on the same line |
19
+ | Parse error on imagine prompt | Remove nested `"` quotes inside the prompt string |
20
+
5
21
  ## Program Structure
6
22
 
7
23
  A VidScript program is a sequence of statements separated by newlines.
@@ -221,17 +237,21 @@ Audio sources can be MP3 inputs, audio plugin results, or the embedded audio str
221
237
  ### Plugin Calls
222
238
 
223
239
  ```vidscript
224
- import eleven from "@elevenlabs/tts" # future scoped package
225
- import music from "@elevenlabs/music"
226
-
227
- [-] = audio tts("Welcome to SceneRok", voice: "Rachel")
228
- [-] = video xai.imagine("Cinematic product shot", aspect_ratio: "9:16")
229
- [-] = audio music("upbeat launch soundtrack", duration: 12, instrumental: true)
230
- [-] = audio xai.tts("Next line", voice: "eve")
231
- [-] = tts("Next line")
240
+ import xai from "@scenerok/xai"
241
+
242
+ [-] = video xai.imagine("Cinematic product shot", aspect_ratio: "9:16", duration: 5)
243
+ [-] = audio xai.tts("Welcome to SceneRok", voice: "eve")
232
244
  ```
233
245
 
234
- Plugins are npm packages that add new function names. The built-in server registration includes xAI media/TTS and ElevenLabs music when the matching API keys are configured. They run at compile time and their outputs are baked into the final video. Package-style calls such as `video xai.imagine(...)` and qualified calls such as `audio xai.tts(...)` are supported inside time blocks.
246
+ Plugins require an explicit default import. The server registers `@scenerok/xai` when API keys are configured. Plugin calls run at compile time and must appear **inside time blocks**, not in `let` assignments.
247
+
248
+ **Invalid (will not validate):**
249
+
250
+ ```vidscript
251
+ [-] = video xai.imagine("...") # missing import
252
+ [-] = audio music("..."), volume: 0.5 # trailing params after plugin call
253
+ let clip = xai.imagine("...") # plugin assigned to variable
254
+ ```
235
255
 
236
256
  ## Animations, Effects & Plugins (v2 Extensibility)
237
257
 
@@ -1,21 +1,29 @@
1
- # VidScript v2 Sample — Product Launch Promo
2
- # A 6-second vertical video for TikTok / Instagram Reels
3
- # Demonstrates dynamic timeblocks, video shorthand, named args, expressions, and filters
1
+ # VidScript v2 Sample — Product promo with generated video
4
2
 
5
- input hero = "{{hero_clip}}"
3
+ Copy this shape for promos that use xAI-generated clips. Run `scenerok validate` before `scenerok render`.
6
4
 
7
- # Auto-append: cursor starts at 0, each [-] advances automatically
8
- [-] = video hero
9
- hero.Trim(start: 0s, end: 6s)
5
+ ```vidscript
6
+ import xai from "@scenerok/xai"
10
7
 
11
- # Text overlays with comma-separated named params
12
- [0.3s .. 2.3s] = text "NEW DROP", style: title, position: top, color: "#FFFFFF", size: 64, stroke: "#000000", stroke_width: 3
8
+ input product_name = "{{product_name | RokMilk}}"
9
+ input hook_text = "{{hook_text | Chocolate Milkshake}}"
10
+ input cta_text = "{{cta_text | visit your nearest grocery store}}"
13
11
 
14
- [2.5s .. 4.5s] = text "The most anticipated release of the season", style: caption, position: center, color: "#F3F4F6", size: 36, stroke: "#000000", stroke_width: 2
12
+ [0s .. 2.5s] = text product_name, font: "Bebas Neue", size: 80, color: "#FFD700", x: "50%", y: "20%", align: center, stroke: "#3E1C00", stroke_width: 4, animate: fadeIn(0.6s)
15
13
 
16
- [4.5s .. 5.8s] = text "SHOP NOW", style: title, position: bottom, color: "#F59E0B", size: 52, stroke: "#000000", stroke_width: 3
14
+ [2s .. 4.5s] = text hook_text, font: "Outfit", size: 52, color: "#FFFFFF", x: "50%", y: "45%", align: center, stroke: "#3E1C00", stroke_width: 3, animate: riseIn(0.8s)
17
15
 
18
- # Filter applied from start to end of the clip
19
- [0s .. 6s] = filter "vignette", intensity: 0.35
16
+ [-] = video xai.imagine(
17
+ "Premium lifestyle product shot of " + product_name + " chocolate milk in 250ml carton, cinematic lighting, 9:16 vertical",
18
+ aspect_ratio: "9:16",
19
+ duration: 6
20
+ )
20
21
 
21
- output to "product-launch.mp4", resolution: "1080x1920", fps: 30
22
+ [8s .. 11s] = text cta_text, font: "Bebas Neue", size: 48, color: "#FFD700", x: "50%", y: "80%", align: center, stroke: "#3E1C00", stroke_width: 4, animate: fadeIn(0.8s)
23
+
24
+ [0s .. 12s] = filter "vignette", intensity: 0.3
25
+
26
+ output to "product-promo.mp4", resolution: "1080x1920", fps: 30
27
+ ```
28
+
29
+ For clips you already have (no xAI), start from `examples/system/product-launch.vid` instead.