Add Registries
Fetch the list of shadcn-compatible registries from the official endpoint and populate the project's components.json. The CLI already resolves @registry/item for any directory entry without this step — the bulk add exists so the shadcn MCP (which only searches registries listed in components.json) can see them.
Instructions
Verify
components.jsonexists in the project root. If not, ask whether to runnpx shadcn@latest initfirst.Fetch the official registry list:
curl -s https://ui.shadcn.com/r/registries.jsonOr use WebFetch on
https://ui.shadcn.com/r/registries.json.
2b. For a handful of registries, the native CLI command is an alternative to the fetch-and-merge flow:
npx shadcn registry add @name=https://domain.com/r/{name}.json @name2=https://other.com/r/{name}.json
The fetch-and-merge flow below remains the way to add the whole directory in bulk.
Parse the JSON response. Each entry has:
name— e.g."@magicui"url— e.g."https://magicui.design/r/{name}.json"description— brief texthealth—status(healthy|degraded|unavailable|observing) andhidden
If
$ARGUMENTScontains--filter <keyword>, only include registries whosenameordescriptioncontains the keyword (case-insensitive).Read the current
components.jsonand extract the existing"registries"object (may be empty or missing).Build the new registries object by merging existing entries with the fetched ones. Skip every registry whose
health.statusisunavailableor whosehealth.hiddenis true — on 2026-10-02 that was 39 of 418 entries, none of which install. Keepdegradedones but count them for the report. For each remaining registry:- Key: the
namefield (e.g."@magicui") - Value: the
urlfield (e.g."https://magicui.design/r/{name}") - Do NOT clobber existing object-valued entries (registries with
headers/paramsauth, e.g. shadcn studio premium) — the merge must preserve those objects as-is.
- Key: the
Write the merged
"registries"back tocomponents.json. Preserve all other fields. (Registries can also live inpackage.json#registriessince CLI 4.18 — this command only writescomponents.json.)Report: how many registries were added (new), already present (kept), skipped as unavailable/hidden, and how many of the added ones are
degraded.
Example Output
Fetched 418 registries from https://ui.shadcn.com/r/registries.json
Skipped 39 unavailable/hidden registries
Added 374 new registries to components.json (41 of them degraded)
Kept 5 already configured
Total registries in components.json: 379