create-addi-app
v4.0.0
Published
Scaffolds an `addi-app` project.
Maintainers
Readme
create-addi-app
Scaffolds an addi-app: a SvelteKit project that deploys to Cloudflare Workers, styled with Tailwind CSS v4 and shadcn-svelte, with optional Drizzle ORM on D1, Better Auth, and a couple of utility libraries (runed, neverthrow).
Usage
npm create addi-app
# or: pnpm create addi-app / yarn create addi-app / bun create addi-appPass a name and flags to skip the prompts:
npm create addi-app my-app -- --database --auth --useful| Flag | Effect |
| ------------------------------ | ------------------------------------------ |
| --database / --no-database | Drizzle ORM on Cloudflare D1 |
| --auth / --no-auth | Better Auth (requires the database) |
| --useful / --no-useful | runed + neverthrow |
| --debug | Print output from every underlying command |
| --help, -h | Usage |
Anything you don't specify gets asked interactively. Unknown flags are an error, not a shrug.
Requires Node 20.19 or newer. The CLI detects whichever package manager invoked it and uses that for the generated app.
What you get
The generated app is a SvelteKit minimal template (TypeScript) wired to @sveltejs/adapter-cloudflare with a Workers-target wrangler.jsonc, plus:
- Tailwind CSS v4 with the typography plugin
- shadcn-svelte set up with the amethyst-haze theme; button, button-group, card, and separator are preinstalled
- ESLint and Prettier configured and passing out of the box
- With
--database: Drizzle ORM against a D1 binding namedD1, migrations included in the workflow below - With
--auth: Better Auth backed by that database, session handling already inhooks.server.ts
Dependency versions resolve when you scaffold, not when this package was published, so a fresh app starts on current releases.
my-app/
├── src/
│ ├── lib/
│ │ ├── components/ui/ shadcn-svelte components
│ │ └── server/ db/ and auth.ts, when enabled
│ ├── routes/
│ ├── hooks.server.ts
│ └── app.d.ts
├── vite.config.ts SvelteKit + adapter config lives here
├── wrangler.jsonc
├── drizzle.config.ts only with --database
└── worker-configuration.d.ts generated by `wrangler types`Working in the generated app
npm run dev # vite dev server
npm run check # svelte-check
npm run lint # prettier + eslint
npm run preview # build, then wrangler devWith the database enabled, db:gen generates migrations (running Better Auth schema generation first if auth is on), and db:migrate applies them locally. db:migrate:preview and db:migrate:remote target Cloudflare.
To deploy, create the database and give wrangler its id:
wrangler d1 create my-app # add the printed database_id to wrangler.jsonc
npm run db:migrate:remote
npm run cf:deploySkip the D1 steps if you scaffolded without a database; cf:deploy alone is enough.
How it works
Instead of shelling out to create-cloudflare@latest and friends, this CLI calls the Svelte CLI's programmatic API directly: create() for the base project, add() for the tailwindcss, eslint, prettier, and Cloudflare adapter add-ons. shadcn-svelte runs from the generated app's own dependencies rather than a @latest download, and the remaining project files come from templates in this repo. Version ranges are deliberate everywhere, so a release of some upstream tool can't break scaffolding overnight.
Developing this repo
pnpm install
pnpm test # scaffolds test-app/ (gitignored) with everything enabledDelete test-app/ before rerunning. Contributions welcome.
