Installation
Install Litefy components into your React project.
Prerequisites
Litefy does not provide a full project scaffold. Use it in an existing React project.
Your project needs to meet the following requirements:
- React 19+ (relies on new React 19 features; older versions are incompatible)
- TypeScript enabled
- Path alias
@/*configured to point to the root of your source code
Component templates import
cnand sibling parts from the relative barrel.., andinitgeneratesutils/cn.tsup front — so theutilsdirectory always sits next to thecomponentsdirectory and no alias configuration is required. See your build tool's documentation for how to configure the@/*alias for your own code.
Commands
init
Initialize your project: generate the litefy.json config file, create the ui/litefy directory structure, and install the required dependencies. Running add before initialization triggers the initialization flow automatically.
⚠️ Do not manually modify the path fields in
litefy.json. If you change the paths yourself, you must keep the project alias and import statements in sync; the CLI will not fix them automatically.
npx litefy@latest inityarn dlx litefy@latest initpnpm dlx litefy@latest initbunx --bun litefy@latest initOptions
-y, --yes: Skip interactive prompts and use all default configuration
add
Download and install components and their corresponding hooks and utils in batch, automatically resolve each entry's dependence (detected by scanning every template's relative imports at build time; cn is generated by init and never needs resolving), and update the aggregate export file.
npx litefy@latest add <components...>yarn dlx litefy@latest add <components...>pnpm dlx litefy@latest add <components...>bunx --bun litefy@latest add <components...>Options
-o, --overwrite: Force overwrite existing component files
rm
Remove installed components: delete the corresponding files and update the config manifest and aggregate exports.
npx litefy@latest rm <names...>yarn dlx litefy@latest rm <names...>pnpm dlx litefy@latest rm <names...>bunx --bun litefy@latest rm <names...>repair
Validate the integrity of local resources, fetch missing components and hooks online, and regenerate aggregate exports.
npx litefy@latest repairyarn dlx litefy@latest repairpnpm dlx litefy@latest repairbunx --bun litefy@latest repairclean
Offline cleanup: prune component records in the config that no longer exist locally. No network required.
npx litefy@latest cleanyarn dlx litefy@latest cleanpnpm dlx litefy@latest cleanbunx --bun litefy@latest cleanuninstall
Completely uninstall: delete all Litefy local files and litefy.json. Hand-written imports in your business code are not removed automatically; clean them up manually.
npx litefy@latest uninstallyarn dlx litefy@latest uninstallpnpm dlx litefy@latest uninstallbunx --bun litefy@latest uninstall