🎥 Make videos programmatically with React
Install every skill when create-video's Install all skills is selected.
DanielMcSheehy45c9b3cdbd68
diff --git a/packages/create-video/src/ask-skills.ts b/packages/create-video/src/ask-skills.tsindex e116adeb9f..bfe208f8c7 100644--- a/packages/create-video/src/ask-skills.ts+++ b/packages/create-video/src/ask-skills.ts@@ -16,7 +16,7 @@ export const askSkills = async (): Promise<SkillsInstallation | null> => {choices: [{title: 'Install all skills',- description: 'Includes all Remotion guidance in one skill',+ description: 'Installs every Remotion skill',value: 'recommended',},{diff --git a/packages/create-video/src/install-skills.ts b/packages/create-video/src/install-skills.tsindex afd1fd5ada..b7a81d3967 100644--- a/packages/create-video/src/install-skills.ts+++ b/packages/create-video/src/install-skills.ts@@ -4,12 +4,12 @@ import execa from 'execa';import type {SkillsInstallation} from './ask-skills';import {Log} from './log';-export const installSkills = async (- projectRoot: string,- selection: SkillsInstallation,-) => {- const command = process.platform === 'win32' ? 'npx.cmd' : 'npx';- const args = [+const quoteSkillArg = (arg: string) => {+ return arg === '*' ? "'*'" : arg;+};++export const getSkillsAddArgs = (selection: SkillsInstallation): string[] => {+ return ['-y','--loglevel=error',@@ -17,10 +17,18 @@ export const installSkills = async ('remotion-dev/skills','--agent','universal',- ...(selection === 'recommended'- ? ['--skill', 'remotion-best-practices', '--yes']- : []),+ // `*` is the skills CLI's "every skill" selector. Naming only+ // remotion-best-practices installed the router and skipped the rest.+ ...(selection === 'recommended' ? ['--skill', '*', '--yes'] : []),];+};++export const installSkills = async (+ projectRoot: string,+ selection: SkillsInstallation,+) => {+ const command = process.platform === 'win32' ? 'npx.cmd' : 'npx';+ const args = getSkillsAddArgs(selection);try {await execa(command, args, {@@ -30,7 +38,7 @@ export const installSkills = async (} catch (e) {Log.error('Error installing skills:', e);Log.error('You can install them manually by running:');- Log.error(` npx ${args.join(' ')}`);+ Log.error(` npx ${args.map(quoteSkillArg).join(' ')}`);return;}diff --git a/packages/create-video/src/test/install-skills.test.ts b/packages/create-video/src/test/install-skills.test.tsnew file mode 100644index 0000000000..aa3a0b0a59--- /dev/null+++ b/packages/create-video/src/test/install-skills.test.ts@@ -0,0 +1,33 @@+import {expect, test} from 'bun:test';+import {getSkillsAddArgs} from '../install-skills';++test('Install all skills selects every skill from remotion-dev/skills', () => {+ const args = getSkillsAddArgs('recommended');++ expect(args).toEqual([+ '-y',+ '--loglevel=error',+ '[email protected]',+ 'add',+ 'remotion-dev/skills',+ '--agent',+ 'universal',+ '--skill',+ '*',+ '--yes',+ ]);+});++test('Choose individual skills leaves selection to the skills prompt', () => {+ const args = getSkillsAddArgs('choose');++ expect(args).toEqual([+ '-y',+ '--loglevel=error',+ '[email protected]',+ 'add',+ 'remotion-dev/skills',+ '--agent',+ 'universal',+ ]);+});diff --git a/packages/docs/docs/ai/skills.mdx b/packages/docs/docs/ai/skills.mdxindex f0d419e9aa..6516fae3ba 100644--- a/packages/docs/docs/ai/skills.mdx+++ b/packages/docs/docs/ai/skills.mdx@@ -21,6 +21,8 @@ You are also offered the option to add skills when you create a new Remotion probun create video```+**Install all skills** installs every skill below. **Choose individual skills** installs only the ones you pick.+The skills are also available on GitHub [here](https://github.com/remotion-dev/remotion/tree/main/packages/skills).## Available skills