CLI for scaffolding shadcn/ui projects, adding registry items, and inspecting project or registry metadata.
$npx shadcn@latest init
Agent Compatibility
JSON Output
Agent Skill
MCP Support
AI Analysis
shadcn CLI is the terminal interface for setting up shadcn/ui projects and working with shadcn-compatible registries. It scaffolds frontend apps, inspects available components or blocks, and writes source files directly into your repo.
What It Enables
- Initialize or reconfigure a frontend project with templates, presets, base library selection, monorepo support, and generated
components.jsonconfig. - Search registries, view registry payloads before install, and fetch docs, examples, or project info for follow-up edits.
- Add components, blocks, themes, or other registry items to a codebase, or build JSON output for your own shadcn-compatible registry.
Agent Fit
searchandviewreturn JSON, andinfo --jsonordocs --jsonexpose local project state and component references in machine-readable form.add --dry-run,--diff, and--viewsupport inspect-change-verify loops before files are written.- Best when an agent is already inside a React or Tailwind repo using shadcn-compatible registries; the value is narrower outside that ecosystem, and
initormcp initcan still prompt or rewrite local config.
Caveats
- It is frontend-specific and file-writing by design, so unattended use should pair
--dry-runor--diffwith repo review. - Some flows depend on project detection,
components.json, environment-backed private registries, or confirmation when overwriting existing config.