Skip to main content
The init command initializes your project and installs dependencies. It creates a components.json file and sets up your project for shadcn/ui.

Usage

Arguments

string[]
Names, URL, or local path to components to install during initialization.

Options

string
The template to use. Available options:
  • next - Next.js
  • start - TanStack Start
  • vite - Vite
  • next-monorepo - Next.js Monorepo
string
The base color to use. Available options:
  • neutral
  • gray
  • zinc
  • stone
  • slate
boolean
default:"true"
Skip confirmation prompt.
boolean
default:"false"
Use default configuration.
boolean
default:"false"
Force overwrite of existing configuration.
string
The working directory. Defaults to the current directory.
boolean
default:"false"
Mute output.
boolean
default:"false"
Use the src directory when creating a new project.
boolean
Do not use the src directory when creating a new project.
boolean
default:"true"
Use CSS variables for theming.
boolean
Do not use CSS variables for theming.
boolean
Do not install the base shadcn style.
boolean
default:"false"
Enable RTL (right-to-left) support.

Examples

Basic initialization

This will prompt you to configure your project interactively.

Initialize with defaults

Uses default configuration (Next.js template with neutral base color).

Initialize with specific template and color

Initialize with components

Initializes the project and installs the button and card components.

Initialize with RTL support

Initialize in a specific directory

Output

The command creates a components.json file in your project root with your configuration:

What it does

  1. Detects your project framework and configuration
  2. Prompts for configuration options (style, base color, paths, etc.)
  3. Creates components.json with your preferences
  4. Installs the base style (if not disabled)
  5. Installs any specified components
  6. Updates Tailwind configuration if needed