{"record":{"id":"1959db8999e91c8b","repo":"mastra-ai/mastra","slug":"template-template-not-found","errorCode":null,"errorMessage":"Template \"${template}\" not found","messagePattern":"Template \"(.+?)\" not found","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/cli/src/commands/create/create.ts","lineNumber":760,"sourceCode":"      p.log.error('This does not appear to be a valid Mastra project:');\n      validation.errors.forEach(error => p.log.error(`  - ${error}`));\n      throw new Error('Invalid Mastra project');\n    }\n    spinner.stop('Valid Mastra project ✓');\n    return createFromGitHubUrl(githubUrl);\n  }\n  if (looksLikeGitHubUrl(template)) {\n    throw new Error('Invalid GitHub repository URL. Use https://github.com/<owner>/<repository>.');\n  }\n\n  const templates = await loadTemplates();\n  const found = findTemplateByName(templates, template);\n  if (!found) {\n    p.log.error(`Template \"${template}\" not found. Available templates:`);\n    templates.forEach(availableTemplate =>\n      p.log.info(`  - ${availableTemplate.title} (use: ${availableTemplate.slug.replace('template-', '')})`),\n    );\n    throw new Error(`Template \"${template}\" not found`);\n  }\n  return found;\n}\n","sourceCodeStart":742,"sourceCodeEnd":764,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/cli/src/commands/create/create.ts#L742-L764","documentation":"Thrown when the template name passed to `mastra create <template>` matches none of the templates returned by loadTemplates(). Before throwing, the CLI logs all available templates with their slugs so the caller can pick a valid one.","triggerScenarios":"`mastra create my-template` where findTemplateByName() finds no title/slug match in the loaded template registry.","commonSituations":"Typo in the template name, using the full slug ('template-hello-world') instead of the shortened name ('hello-world'), or referencing a template that was removed/renamed in a newer CLI version.","solutions":["Run the command again and read the 'Available templates' list printed with the error; copy the exact 'use:' value.","Drop the 'template-' prefix — the CLI expects the short slug (e.g. 'hello-world', not 'template-hello-world').","Check the template still exists in the current CLI version; update or downgrade the CLI if the template changed names.","If no template fits, scaffold with a GitHub starter URL via `mastra create --github <url>` instead."],"exampleFix":"// before\nmastra create template-hello-world\n// after\nmastra create hello-world","handlingStrategy":"fallback","validationCode":"const templates = await loadTemplates();\nconst shortName = template.replace(/^template-/, '');\nif (!findTemplateByName(templates, shortName)) {\n  console.log('Available:', templates.map(t => t.slug.replace('template-', '')).join(', '));\n}","typeGuard":null,"tryCatchPattern":"try {\n  await resolveTemplate(name);\n} catch (e) {\n  if (/not found/.test((e as Error).message) && /Template/.test((e as Error).message)) {\n    const templates = await loadTemplates();\n    console.error(`Unknown template \"${name}\". Try: ${templates.map(t => t.slug.replace('template-', '')).join(', ')}`);\n  }\n}","preventionTips":["Use the short slug shown after 'use:' in the available-templates list, without the 'template-' prefix.","Run `mastra create` with an empty/invalid name once to print all valid templates.","Pin the CLI version in CI so template names don't drift with upgrades."],"tags":["cli","template","not-found","argument"],"backgroundTag":"unknown-template-name","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}