CLI
Install items from this registry with the shadcn CLI.
Install a registry item with the command shown on its docs page.
npx shadcn@latest add https://underscore-cn.vercel.app/r/example-card.jsonThe command that's displayed uses the homepage value from registry/config.ts for the base URL.
Human-facing item pages also work with the shadcn CLI through content negotiation. For example, a browser can view /components/example-card, while the CLI receives the installable item JSON from the same URL:
npx shadcn@latest add https://underscore-cn.vercel.app/components/example-cardUse the package manager selector on item pages to switch between npm, pnpm, yarn, bun, vite+, and deno commands.
Search
Registries hosted with this template support shadcn's dynamic search. Add the registry to a project's components.json:
{
"registries": {
"@underscore-cn": "https://underscore-cn.vercel.app/r/{name}.json"
}
}Then search, list, and view items from the CLI:
npx shadcn@latest search @underscore-cn --query card
npx shadcn@latest list @underscore-cn
npx shadcn@latest view @underscore-cn/example-cardThe CLI sends q, type, limit, and offset query parameters to the registry index. The server filters and ranks items and returns a pagination object, so the CLI doesn't need to download and filter the full catalog:
curl "https://underscore-cn.vercel.app/r/registry.json?q=card&type=registry:ui&limit=10"Requests without those parameters receive the full, unpaginated index.