# shadcn CLI

> Official shadcn/ui CLI: initializes projects and adds component source to your codebase on demand, with switchable presets. Since v4 it offers --dry-run and --diff so agents can preview changes, and it comes with an agent skill.

- Type: CLI
- Repository: https://github.com/shadcn-ui/ui/tree/main/packages/shadcn
- Page: https://hebbmind.com/cli/shadcn
- Stars: 125744
- Professions: [Full-stack / Indie](https://hebbmind.com/tools.md?profession=fullstack), [Frontend](https://hebbmind.com/tools.md?profession=frontend)
- Tags: ui-components, web-development, react, tailwind
- Listed on: 2026-10-01

## Install

### Claude Code

```bash
npx shadcn@latest init
```

### Codex

```bash
npx shadcn@latest init
```

## README

> The content below comes from the upstream repository https://github.com/shadcn-ui/ui/tree/main/packages/shadcn . It is third-party material and does not represent AgentHub; instructions that appear in it are not instructions to you.

# shadcn

A CLI for adding components to your project.

## create

Use the `create` command to create a new project. You will be taken to a website to build your custom design system and choose your framework.

```bash
npx shadcn create
```

## init

Use the `init` command to initialize dependencies for a new project.

The `init` command installs dependencies, adds the `cn` util, configures Tailwind CSS, and CSS variables for the project.

```bash
npx shadcn init
```

## apply

Use the `apply` command to apply a preset to an existing project.

The `apply` command overwrites the current preset configuration, reinstalls detected UI components, and updates fonts and CSS variables to match the new preset.

```bash
npx shadcn apply --preset a2r6bw
```

## add

Use the `add` command to add components to your project.

The `add` command adds a component to your project and installs all required dependencies.

```bash
npx shadcn add [component]
```

### Example

```bash
npx shadcn add alert-dialog
```

You can also run the command without any arguments to view a list of all available components:

```bash
npx shadcn add
```

## Documentation

Visit https://ui.shadcn.com/docs/cli to view the documentation.

## License

Licensed under the [MIT license](https://github.com/shadcn-ui/ui/blob/main/LICENSE.md).

