paperclipai/paperclip · error · Error

GitHub source must be a GitHub or GitHub Enterprise URL, or…

Error message

GitHub source must be a GitHub or GitHub Enterprise URL, or owner/repo[/path] shorthand.

What it means

normalizeGithubImportSource rejects the --from source string because it is neither an owner/repo[/path] shorthand nor a URL that looks like a GitHub or GitHub Enterprise host.

Solutions

  1. Use a full GitHub/GitHub Enterprise URL (https://github.com/owner/repo) or the owner/repo[/path] shorthand.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at cli/src/commands/client/company.ts:904 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of paperclipai/paperclip@120ae5428f (2026-08-18). Data as JSON: /api/errors/9aeb0d15c392e0d4. Report an issue: GitHub.

Appendix: source

Thrown at cli/src/commands/client/company.ts:904

  return url.toString();
}

export function normalizeGithubImportSource(input: string, refOverride?: string): string {
  const trimmed = input.trim();
  const ref = refOverride?.trim();

  if (isGithubShorthand(trimmed)) {
    const [owner, repo, ...repoPath] = trimmed.split("/").filter(Boolean);
    return buildGithubImportUrl({
      owner: owner!,
      repo: repo!,
      ref: ref || "main",
      path: repoPath.join("/"),
    });
  }

  if (!looksLikeRepoUrl(trimmed)) {
    throw new Error("GitHub source must be a GitHub or GitHub Enterprise URL, or owner/repo[/path] shorthand.");
  }
  if (!ref) {
    return trimmed;
  }

  const url = new URL(trimmed);
  const hostname = url.hostname;
  const parts = url.pathname.split("/").filter(Boolean);
  if (parts.length < 2) {
    throw new Error("Invalid GitHub URL.");
  }

  const owner = parts[0]!;
  const repo = parts[1]!;
  const existingPath = normalizeGithubImportPath(url.searchParams.get("path"));
  const existingCompanyPath = normalizeGithubImportPath(url.searchParams.get("companyPath"));
  if (existingCompanyPath) {
    return buildGithubImportUrl({ hostname, owner, repo, ref, companyPath: existingCompanyPath });

View on GitHub (pinned to 120ae5428f)