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:
npm install -D @usefragments/cli
export FRAGMENTS_API_KEY="fc_..."Pull every component and package entrypoint into the default target:
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:
import "@/fragments/ui/styles/globals.scss";
import { ThemeProvider, TooltipProvider, ToastProvider } from "@/fragments/ui";Commands
add
Install selected components, or everything with --all:
fragments registry add --all --to src/fragments/ui --import-path "@/fragments/ui"
fragments registry add Button Card --to src/fragments/uistatus
Inspect the lockfile and installed source state:
fragments registry statusdiff
Compare installed source against a registry artifact:
fragments registry diffsync
Refresh installed source using the existing lockfile selection:
fragments registry syncmigrate
Convert an existing @usefragments/ui app to registry source. Preview first:
fragments registry migrate --dry-run
fragments registry migrateMigrate 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.
src/fragments/ui. Change selection or refresh through the registry commands above.Next steps
- Getting Started — providers, framework notes, theming
- CLI Reference — full registry flags and options
- Components — browse the component catalog