CLI
Optional source installation and project tools from @usefragments/cli.
Start with a working React app and run commands from its root. For normal component use, install @usefragments/ui through your package manager. Fragments desktop has its own setup guide.
Copy component source
Choose copied source when you need the component files in your own repository. Preview the writes, then add the components you want:
npx @usefragments/cli add button card --dry-run
npx @usefragments/cli add button cardThe public registry needs no account or key. The command writes selected source and its dependencies, a stylesheet and a registry lockfile, then prints the packages to install. Follow the source installation guide for import paths and styles.
Review source updates
Command | Purpose |
|---|---|
| registry status | Inspect the lockfile and installed source state. |
| registry diff | Compare your installed source with the registry. |
| registry sync --dry-run | Preview an update to the existing selection. |
| registry sync | Apply the update using the lockfile’s component selection. |
npx @usefragments/cli registry status
npx @usefragments/cli registry diff
npx @usefragments/cli registry sync --dry-runReview the proposed changes before running npx @usefragments/cli registry sync. Resolve any reported conflicts and inspect the resulting source diff before committing.
Set up local agent tooling
To configure the published CLI’s project metadata and available agent integrations, run:
npx @usefragments/cli@latest init --install --metadata-only --no-ci
npx @usefragments/cli doctorReview generated files and follow any action-required output. --metadata-only keeps the app’s runtime setup in place; --no-ci leaves CI configuration untouched. Doctor reports configuration and observed agent delivery separately. Continue with local MCP verification.
Look up a command
Use the installed CLI’s help for arguments and defaults:
npx @usefragments/cli --help
npx @usefragments/cli add --help
npx @usefragments/cli registry sync --helpFor a diagnostic code printed by the CLI, read its metadata from your installed package:
npx @usefragments/cli explain FUI2001 --printReplace FUI2001 with the reported code. The command prints its title, rule, category, default severity, fix availability and suppression guidance. Unknown codes return an error; use the CLI version that produced the finding. These are package diagnostics, not a mapping to desktop Checks. Older releases may print a retired docs link; the local metadata still works. The public CLI 3.3.4 supports this command.
Next steps
- Install componentsPackage styles, providers and optional source setup.
- Local MCPConnect your agent to repository tools.
- Fragments desktopOpen a project in the app.