remotion-dev/remotion · error · Error
A template must be specified when using --yes. Example: --ye
Error message
A template must be specified when using --yes. Example: --yes --blank
What it means
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.
Source
Thrown at packages/create-video/src/select-template.ts:54
export const getPositionalArguments = () => parsed._;
export const getDirectoryArgument = (): string | null => {
const positionalArgs = getPositionalArguments();
return positionalArgs.length > 0 ? positionalArgs[0] || null : null;
};
export const isFlagSelected = ALL_TEMPLATES.find((f) => {
return parsed[f.cliId];
});
export const selectTemplate = async () => {
if (isFlagSelected) {
return isFlagSelected;
}
if (isYesFlagSelected()) {
throw new Error(
'A template must be specified when using --yes. Example: --yes --blank',
);
}
return (await selectAsync({
message: 'Choose a template:',
optionsPerPage: 20,
choices: ALL_TEMPLATES.map((template) => {
return {
value: template,
title: `${chalk.blue(template.shortName)}${
template.cliId === 'editor-starter'
? ' ' + chalk.yellow('(Paid)')
: ''
}${chalk.reset(
` ${chalk.gray(template.description.trim())} ${chalk.gray(
makeHyperlink({
text: '(?)',View on GitHub (pinned to 78fe4bb3fd)
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.
Example fix
# before npx create-video --yes # after npx create-video --yes --blank
Defensive patterns
Strategy: validation
Validate before calling
const hasTemplateFlag = (argv: string[]): boolean =>
ALL_TEMPLATES.some((t) => argv.includes(`--${t.cliId}`));
if (argv.includes('--yes') && !hasTemplateFlag(argv)) {
throw new Error('specify a template flag with --yes');
} Type guard
const isTemplateFlagPresent = (argv: string[]): boolean =>
ALL_TEMPLATES.some((t) => argv.includes(`--${t.cliId}`)); Prevention
- 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.
When it happens
Trigger: 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.
Common situations: Automating create-video in CI with --yes but forgetting the template; assuming --yes picks a default template; combining flags incorrectly.
Related errors
- create-video is a CLI tool only. Run `npx create-video@lates
- Cannot create an app named ${chalk.red(`"${folderName}"`)}.
- The following packages are not Remotion packages: ${invalidP
- Could not determine version of installed Remotion packages:
- No Remotion packages found in your project. Install Remotion
AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12).
Data as JSON: /api/errors/2d60668c823164fe.
Report an issue: GitHub.