paperclipai/paperclip · error · Error
Only GitHub URLs and local paths are supported for import. G
Error message
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.
What it means
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.
Source
Thrown at cli/src/commands/client/company.ts:1707
mode: "new_company" as const,
newCompanyName: opts.newCompanyName?.trim() || null,
};
if (targetPayload.mode === "existing_company" && !targetPayload.companyId) {
throw new Error("Target existing company requires --company-id (or context default companyId).");
}
let sourcePayload:
| { type: "inline"; rootPath?: string | null; files: Record<string, CompanyPortabilityFileEntry> }
| { type: "github"; url: string };
let chunkedZip: { zipBytes: Uint8Array; rootPath: string } | null = null;
const treatAsLocalPath = !isHttpUrl(from) && await pathExists(from);
const isGithubSource = looksLikeRepoUrl(from) || (isGithubShorthand(from) && !treatAsLocalPath);
if (isHttpUrl(from) || isGithubSource) {
if (!looksLikeRepoUrl(from) && !isGithubShorthand(from)) {
throw new Error(
"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.",
);
}
sourcePayload = { type: "github", url: normalizeGithubImportSource(from, opts.ref) };
} else {
if (opts.ref?.trim()) {
throw new Error("--ref is only supported for GitHub import sources.");
}
chunkedZip = await resolveChunkedImportZip(
from,
target === "existing"
? EXISTING_COMPANY_CHUNKED_IMPORT_THRESHOLD_BYTES
: CHUNKED_IMPORT_THRESHOLD_BYTES,
);
if (chunkedZip) {
// Too large for one request: the zip travels as a chunked
// transfer, so the inline files map is never built or sent.View on GitHub (pinned to 67001ec6eb)
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.
Example fix
# before paperclipai company import https://gitlab.com/acme/export # after git clone https://gitlab.com/acme/export /tmp/acme-export paperclipai company import /tmp/acme-export
Defensive patterns
Strategy: validation
Validate before calling
function classifyImportSource(raw: string): { kind: "github" | "local"; value: string } {
const s = raw.trim();
if (/^https?:\/\//i.test(s)) {
if (/github\.com|ghe\./i.test(s) || /\/[^/]+\/[^/]+(?:\.git)?$/.test(s)) {
return { kind: "github", value: s };
}
throw new Error("HTTP source must be a GitHub/GitHub-Enterprise URL; clone to a local path instead.");
}
return { kind: "local", value: s };
} Type guard
function isGithubUrl(v: string): boolean {
return /^https:\/\/([^/]+\.)?github\.com\//i.test(v) || /\bgithub\.enterprise\b/i.test(v);
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- Source path or URL is required.
- Invalid --collision value. Use: rename, skip, replace
- Invalid --target value. Use: new | existing
- Target existing company requires --company-id (or context de
- --ref is only supported for GitHub import sources.
AI-assisted analysis of paperclipai/paperclip@67001ec6eb (2026-08-12).
Data as JSON: /api/errors/fe18719c861c868d.
Report an issue: GitHub.