home / dev-tools / shadcn

shadcn CLI

109k

CLI for scaffolding shadcn/ui projects, adding registry items, and inspecting project or registry metadata.

$npx shadcn@latest init
Language
TypeScript
Stars
108,525
Category
Dev Tools
Agent
Ready
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.json config.
  • 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
  • search and view return JSON, and info --json or docs --json expose local project state and component references in machine-readable form.
  • add --dry-run, --diff, and --view support 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 init or mcp init can still prompt or rewrite local config.
Caveats
  • It is frontend-specific and file-writing by design, so unattended use should pair --dry-run or --diff with repo review.
  • Some flows depend on project detection, components.json, environment-backed private registries, or confirmation when overwriting existing config.