{"record":{"id":"4652acf75dae5cba","repo":"shadcn-ui/ui","slug":"invalid-registry-namespace-namespace-registry","errorCode":null,"errorMessage":"Invalid registry namespace: ${namespace}. Registry names must start with @ (e.g., @acme).","messagePattern":"Invalid registry namespace: (.+?)\\. Registry names must start with @ \\(e\\.g\\., @acme\\)\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/shadcn/src/commands/registry/add.ts","lineNumber":60,"sourceCode":"\n      await addRegistriesToConfig(registryArgs, options.cwd, {\n        silent: options.silent,\n      })\n    } catch (error) {\n      logger.break()\n      handleError(error)\n    }\n  })\n\nexport function parseRegistryArg(arg: string): {\n  namespace: string\n  url?: string\n} {\n  const [namespace, ...rest] = arg.split(\"=\")\n  const url = rest.length > 0 ? rest.join(\"=\") : undefined\n\n  if (!namespace.startsWith(\"@\")) {\n    throw new Error(\n      `Invalid registry namespace: ${highlighter.info(namespace)}. ` +\n        `Registry names must start with @ (e.g., @acme).`\n    )\n  }\n\n  return { namespace, url }\n}\n\nfunction pluralize(count: number, singular: string, plural: string) {\n  return `${count} ${count === 1 ? singular : plural}`\n}\n\nasync function addRegistriesToConfig(\n  registryArgs: string[],\n  cwd: string,\n  options: { silent?: boolean }\n) {\n  const configPath = path.resolve(cwd, \"components.json\")","sourceCodeStart":42,"sourceCodeEnd":78,"githubUrl":"https://github.com/shadcn-ui/ui/blob/efac5987074af84ece57c367c6dd83387b967022/packages/shadcn/src/commands/registry/add.ts#L42-L78","documentation":"parseRegistryArg splits the CLI arg on '=' and requires the namespace portion to start with '@' (e.g., @acme). This matches npm-style scoped names and lets the resolver distinguish a namespace from a URL.","triggerScenarios":"Running `shadcn registry add <name>[=url]` where the first '='-separated segment doesn't begin with '@'.","commonSituations":"Forgetting the '@' prefix, typing a bare vendor name (acme instead of @acme), accidentally pasting a URL as the first segment.","solutions":["Prefix the namespace with '@': `shadcn registry add @acme`.","For a URL-backed registry: `shadcn registry add @acme=https://example.com/r/{name}.json`."],"exampleFix":"// before\nshadcn registry add acme\n// after\nshadcn registry add @acme","handlingStrategy":"validation","validationCode":"function assertRegistryArg(arg: string) {\n  const ns = arg.split(\"=\")[0]\n  if (!ns.startsWith(\"@\")) {\n    throw new Error(`Registry namespace must start with '@': got ${ns}`)\n  }\n}","typeGuard":"function isValidRegistryArg(arg: string): boolean {\n  return arg.split(\"=\")[0].startsWith(\"@\")\n}","tryCatchPattern":null,"preventionTips":["Always namespace registry args with '@'.","Document the '@acme' convention in team READMEs."],"tags":["registry","validation","cli"],"backgroundTag":null,"analyzedSha":"efac5987074af84ece57c367c6dd83387b967022","analyzedAt":"2026-08-12T05:00:50.218Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}