yamadashy/repomix · error · RepomixError
Invalid remote repository URL or repository shorthand (owner
Error message
Invalid remote repository URL or repository shorthand (owner/repo)
What it means
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.
Source
Thrown at src/core/git/gitRemoteParse.ts:121
return {
repoUrl: repoUrl,
remoteBranch: parsedFields.ref,
};
}
if (parsedFields.commit) {
return {
repoUrl: repoUrl,
remoteBranch: parsedFields.commit,
};
}
return {
repoUrl: repoUrl,
remoteBranch: undefined,
};
} catch {
throw new RepomixError('Invalid remote repository URL or repository shorthand (owner/repo)');
}
};
// Re-export from lightweight module to preserve public API
export { isExplicitRemoteUrl } from './gitRemoteUrl.js';
export const isValidRemoteValue = (remoteValue: string, refs: string[] = []): boolean => {
try {
parseRemoteValue(remoteValue, refs);
return true;
} catch {
return false;
}
};
/**
* Parses remote value and extracts GitHub repository information if it's a GitHub repo
* Returns null if the remote value is not a GitHub repositoryView on GitHub (pinned to f465ad9093)
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.
Example fix
// before repomix --remote myrepo // after repomix --remote owner/myrepo
Defensive patterns
Strategy: validation
Validate before calling
const looksLikeRemote = (v: string) =>
/^https?:\/\/[^\s/]+\/[^\s/]+\/[^\s/]+/.test(v) || /^[\w.-]+\/[\w.-]+$/.test(v);
if (!looksLikeRemote(input)) throw new Error(`Not a remote URL or owner/repo shorthand: ${input}`); Type guard
const isOwnerRepo = (v: string): v is `${string}/${string}` => /^[\w.-]+\/[\w.-]+$/.test(v); Try / catch
try {
await repomixCli.run(['--remote', remoteInput]);
} catch (e) {
if (e instanceof RepomixError && e.message.includes('Invalid remote repository URL')) {
console.error(`'${remoteInput}' is not a valid git URL or owner/repo shorthand.`);
}
} Prevention
- 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.
When it happens
Trigger: 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).
Common situations: 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.
Related errors
- Invalid owner/repo in repo URL
- Git is not installed or not in the system PATH.
- No valid file paths found in stdin input.
- Invalid branch or ref name. Name must not start with '-': ${
- --skill-output can only be used with --skill-generate
AI-assisted analysis of yamadashy/repomix@f465ad9093 (2026-08-29).
Data as JSON: /api/errors/14d0f231f0bd948a.
Report an issue: GitHub.