{"record":{"id":"0a0683536cb18757","repo":"mastra-ai/mastra","slug":"invalid-github-repository-url-use-https-github","errorCode":null,"errorMessage":"Invalid GitHub repository URL. Use https://github.com/<owner>/<repository>.","messagePattern":"Invalid GitHub repository URL\\. Use https://github\\.com/<owner>/<repository>\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/cli/src/commands/create/create.ts","lineNumber":750,"sourceCode":"    throw new Error('No template selected');\n  }\n\n  const githubUrl = parseGitHubRepositoryUrl(template);\n  if (githubUrl) {\n    const spinner = p.spinner();\n    spinner.start('Validating GitHub repository...');\n    const validation = await validateGitHubProject(githubUrl);\n    if (!validation.isValid) {\n      spinner.stop('Validation failed');\n      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":732,"sourceCodeEnd":764,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/cli/src/commands/create/create.ts#L732-L764","documentation":"Thrown when the template argument looks like a GitHub URL but does not parse as a valid https://github.com/<owner>/<repository> URL. The CLI uses looksLikeGitHubUrl() to detect GitHub-intent input early and fails fast with the expected URL format instead of trying template lookup.","triggerScenarios":"`mastra create git@github.com:owner/repo.git`, `https://github.com/owner` (missing repo), `http://...` non-https, or a GitHub URL with extra path segments that the strict pattern rejects.","commonSituations":"Pasting an SSH clone URL instead of the HTTPS web URL, copying a URL still containing a branch/tree path (e.g. /tree/main), or omitting the repository name.","solutions":["Use the full HTTPS web URL format: https://github.com/<owner>/<repository>.","Convert an SSH URL: git@github.com:owner/repo.git → https://github.com/owner/repo.","Strip extra segments like /tree/<branch>, /blob/..., or trailing .git issues by copying the repo root URL from the browser address bar."],"exampleFix":"// before\nmastra create git@github.com:mastra-ai/starter.git\n// after\nmastra create https://github.com/mastra-ai/starter","handlingStrategy":"validation","validationCode":"const m = url.match(/^https:\\/\\/github\\.com\\/([\\w.-]+)\\/([\\w.-]+?)(\\.git)?\\/?$/);\nif (!m) throw new Error(`Use https://github.com/<owner>/<repository>, got: ${url}`);","typeGuard":"function isValidGitHubHttpsUrl(v: string): boolean {\n  return /^https:\\/\\/github\\.com\\/[\\w.-]+\\/[\\w.-]+(\\.git)?$/.test(v);\n}","tryCatchPattern":"try {\n  await create(templateArg);\n} catch (e) {\n  if (/Invalid GitHub repository URL/.test((e as Error).message)) {\n    console.error('Convert SSH/tree URLs to the plain https://github.com/<owner>/<repo> form.');\n  }\n}","preventionTips":["Always use the HTTPS web URL (never SSH git@ or http://).","Strip /tree/<branch>, /blob/..., and trailing slashes before passing.","Test URLs against the https://github.com/<owner>/<repository> pattern in scripts."],"tags":["cli","url-validation","github"],"backgroundTag":"invalid-url-format","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}