Templates live under templates/<template-source>.
The generator currently accepts these profiles:
minimalstandardfull
All profiles currently render from the same stable templates/minimal source. The selected profile is still recorded in ces.json, which leaves room for future profile-specific defaults without changing the manifest contract.
The scaffold process renders:
templates/minimal/base- Any selected option directories under
templates/minimal/options ces.json
Option directories can add files or override earlier files at the same output path.
For example, --database sqlite adds a raw SQLite client, and --orm drizzle overlays the database client with a Drizzle-backed version plus schema/config files.
templates/minimal/
base/
package.json.hbs
README.md.hbs
vite.config.ts.hbs
electrobun.config.ts.hbs
src/
bun/
shared/
views/
options/
addons/
turborepo/
app-menu/
edit/
database/
json-file/
sqlite/
orm/
drizzle/
router/
tanstack-router/
settings/
json/
database/
styling/
tailwindcss/
testing/
bun/
desktop-smoke/
ui/
shadcn/base is always rendered. It contains the common Electrobun app:
- Bun entrypoint and window creation.
- Shared renderer styles and framework-neutral renderer support files.
- Shared constants and types.
- Optional RPC, router, query, settings, and styling branches controlled by Handlebars data.
- Generated README tailored to selected stack flags.
package.json,tsconfig.json,biome.json, Vite config, and Electrobun config.
Because base contains conditional branches, not every option needs a separate overlay directory.
Adds turbo.json and enables Turbo scripts/dependency through the base package.json template.
Adds src/bun/menu.ts. The base Bun entrypoint calls it when --app-menu edit is selected.
Adds the React/Preact Vite renderer entrypoint, App, Home, and index.html.
Adds the shared Svelte Home.svelte renderer used by both Svelte frontend modes.
Adds the direct Svelte Vite entrypoint, App.svelte, and index.html.
Adds SvelteKit static adapter config and routes under src/views/main/routes.
Adds a Bun SQLite client and database status surface.
Adds a local JSON record store and database status surface.
Adds Drizzle files and overlays the SQLite client when Drizzle is selected.
Adds TanStack Router route files and the generated route tree placeholder.
React Router and no-router modes are handled inside the base renderer templates.
Adds a settings store backed by data/settings.json.
Adds a settings store backed by SQLite.
Adds Tailwind-specific style overlays.
Plain CSS is handled by the base style templates.
Adds scripts/package-electrobun.ts. The base package, TypeScript, and README templates add packaging commands and references when --packaging installers is selected.
Adds tests/manifest.test.ts. The base package and TypeScript templates add the script and include path when testing is enabled.
Adds tests/desktop-smoke.test.ts. The scaffold also renders testing/bun first so desktop smoke projects keep the generated manifest test.
Adds components.json and enables shadcn-related config branches in the base templates.
Template data is built in src/scaffold.ts. Important booleans include:
hasElectrobunRpchasRpcExamplehasTanstackRouterhasReactRouterhasTanstackQueryhasPreactFrontendhasReactFrontendhasSvelteFrontendhasSvelteKitFrontendhasSvelteFamilyFrontendhasTailwindhasShadcnhasDatabasehasJsonDatabasehasSqlitehasDrizzlehasJsonSettingshasDatabaseSettingshasNativeClipboardhasNativeFileDialogshasInstallerPackaginghasDesktopSmokeTesthasAppMenuhasNavigationGuardhasHiddenInsetTitlebarhasTestinghasTurborepo
Prefer adding a clear boolean in templateData over duplicating complex option checks across many .hbs files.
When adding a scaffold option:
- Add the option type, defaults, choices, flag mapping, and validation in
src/options.ts. - Add prompt labels in
src/prompts.tsif the option is interactive. - Add manifest fields or feature booleans in
src/manifest.ts. - Add template data in
src/scaffold.ts. - Add a new option directory only when the option needs new files or an overlay.
- Update tests in
tests/cli.test.ts. - Update
README.md,docs/reference/cli.md,docs/reference/options.md,docs/guides/generated-project.md,docs/reference/manifest.md, anddocs/llms.txt.
Keep option overlays narrow. A template directory should own a feature, not a broad refactor of unrelated base files.