create-clarity
v0.1.3
Published
Scaffold a new Clarity.js app — npm create clarity@latest
Maintainers
Readme
create-clarity
Scaffold a new Clarity.js app in seconds.
npm create clarity@latest my-app
# or
npx create-clarity my-appRun with no arguments for a fully interactive setup:
npm create clarity@latestWhat you get
An interactive prompt lets you pick:
- Template — Basic (client-rendered SPA) or SSR (server-side rendering + hydration)
- Add-ons — TypeScript, Router, i18n, Testing (any combination)
The generated project is a ready-to-run Vite app wired to the Clarity compiler,
with a working counter component that demonstrates state, beforeMount and
onMount.
Non-interactive / CI
Pass flags to skip the prompts:
npx create-clarity my-app --ssr --ts --router --i18n --testing
npx create-clarity my-app -y # all defaults, no prompts| Flag | Effect |
|------|--------|
| --spa / --ssr | choose template |
| --ts, --typescript | add TypeScript |
| --router | add the router |
| --i18n | add internationalization |
| --testing | add a test setup |
| -y, --yes | accept defaults, no prompts |
| --local <path> | use a local clarity-js checkout (file: dependency) — handy for development |
After scaffolding
cd my-app
npm install
npm run devZero runtime dependencies — create-clarity uses only Node built-ins, so it
starts instantly via npm create / npx.
