{"record":{"id":"2d60668c823164fe","repo":"remotion-dev/remotion","slug":"a-template-must-be-specified-when-using-yes-exa","errorCode":null,"errorMessage":"A template must be specified when using --yes. Example: --yes --blank","messagePattern":"A template must be specified when using --yes\\. Example: --yes --blank","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/create-video/src/select-template.ts","lineNumber":54,"sourceCode":"\nexport const getPositionalArguments = () => parsed._;\n\nexport const getDirectoryArgument = (): string | null => {\n\tconst positionalArgs = getPositionalArguments();\n\treturn positionalArgs.length > 0 ? positionalArgs[0] || null : null;\n};\n\nexport const isFlagSelected = ALL_TEMPLATES.find((f) => {\n\treturn parsed[f.cliId];\n});\n\nexport const selectTemplate = async () => {\n\tif (isFlagSelected) {\n\t\treturn isFlagSelected;\n\t}\n\n\tif (isYesFlagSelected()) {\n\t\tthrow new Error(\n\t\t\t'A template must be specified when using --yes. Example: --yes --blank',\n\t\t);\n\t}\n\n\treturn (await selectAsync({\n\t\tmessage: 'Choose a template:',\n\t\toptionsPerPage: 20,\n\t\tchoices: ALL_TEMPLATES.map((template) => {\n\t\t\treturn {\n\t\t\t\tvalue: template,\n\t\t\t\ttitle: `${chalk.blue(template.shortName)}${\n\t\t\t\t\ttemplate.cliId === 'editor-starter'\n\t\t\t\t\t\t? ' ' + chalk.yellow('(Paid)')\n\t\t\t\t\t\t: ''\n\t\t\t\t}${chalk.reset(\n\t\t\t\t\t` ${chalk.gray(template.description.trim())} ${chalk.gray(\n\t\t\t\t\t\tmakeHyperlink({\n\t\t\t\t\t\t\ttext: '(?)',","sourceCodeStart":36,"sourceCodeEnd":72,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/create-video/src/select-template.ts#L36-L72","documentation":"Thrown by `selectTemplate` when the `--yes` (non-interactive) flag is set but no template flag (e.g. `--blank`) was also passed. `--yes` skips the interactive template picker, so without an explicit template selector there is no way to choose one automatically.","triggerScenarios":"Running `npx create-video --yes` (or `-y`) without a template flag. `isFlagSelected` (a template chosen via its CLI id) is undefined and `isYesFlagSelected()` is true, so the throw fires.","commonSituations":"Automating create-video in CI with --yes but forgetting the template; assuming --yes picks a default template; combining flags incorrectly.","solutions":["Add a template flag alongside --yes, e.g. `npx create-video --yes --blank`.","List available template flags via `npx create-video --help` and pick one.","If you want interactivity, drop --yes entirely."],"exampleFix":"# before\nnpx create-video --yes\n\n# after\nnpx create-video --yes --blank","handlingStrategy":"validation","validationCode":"const hasTemplateFlag = (argv: string[]): boolean =>\n  ALL_TEMPLATES.some((t) => argv.includes(`--${t.cliId}`));\nif (argv.includes('--yes') && !hasTemplateFlag(argv)) {\n  throw new Error('specify a template flag with --yes');\n}","typeGuard":"const isTemplateFlagPresent = (argv: string[]): boolean =>\n  ALL_TEMPLATES.some((t) => argv.includes(`--${t.cliId}`));","tryCatchPattern":null,"preventionTips":["Always pair --yes with a template flag (e.g. --blank).","In CI scripts, parameterize the template flag explicitly.","Drop --yes if you want the interactive picker."],"tags":["create-video","cli","templates","flags"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}