{"record":{"id":"14d0f231f0bd948a","repo":"yamadashy/repomix","slug":"invalid-remote-repository-url-or-repository-shorth","errorCode":null,"errorMessage":"Invalid remote repository URL or repository shorthand (owner/repo)","messagePattern":"Invalid remote repository URL or repository shorthand \\(owner/repo\\)","errorType":"validation","errorClass":"RepomixError","httpStatus":null,"severity":"error","filePath":"src/core/git/gitRemoteParse.ts","lineNumber":121,"sourceCode":"      return {\n        repoUrl: repoUrl,\n        remoteBranch: parsedFields.ref,\n      };\n    }\n\n    if (parsedFields.commit) {\n      return {\n        repoUrl: repoUrl,\n        remoteBranch: parsedFields.commit,\n      };\n    }\n\n    return {\n      repoUrl: repoUrl,\n      remoteBranch: undefined,\n    };\n  } catch {\n    throw new RepomixError('Invalid remote repository URL or repository shorthand (owner/repo)');\n  }\n};\n\n// Re-export from lightweight module to preserve public API\nexport { isExplicitRemoteUrl } from './gitRemoteUrl.js';\n\nexport const isValidRemoteValue = (remoteValue: string, refs: string[] = []): boolean => {\n  try {\n    parseRemoteValue(remoteValue, refs);\n    return true;\n  } catch {\n    return false;\n  }\n};\n\n/**\n * Parses remote value and extracts GitHub repository information if it's a GitHub repo\n * Returns null if the remote value is not a GitHub repository","sourceCodeStart":103,"sourceCodeEnd":139,"githubUrl":"https://github.com/yamadashy/repomix/blob/f465ad909315a22120636baf03fa5e28701a50cb/src/core/git/gitRemoteParse.ts#L103-L139","documentation":"This is the catch-all wrapper in parseRemoteValueInternal: if any step of parsing the remote value (URL parsing, shorthand resolution, ref extraction) throws, the original error is replaced with this generic RepomixError. It means the input was neither a recognizable remote URL nor a valid owner/repo shorthand.","triggerScenarios":"parseRemoteValue is given a string that fails parsing entirely — e.g. 'not-a-url', 'owner/', 'https://', an SCP-like syntax it cannot normalize, or a URL whose inner parsing throws (including error 72).","commonSituations":"Typo in the --remote argument; forgetting the owner segment ('myrepo' instead of 'user/myrepo'); pasting a web page URL with extra segments or a blob path; shell quoting issues mangling the URL.","solutions":["Pass a canonical HTTPS URL (https://github.com/owner/repo) or plain owner/repo shorthand.","Run the string through `git ls-remote` or a URL parser yourself to confirm validity.","If this wraps error 72, fix the owner/repo segment characters.","Check shell quoting/escaping of the argument in scripts."],"exampleFix":"// before\nrepomix --remote myrepo\n// after\nrepomix --remote owner/myrepo","handlingStrategy":"validation","validationCode":"const looksLikeRemote = (v: string) =>\n  /^https?:\\/\\/[^\\s/]+\\/[^\\s/]+\\/[^\\s/]+/.test(v) || /^[\\w.-]+\\/[\\w.-]+$/.test(v);\nif (!looksLikeRemote(input)) throw new Error(`Not a remote URL or owner/repo shorthand: ${input}`);","typeGuard":"const isOwnerRepo = (v: string): v is `${string}/${string}` => /^[\\w.-]+\\/[\\w.-]+$/.test(v);","tryCatchPattern":"try {\n  await repomixCli.run(['--remote', remoteInput]);\n} catch (e) {\n  if (e instanceof RepomixError && e.message.includes('Invalid remote repository URL')) {\n    console.error(`'${remoteInput}' is not a valid git URL or owner/repo shorthand.`);\n  }\n}","preventionTips":["Prefer full HTTPS URLs over ad-hoc strings.","Quote --remote arguments in shell scripts to avoid mangling.","Keep owner/repo shorthand free of trailing slashes or extra path segments.","Add CLI arg validation in wrapper scripts before invoking repomix."],"tags":["git","url-parsing","cli","validation"],"backgroundTag":"invalid-remote-url","analyzedSha":"f465ad909315a22120636baf03fa5e28701a50cb","analyzedAt":"2026-08-29T01:27:42.024Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}