# shadcn CLI Reference Configuration is read from `components.json`. > **IMPORTANT:** Always run commands using the project's package runner: `npx shadcn@latest`, `pnpm dlx shadcn@latest`, or `bunx --bun shadcn@latest`. Check `packageManager` from project context to choose the right one. Examples below use `npx shadcn@latest` but substitute the correct runner for the project. > **IMPORTANT:** Only use the flags documented below. Do not invent or guess flags — if a flag isn't listed here, it doesn't exist. The CLI auto-detects the package manager from the project's lockfile; there is no `--package-manager` flag. ## Contents - Commands: init, add (dry-run, smart merge), search, view, docs, info, build - Templates: next, vite, start, react-router, astro - Presets: named, code, URL formats and fields - Switching presets --- ## Commands ### `init` — Initialize or create a project ```bash npx shadcn@latest init [components...] [options] ``` Initializes shadcn/ui in an existing project or creates a new project (when `--name` is provided). Optionally installs components in the same step. | Flag | Short | Description | Default | | ----------------------- | ----- | --------------------------------------------------------- | ------- | | `--template