guides
CLI
Every shadcn CLI command and flag you need to install, update and browse cnippet ui components.
cnippet ui doesn't have its own CLI. You use the shadcn CLI with the @cnippet namespace, which is listed in the shadcn registry index, so it works without any setup.
Always run shadcn@latest. Older versions don't know the @cnippet namespace. With pnpm use pnpm dlx shadcn@latest, and with Bun use bunx --bun shadcn@latest.
init
Sets up a project: creates components.json, adds lib/utils.ts, installs the base dependencies and writes the CSS variables into your global stylesheet.
To set up the full cnippet ui theme and every component in one step, pass the style:
When init asks which component library to use, choose Base UI (--base base). cnippet ui components are built on Base UI, so any shadcn/ui components you add later will match them.
init can also scaffold a new project:
add
Adds components, and any components and npm packages they depend on, to your project.
Add every cnippet ui component, or only the color tokens:
Without the @cnippet/ prefix, add installs the shadcn/ui component of the same name instead.
Updating a component
Components are copied into your project, so updates are up to you. Check what changed, then overwrite:
--overwrite replaces your file, including your own edits. Commit first so you can bring them back.
view
Prints a registry item as JSON (its files, dependencies and CSS) without installing it.
search
Lists or searches the items in a registry. list is an alias.
The cnippet ui registry has 55+ components (ui), 1,000+ variants and motion components (block), hooks (hook) and helpers (lib).
info
Prints how the CLI sees your project: framework, Tailwind CSS version, aliases and installed components. Add its output when you report a bug.
registry add
Adds a registry to components.json, so you can refer to it by namespace:
You only need this if your CLI can't reach the shadcn registry index, or you want the entry written down in your project. It adds:
mcp
Sets up the shadcn MCP server for an AI editor, so the assistant can search and install cnippet ui components. See LLMs.
--client accepts claude, cursor, vscode, codex and opencode.
Installing by URL
Every item is also available as a URL, which works with any version of the CLI and without components.json registries:
The Open in v0 button on component pages uses the same URL.