A CLI boilerplate generator for SvelteKit projects using modular fragments.
Install a fresh SvelteKit app and enrich it with optional features like auth,
UI libraries, state management, and more β all from one command.
π ## Landing Page https://svelteforge.lelab.dev/
This CLI tool:
- Prompts you for your project name.
- Bootstraps a fresh SvelteKit app using
pnpm create svelte@latest. - Installs dependencies via
pnpm install. - Asks which optional fragments (features) you want to add.
- Copies relevant code from
fragments/and installs required packages.
pnpm dlx tsx index.tsp dlx tsx ~/1Dev/Projects/Lelab/SvelteForge/svelteForge/index.tsThen follow the prompts:
π¦ Project name
β Choose optional features
π Project Structure
. βββ index.ts # Main CLI entry βββ fragments.json # List of available fragments βββ fragments/ β βββ sessionstore/ β β βββ src/ # Code to inject into the generated SvelteKit project β βββ skeletonui/ β βββ betterauth/ βββ ...
When adding a new fragment or updating an existing one, follow these steps:
- Create or update the code in fragments//src/
This folder should mirror the structure you want injected into the src/ of the generated project.
Example: fragments/supabase/src/lib/supabase.ts will end up in my-project/src/lib/supabase.ts.
- Add or update the entry in fragments.json
Each fragment must be declared in this file with:
name: folder name inside /fragments
label: question shown to the user
default: whether to pre-select it
dependencies: list of NPM packages (optional)
Example:
{
"name": "supabase",
"label": "Add Supabase integration?",
"default": false,
"dependencies": ["@supabase/supabase-js"]
}π₯ Donβt forget: if you donβt add the fragment here, it wonβt show up in the CLI!
- (Optional) Update package.json of the CLI itself
If your CLI needs runtime dependencies (e.g. uuid, prompts, etc.), add them with:
pnpm add your-package
But most fragment-specific dependencies are handled during project generation, not in the CLI's own package.json.
π¦ Dependencies
All dependencies defined in fragments.json are automatically installed with:
pnpm add ...
You donβt need to install them manually.
Keep fragments atomic and reusable
Avoid mixing unrelated logic in one fragment
Test fragment installation after updating it
Use meaningful labels so users understand what theyβre enabling
MIT β build cool things and share freely!
Created by LeLab
Code & issues: github.com/lelab
Created by LeLab
Code & issues: github.com/lelab