Shadcn CLI
Learn how to use the Shadcn CLI with namespaced registries and private registry authentication for accessing pro blocks and components.
All of our blocks are compatible and downloadable using the shadcn CLI via our Shadcn Registry.
We support namespaced registries and authentication. This feature provides improved API key authentication for our private shadcn registry, allowing you to access all our pro blocks and components directly from the CLI with environment variables. This enables seamless integration with the Shadcn MCP and other modern developer workflows.
The shadcn CLI is maintained by the shadcn/ui open source project. For command reference, init options, and registry configuration, see the shadcn CLI documentation.
For full project setup (creating a project, theme, etc.), see Blocks Getting Started.
Setup
1. Add the @shadcnblocks registry
Add the @shadcnblocks registry to your components.json as a plain URL. This is enough to install free blocks.
{ "$schema": "https://ui.shadcn.com/schema.json", "style": "radix-nova", "rsc": true, "tsx": true, "tailwind": { "config": "", "css": "app/globals.css", "baseColor": "neutral", "cssVariables": true, "prefix": "" }, "iconLibrary": "lucide", "rtl": false, "aliases": { "components": "@/components", "utils": "@/lib/utils", "ui": "@/components/ui", "lib": "@/lib", "hooks": "@/hooks" }, "menuColor": "default", "menuAccent": "subtle", "registries": { "@shadcnblocks": "https://www.shadcnblocks.com/r/{name}" } }
Do not add Authorization headers unless you need Pro blocks. Once headers with ${SHADCNBLOCKS_API_KEY} are present, the CLI requires that environment variable to exist before it can fetch any block — including free ones.
2. Install blocks
npx shadcn add @shadcnblocks/hero-1
The install command for each block is in the toolbar on the block page.
Pro Blocks & API Authentication
Only follow these steps if you need Pro or Premium blocks. API key access requires a Pro plan or higher.
1. Get your API key
Visit your Dashboard → API Keys, create a new key, and copy it.
2. Add to your environment
# .envSHADCNBLOCKS_API_KEY=sk_live_your_api_key_here
3. Update the registry with authentication
Replace the plain URL from step 1 with an authenticated registry object:
{ "$schema": "https://ui.shadcn.com/schema.json", "style": "radix-nova", "rsc": true, "tsx": true, "tailwind": { "config": "", "css": "app/globals.css", "baseColor": "neutral", "cssVariables": true, "prefix": "" }, "iconLibrary": "lucide", "rtl": false, "aliases": { "components": "@/components", "utils": "@/lib/utils", "ui": "@/components/ui", "lib": "@/lib", "hooks": "@/hooks" }, "menuColor": "default", "menuAccent": "subtle", "registries": { "@shadcnblocks": { "url": "https://www.shadcnblocks.com/r/{name}", "headers": { "Authorization": "Bearer ${SHADCNBLOCKS_API_KEY}" } } }}
Then install Pro blocks as usual:
npx shadcn add @shadcnblocks/hero-125
Next Steps
- Troubleshooting - Fix API key, monorepo, and registry URL issues
- Blocks Getting Started - Full project setup guide
- Shadcn MCP - Use blocks with AI tools