{"record":{"id":"fe18719c861c868d","repo":"paperclipai/paperclip","slug":"only-github-urls-and-local-paths-are-supported-for","errorCode":null,"errorMessage":"Only GitHub URLs and local paths are supported for import. Generic HTTP URLs are not supported. Use a GitHub or GitHub Enterprise URL (https://github.com/... or https://ghe.example.com/...) or a local directory path.","messagePattern":"Only GitHub URLs and local paths are supported for import\\. Generic HTTP URLs are not supported\\. Use a GitHub or GitHub Enterprise URL \\(https://github\\.com/\\.\\.\\. or https://ghe\\.example\\.com/\\.\\.\\.\\) or a local directory path\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/src/commands/client/company.ts","lineNumber":1707,"sourceCode":"                  mode: \"new_company\" as const,\n                  newCompanyName: opts.newCompanyName?.trim() || null,\n                };\n\n          if (targetPayload.mode === \"existing_company\" && !targetPayload.companyId) {\n            throw new Error(\"Target existing company requires --company-id (or context default companyId).\");\n          }\n\n          let sourcePayload:\n            | { type: \"inline\"; rootPath?: string | null; files: Record<string, CompanyPortabilityFileEntry> }\n            | { type: \"github\"; url: string };\n          let chunkedZip: { zipBytes: Uint8Array; rootPath: string } | null = null;\n\n          const treatAsLocalPath = !isHttpUrl(from) && await pathExists(from);\n          const isGithubSource = looksLikeRepoUrl(from) || (isGithubShorthand(from) && !treatAsLocalPath);\n\n          if (isHttpUrl(from) || isGithubSource) {\n            if (!looksLikeRepoUrl(from) && !isGithubShorthand(from)) {\n              throw new Error(\n                \"Only GitHub URLs and local paths are supported for import. \" +\n                \"Generic HTTP URLs are not supported. Use a GitHub or GitHub Enterprise URL (https://github.com/... or https://ghe.example.com/...) or a local directory path.\",\n              );\n            }\n            sourcePayload = { type: \"github\", url: normalizeGithubImportSource(from, opts.ref) };\n          } else {\n            if (opts.ref?.trim()) {\n              throw new Error(\"--ref is only supported for GitHub import sources.\");\n            }\n            chunkedZip = await resolveChunkedImportZip(\n              from,\n              target === \"existing\"\n                ? EXISTING_COMPANY_CHUNKED_IMPORT_THRESHOLD_BYTES\n                : CHUNKED_IMPORT_THRESHOLD_BYTES,\n            );\n            if (chunkedZip) {\n              // Too large for one request: the zip travels as a chunked\n              // transfer, so the inline files map is never built or sent.","sourceCodeStart":1689,"sourceCodeEnd":1725,"githubUrl":"https://github.com/paperclipai/paperclip/blob/67001ec6eb96ae601aa27bc91d9b2415d665334a/cli/src/commands/client/company.ts#L1689-L1725","documentation":"Thrown when the import source is detected as an HTTP URL (isHttpUrl true) but it is neither a recognized GitHub repo URL nor GitHub shorthand. The importer only supports GitHub/GitHub-Enterprise URLs and local paths; arbitrary HTTP(S) URLs are rejected to avoid unsupported remote fetching. The companion looksLikeRepoUrl/isGithubShorthand predicates failed to match.","triggerScenarios":"Passing a GitLab, Bitbucket, or raw file URL (e.g. https://gitlab.com/... or https://example.com/archive.zip); passing a generic https:// URL that is not under github.com or a GitHub Enterprise host.","commonSituations":"Developer hosts their company export on GitLab/internal Git server; attempting to import from a signed S3 URL or a direct .zip download link; confusion between 'any URL' and 'GitHub URL' support.","solutions":["Clone/download the source to a local directory and import the local path: `paperclipai company import ./local-dir`.","If the source is on GitHub/GitHub Enterprise, ensure the URL matches the repo URL pattern (https://github.com/org/repo or https://ghe.example.com/org/repo).","Mirror the non-GitHub repo to GitHub first, then import by URL."],"exampleFix":"# before\npaperclipai company import https://gitlab.com/acme/export\n# after\ngit clone https://gitlab.com/acme/export /tmp/acme-export\npaperclipai company import /tmp/acme-export","handlingStrategy":"validation","validationCode":"function classifyImportSource(raw: string): { kind: \"github\" | \"local\"; value: string } {\n  const s = raw.trim();\n  if (/^https?:\\/\\//i.test(s)) {\n    if (/github\\.com|ghe\\./i.test(s) || /\\/[^/]+\\/[^/]+(?:\\.git)?$/.test(s)) {\n      return { kind: \"github\", value: s };\n    }\n    throw new Error(\"HTTP source must be a GitHub/GitHub-Enterprise URL; clone to a local path instead.\");\n  }\n  return { kind: \"local\", value: s };\n}","typeGuard":"function isGithubUrl(v: string): boolean {\n  return /^https:\\/\\/([^/]+\\.)?github\\.com\\//i.test(v) || /\\bgithub\\.enterprise\\b/i.test(v);\n}","tryCatchPattern":null,"preventionTips":["For non-GitHub remotes, clone locally first then import the directory.","Teach onboarding docs that only GitHub URLs and local paths are accepted.","Validate the source type in wrapper scripts before forwarding to the CLI."],"tags":["cli","validation","import","unsupported-source","url"],"backgroundTag":null,"analyzedSha":"67001ec6eb96ae601aa27bc91d9b2415d665334a","analyzedAt":"2026-08-12T12:05:45.408Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}