apps/v4/content/docs/changelog/2024-08-npx-shadcn-init.mdx
The new CLI is now available. It's a complete rewrite with a lot of new features and improvements. You can now install components, themes, hooks, utils and more using npx shadcn add.
This is a major step towards distributing code that you and your LLMs can access and use.
npx shadcn add https://acme.com/registry/navbar.json.npx shadcn init.You can try the new cli today.
npx shadcn init sidebar-01 login-01
To update an existing project to use the new CLI, update your components.json file to include import aliases for your components, utils, ui, lib and hooks.
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "new-york",
"tailwind": {
// ...
},
"aliases": {
"components": "@/components",
"utils": "@/lib/utils",
"ui": "@/components/ui",
"lib": "@/lib",
"hooks": "@/hooks"
}
}
If you're using a different import alias prefix, e.g. ~, replace @ with your prefix.