/**
* Validates a GitHub repository URL or shorthand format
* TODO: Share this validation logic with repomix core (src/cli/actions/remoteAction.ts)
*/
export function isValidRemoteValue(remoteValue: string): boolean {
// Check the short form of the GitHub URL. e.g. yamadashy/repomix
const namePattern = '[a-zA-Z0-9](?:[a-zA-Z0-9._-]*[a-zA-Z0-9])?';
const shortFormRegex = new RegExp(`^${namePattern}/${namePattern}$`);
if (shortFormRegex.test(remoteValue)) {
return true;
}
// Check the direct form of the GitHub URL. e.g. https://github.com/yamadashy/repomix or https://gist.github.com/yamadashy/1234567890abcdef
try {
new URL(remoteValue);
return true;
} catch {
return false;
}
}
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/yamadashy/repomix'
If you have feedback or need assistance with the MCP directory API, please join our Discord server