frakment
v0.3.0
Published
CLI and design system for the frakment component registry
Maintainers
Readme
frakment CLI
Monochrome design system and component registry CLI.
Requirements
- Node.js >= 22.12.0
- Tailwind CSS v4 (
@import "tailwindcss";in yourglobals.css)
Package managers
The commands below use npx. Every package manager works.
| Package manager | Run |
| :-- | :-- |
| npm | npx frakment@latest <command> |
| pnpm | pnpm dlx frakment@latest <command> |
| yarn | yarn dlx frakment@latest <command> |
| bun | bunx frakment@latest <command> |
The CLI auto-detects your package manager from the project lockfile when installing dependencies.
Usage
frakment init
npx frakment@latest initWhat it does:
- Writes
components.jsonat project root (CLI config) - Injects the theme block into
globals.cssbetween/* ==== FRAKMENT THEME START/END ==== */markers (design tokens + 9@utility+.dark+@custom-variant dark) - Preserves anything outside the markers — your
@importstatements, overrides, and custom CSS stay untouched - Creates
lib/utils.ts(thecnhelper) if missing - Installs 6 dependencies:
clsx,tailwind-merge,class-variance-authority,radix-ui,lucide-react,motion
Idempotent. Safe to re-run:
- Existing
components.jsonis preserved unless you choose to overwrite - Marker block is replaced in place (no duplicates)
- Legacy inline theme blocks (from older
initversions) are auto-migrated
frakment add <component>
npx frakment@latest add buttonFetches the component (plus all registryDependencies recursively) from the registry, writes all files, and installs any missing npm dependencies.
Flags:
--registry <url>— override the registry URL (default: fromcomponents.json)--overwrite— overwrite existing files without prompting--dry-run— show planned file and dependency changes without changing the project--skip-dependencies— write component files without installing missing npm dependencies
frakment list
npx frakment@latest listLists all available components from the registry.
Registry
The default registry URL is written to components.json during init. If the public registry is not live yet, pass --registry <url> explicitly:
npx frakment@latest add badge --registry http://localhost:8765Troubleshooting
"Frakment requires Tailwind v4"
Your globals.css must contain @import "tailwindcss";. Frakment relies on Tailwind v4 features (@theme, @utility, @custom-variant). Tailwind v3 is not supported.
"Could not find globals.css"
The CLI looks for one of:
app/globals.csssrc/app/globals.cssstyles/globals.csssrc/styles/globals.css
If none exist, create one with at minimum:
@import "tailwindcss";src/ directory projects
If your globals.css lives at src/app/globals.css, component files are written to src/components/, src/lib/, src/hooks/. Binary assets under public/ are written to public/ at the project root (Next.js serves public/ from the root regardless of src/ layout).
License
MIT licensed. See LICENSE.
