Rokkit 1.0.3

CLI

Add Rokkit to a project, upgrade packages, and scaffold skins via the CLI

The Rokkit CLI automates project setup and ongoing maintenance. It handles config file generation, dependency verification, and icon bundling.

Installation

Run without installing using npx, or install globally to use rokkit directly:

bash
Highlighting code...

rokkit init

Interactive setup for an existing SvelteKit project. Run from the project root. Prompts you for palette, icon collections, theme styles, and theme switching mode:

bash
Highlighting code...

Prompts

PromptTypeChoices
paletteselectdefault (orange/pink/sky), vibrant (blue/purple/sky), seaweed (sky/green/blue), custom
primary / secondary / accent / surfacetextTailwind palette names — only shown when palette is custom
iconsselectrokkit (built-in only), custom (add a custom collection)
iconPathtextPath to custom icon JSON — only shown when icons is custom
themesmultiselectrokkit (default), minimal, material
switcherselectsystem (prefers-color-scheme), manual (light/dark toggle), full (light/dark + style variants)

Files written

FileWhat happens
rokkit.config.jsWritten with your color palette, themes, and switcher settings. Skipped if it already exists.
uno.config.jsWritten with presetRokkit(). Skipped if already present — run rokkit doctor for migration hints.
src/app.cssPrepends @unocss/reset/tailwind.css, @rokkit/themes/dist/base, and each selected theme (e.g. @rokkit/themes/dist/rokkit). Creates the file if missing.
src/app.htmlInjects a flash-prevention script after <body> to restore saved theme/mode before paint. Skipped when switcher is system or when already present.

Generated rokkit.config.js

This file is read automatically by presetRokkit() — no arguments needed in your UnoCSS config:

javascript
Highlighting code...

Generated app.css imports

css
Highlighting code...

rokkit doctor

Validates your Rokkit setup is correctly configured. Run when something looks broken or after manual changes:

bash
Highlighting code...

Checks

IDWhat it verifiesAuto-fixable
config-existsrokkit.config.js presentYes — generates an empty config
uno-uses-presetuno.config.js uses presetRokkit()No — manual fix required
css-importsapp.css has @rokkit/themes/dist/base importYes — prepends missing imports
html-init-scriptapp.html has flash-prevention scriptYes — injects script after <body>

Exit codes: 0 = all checks pass, 1 = one or more failures.

Manual fix: uno-uses-preset

doctor --fix will not overwrite an existing uno.config.js. Add presetRokkit manually:

javascript
Highlighting code...

rokkit upgrade

Check for available updates to all @rokkit/* packages in your project. Compares installed versions against the latest published releases:

bash
Highlighting code...

Without --apply, upgrade prints a diff and the install command to run. With --apply, it detects your package manager (bun, pnpm, yarn, or npm from lockfiles) and runs the install automatically.

rokkit skin

Manage color skins — named palettes defined in rokkit.config.js. A skin maps each semantic color role to a Tailwind palette name:

bash
Highlighting code...

skin create adds a scaffold entry with all nine token keys (primary, secondary, accent, surface, success, warning, danger, error, info) set to default color names. Edit the values then activate with data-skin="<name>":

javascript
Highlighting code...

rokkit theme

Manage visual styles — full CSS theme files that control every component's appearance. Built-in themes come from @rokkit/themes; custom themes live in src/themes/:

bash
Highlighting code...

theme create generates a complete CSS stub at src/themes/<name>.css with one [data-style='<name>'] block for every component. Import it in src/app.css and activate with data-style="<name>" on the body:

css
Highlighting code...

Icon Tools

For icon library authors. Bundle your own SVG folders into Iconify-compatible JSON files. Not required for standard Rokkit projects.

bash
Highlighting code...
CommandOutputUse when
rokkit bundleOne JSON file per subfolderEmbedding icons in an app
rokkit buildFull Iconify package (with prefix, icons, width/height)Publishing as a standalone package
FlagShortDefaultDescription
--input-i./srcSource folder with SVG subfolders
--output-o./libOutput folder for JSON files
--config-cconfig.jsonConfig file relative to input folder

Related

  • Quick Start — step-by-step from install to first component
  • Icon Sets — available collections and UnoCSS integration