cooud-ui
v0.5.0
Published
cooud-ui — add Cooud UI components to your project, shadcn-style (copy-paste registry).
Maintainers
Readme
cooud-ui (CLI)
Add Cooud UI components to your project, shadcn-style — you own the source.
npx cooud-ui init # write cooud-ui.json + lib/cn.ts + base copy deps
npx cooud-ui add button card # copy components in (resolves dependencies)
npx cooud-ui add date-picker # auto-pulls button, calendar, popover
npx cooud-ui list # list everything in the registry (alias: ls)
npx cooud-ui diff # show which installed components driftedCommands & flags
| Command | Args | Flags |
| ------------------ | ------------------ | --------------------------------------------------------------- |
| init | — | -c, --cwd <dir> · -r, --registry <source> · -y, --yes · --skip-install |
| add | [components...] | -c, --cwd <dir> · -r, --registry <source> · -o, --overwrite · --skip-install |
| list (ls) | — | -c, --cwd <dir> · -r, --registry <source> |
| diff | [components...] | -c, --cwd <dir> · -r, --registry <source> |
How it works
- The registry (
registry/*.json) is generated from the real@cooud-ui/uisources bypackages/cli/scripts/build-registry.ts— each item carries its source, its npmdependencies, and itsregistryDependencies(other components it imports), derived by parsing imports. - The default registry is pinned to the CLI package version (
v0.2.0here), not mutablemain, so a published CLI reads the registry snapshot it was released with. Use-r, --registry ./registrywhen testing local registry changes before a release tag exists. initinstalls only the base copy dependencies used by generated components (clsx,tailwind-merge,class-variance-authority, and Radix Slot). It does not install the public Cooud token and theme packages unless you add them separately for runtime theming.addresolves the transitive closure ofregistryDependencies, writes the files into your project, and rewrites imports to your aliases:../lib/cn.js → @/lib/cn,./button.js → @/components/ui/button.- It then installs the collected npm dependencies with your package manager (bun / pnpm / yarn / npm, auto-detected).
Config (cooud-ui.json)
{
"aliases": { "ui": "@/components/ui", "lib": "@/lib" },
"paths": { "ui": "components/ui", "lib": "lib" },
"registry": "https://raw.githubusercontent.com/pedrogbraz/cooud-ui/v0.2.0/registry"
}Point -r, --registry <path-or-url> at a local registry/ directory for offline use
or testing. Regenerate the registry after changing components:
bun run -F cooud-ui registry. Verify it is in sync locally with
bun run -F cooud-ui registry:check.
