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

  1. Add a template flag alongside --yes, e.g. `npx create-video --yes --blank`.
  2. List available template flags via `npx create-video --help` and pick one.
  3. 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

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


AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12). Data as JSON: /api/errors/2d60668c823164fe. Report an issue: GitHub.