shadcn-init — Claude Code command: what it does, how to install
The shadcn-init command sets up shadcn/ui in a project and adds a defined set of components. Use it when you want the UI files placed in the expected directory with the new-york theme.
AGPL-3.0 ★ 267 updated 2026-02-20
.claude/commands/shadcn-init.mdWhat shadcn-init does
The command runs npx shadcn@latest init in the 10xRules.ai project, then adds button, card, input, tabs, table, dialog, sheet, form, textarea, select, switch, and toast. It checks that the components are under src/components/ui and that the selected theme is new-york.
The setup must not use the --defaults flag. That restriction matters: an initialization run with that flag does not follow this command’s instructions. Components are added through a separate npx shadcn@latest add call.
What it helps with
- initialize shadcn/ui in a project
- add the specified UI components
- check that components are in
src/components/ui - verify the
new-yorktheme
Example prompts for the agent
- Set up shadcn/ui in this project and add the required components with
/shadcn-init. - Prepare the shadcn/ui components under
src/components/uiusing thenew-yorktheme.
How to install shadcn-init
Manually: put the files in place
.claude/commands/shadcn-init.mdCall it with /shadcn-init. For all projects use ~/.claude/commands/
Manually: put the files in place
~/.codex/prompts/shadcn-init.mdCall it with /prompts:shadcn-init. Codex marks this format deprecated in favour of skills
Manually: put the files in place
.github/prompts/shadcn-init.prompt.mdManually: put the files in place
.gemini/commands/shadcn-init.tomlGemini stores commands as TOML: the prompt text goes into the prompt field
Questions about shadcn-init
How do I install shadcn-init in Claude Code?
Copy the command file to .claude/commands/shadcn-init.md.
What does shadcn-init do?
It initializes shadcn/ui, adds a defined component set, then checks the component directory and theme.
Can I use the --defaults flag?
No. The command’s instructions explicitly prohibit --defaults during initialization.