Documentation

Registry

Install Fragments UI as verified source. Governance checks the lockfile against the published artifact.

For governed Cloud projects, install from a registry artifact so fragments check can prove source matches the published version. Full flags live on /cli.

Install

Install the CLI, then set a Cloud API key:

Terminal
npm install -D @usefragments/cli
export FRAGMENTS_API_KEY="fc_..."

Pull every component and package entrypoint into the default target:

Terminal
fragments registry add --all \
--to src/fragments/ui \
--import-path "@/fragments/ui"

The CLI discovers the hosted artifact from Fragments Cloud catalog metadata. Override only for local artifacts with --from, --registry-from, or FRAGMENTS_UI_REGISTRY_ARTIFACT_URL.

Import styles once from the registry path:

src/main.tsx
import "@/fragments/ui/styles/globals.scss";
import { ThemeProvider, TooltipProvider, ToastProvider } from "@/fragments/ui";

Commands

add

Install selected components, or everything with --all:

Terminal
fragments registry add --all --to src/fragments/ui --import-path "@/fragments/ui"
fragments registry add Button Card --to src/fragments/ui

status

Inspect the lockfile and installed source state:

Terminal
fragments registry status

diff

Compare installed source against a registry artifact:

Terminal
fragments registry diff

sync

Refresh installed source using the existing lockfile selection:

Terminal
fragments registry sync

migrate

Convert an existing @usefragments/ui app to registry source. Preview first:

Terminal
fragments registry migrate --dry-run
fragments registry migrate

Migrate installs registry source, rewrites npm imports to @/fragments/ui, updates simple Next.js transpilePackages, and removes the npm UI package unless you pass --keep-package. See /cli.

Lockfile and drift

fragments registry add writes source plus .fragments/registry-lock.json.

The lockfile pins the artifact version and file hashes so fragments check can prove committed source still matches the registry.

Drift means local files no longer match the lockfile. Inspect with fragments registry status and fragments registry diff, then refresh with fragments registry sync.

Do not hand-edit managed files under src/fragments/ui. Change selection or refresh through the registry commands above.

Next steps