From 3bdf60340de984d75f8c63d7940e59bfd081c655 Mon Sep 17 00:00:00 2001 From: shadcn Date: Mon, 6 Apr 2026 23:19:37 +0400 Subject: [PATCH] fix --- apps/v4/content/docs/(root)/cli.mdx | 76 +++++++++++------------------ 1 file changed, 28 insertions(+), 48 deletions(-) diff --git a/apps/v4/content/docs/(root)/cli.mdx b/apps/v4/content/docs/(root)/cli.mdx index 95ac99edaf..61212d74c4 100644 --- a/apps/v4/content/docs/(root)/cli.mdx +++ b/apps/v4/content/docs/(root)/cli.mdx @@ -54,54 +54,6 @@ npx shadcn@latest create --- -## apply - -Use the `apply` command to apply a preset to an existing project. - -`apply` overwrites preset-driven config, fonts, CSS variables, and detected installed UI components. Commit or stash your changes before continuing so you can easily go back. - -`apply` requires an existing `components.json`. If your project is not initialized yet, run `shadcn init --preset ` first. - -```bash -npx shadcn@latest apply --preset a2r6bw -``` - -You can also pass the preset as a positional argument: - -```bash -npx shadcn@latest apply a2r6bw -``` - -Named presets work the same way: - -```bash -npx shadcn@latest apply lyra -``` - -If no preset is provided, the CLI offers to open the custom preset builder on `ui.shadcn.com/create`. - -Use `apply` for overwrite/reinstall flows. If you want to refresh config and CSS without reinstalling existing components, use `init --force --no-reinstall` instead. - -**Options** - -```bash -Usage: shadcn apply [options] [preset] - -apply a preset to an existing project - -Arguments: - preset the preset to apply - -Options: - --preset preset configuration to apply - -y, --yes skip confirmation prompt. (default: false) - -c, --cwd the working directory. defaults to the current directory. - --silent mute output. (default: false) - -h, --help display help for command -``` - ---- - ## add Use the `add` command to add components and dependencies to your project. @@ -135,6 +87,34 @@ Options: --- +## apply + +Use the `apply` command to apply a preset to an existing project. + +```bash +npx shadcn@latest apply --preset a2r6bw +``` + +**Options** + +```bash +Usage: shadcn apply [options] [preset] + +apply a preset to an existing project + +Arguments: + preset the preset to apply + +Options: + --preset preset configuration to apply + -y, --yes skip confirmation prompt. (default: false) + -c, --cwd the working directory. defaults to the current directory. + --silent mute output. (default: false) + -h, --help display help for command +``` + +--- + ## view Use the `view` command to view items from the registry before installing them.