ui8kit is a registry delivery tool:
- Resolve a registry base URL (CDN / private host)
- Fetch
index.jsonand item JSON artifacts - Write item
files[].contentinto the consumer app under{dir}/… - Optionally install npm dependencies declared on the item
- Optionally scan a local kit and build publishable registry artifacts
It is not:
- A component runtime or design system implementation
- An AST-heavy codegen for Tailwind utility maps
- A package that expects you to import primitives from
node_modulesas the source of truth
Codegen (e.g. ui8kit-codegen) can produce digests; this CLI distributes them.
contractVersion: "2.0.0" describes the config + folder + item shape this CLI understands.
Keep consumer configs and published registries aligned on the same major contract.
| Field | Role |
|---|---|
framework |
Project stack hint: react | vue | svelte | solid | templ | latte | twig | jinja2 | minijinja | none |
runtime |
Registry slice / file filter when digests publish multiple stacks (often equals framework for JS) |
Examples:
- Svelte app →
framework: "svelte",runtime: "svelte" - Go Templ site with kit on disk →
framework: "templ",runtime: "templ",registryVersion: "2.0.0"(legacy digest) - Unknown / multi-kit host →
framework: "none"
All installs are rooted at config.dir (default src). Logical folders:
Folder under {dir} |
Registry type(s) | Typical content |
|---|---|---|
lib/ |
registry:lib |
Low-level helpers |
utils/ |
registry:utils |
Shared helpers (cn, …) |
components/ |
registry:component, registry:composite |
Composites |
ui/ |
registry:ui |
Primitives (3.x targets ui/<brick>/…; legacy items use components/ui/…) |
blocks/ |
registry:block |
Page sections |
layouts/ |
registry:layout |
Shells / chrome |
variants/ |
registry:variants |
Variant maps / tokens |
widgets/ |
registry:widget |
UI + light behavior |
styles/skins/ |
registry:theme |
Skins: tokens CSS (colours, radius, shadows, fonts), add theme-<skin>; not in --all |
.cursor/rules/ (app root, not under dir) |
registry:rules |
Agent rules, installed by init |
Logical names stay stable; physical folders can move via paths:
{
"dir": "web/src",
"paths": {
"ui": "kit",
"blocks": "sections"
}
}Install of registry:ui then lands under web/src/kit/… instead of web/src/primitives/…. Keep utils at {dir}/utils: bricks import ../../utils.
For each file in a registry item:
- Prefer
files[].targetwhen set (relative to{dir}) - Else derive from
files[].path+ itemtype, preserving nested structure - Never flatten to basename-only (v1 behavior removed)
Example install:
target: ui/button/button.svelte
→ {dir}/primitives/button/button.svelte
Items may declare:
| Field | Meaning |
|---|---|
dependencies |
npm packages to install into the consumer |
devDependencies |
npm dev packages |
registryDependencies |
Other registry item names to fetch first |
add resolves the registry dependency tree before writing files.
When installing TS/JS sources, the CLI may rewrite @/… import specifiers:
importStyle |
Behavior |
|---|---|
alias (default) |
Remap using config.aliases |
package |
Deprecated (warns): map component-group aliases to @ui8kit/core barrel |
Non-JS assets (.svelte, .vue, .templ, JSON, CSS) are still written; rewrite applies to transformable extensions.
| Role | Primary commands |
|---|---|
| Consumer | init, add, list, diff, info, cache, reset |
| Author / maintainer | scan, build, registry clean |
Same binary; different workflows. See Publishing and Maintain registry.