Templates
create-dashild ships three starters:
basic: no extra files. The dashboard shows the empty state; with the default--auth better-authyou also get the login, signup, and reset pages.blog: posts, categories, tags, comments, and an editorial workflow. Authors only see their own posts; admins moderate everything (ana@blog.testadmin,bruno@blog.test/carla@blog.testauthors; passworddashild123).demo: users, posts, and labels, with permissive demo policies and a seed (ana@acme.test/dashild123).shop: catalog, stock, suppliers, customers, orders, and order items. Any signed-in staff member manages it (ana@shop.test/dashild123).saas: organizations, members, and projects, isolated by tenant. It enables tenancy for you (ana@acme.testis an admin,carla@beta.testa member of another organization; passworddashild123).
pnpm create dashild@latest my-app --template demoHere, --template demo chooses the seeded demo starter, my-app names the new
folder, and pnpm create runs the published generator. Omitting --template
lets the generator ask which starter to use.
A starter can also be a local folder or come from GitHub:
npx create-dashild@latest my-app --template ./starters/crmnpx create-dashild@latest my-app --template local:../starters/crmnpx create-dashild@latest my-app --template github:acme/dashild-crm#mainnpm templates are not supported in the current alpha. The --template value
is a local path (./..., an absolute path, or local:<path>) or a
github: spec.
Format
Section titled “Format”A template is a folder with template.json and project files:
{ "name": "crm", "version": "1.0.0", "dashild": ">=0.1.0-alpha.15", "prisma": { "provider": ["postgresql"] }, "requires": { "auth": ["better-auth"] }, "extend": { "User": ["role Role @default(USER)"] }, "env": ["STRIPE_SECRET"]}| Field | Purpose |
|---|---|
name, version |
Identity recorded in dashild.json. |
dashild |
Supported Dashild semver range. |
prisma.provider |
Allowed database providers. |
requires.auth |
Required auth integration (array). |
requires.tenancy |
true needs --tenancy; false forbids it. |
overwrite |
Generated files this starter replaces on purpose (under src/). |
extend |
Extra Prisma fields for an existing model. |
dependencies, devDependencies |
Extra app dependencies. |
env |
Env keys appended to .env.example when missing. |
prisma/models.prismais appended to the schema inside a marker block. If the same template is applied again, the command fails with “already applied” instead of duplicating models. The marker detects the reapplication; it does not make it idempotent.extendadds fields to models that already exist (for exampleUser). Fields that are already present are skipped silently.- A model or enum whose name already exists in the schema is a hard error.
src/dashild/resources/*.tsare copied and registered inpanel.ts.src/dashild/policies.tsreplaces the default policies, and files listed inoverwritereplace the generated glue (bloguses it forsession.tsandactions/index.ts).prisma/seed.tsruns only when the install and migration steps succeeded; with--seedbut no migration it stays pending.envkeys are appended to.env.examplewith an empty value; values are yours to fill in.
Templates run after the Better Auth models are created, so a template can extend
User safely.
Package pinning
Section titled “Package pinning”dashild.json records the chosen template, auth, database, route, and creation
date. It does not store the installed package versions.
create-dashild pins @dashild/* in the generated package.json to the stack
version it ships with (the dashildPackages field of its own manifest). The
scaffolder can move ahead of the stack for its own fixes; the generated app
keeps the published packages it was tested with.
A template’s dependencies are merged after that pinning, so a template can
override @dashild/* and break the guarantee. Do not declare @dashild/*
packages in a template.
create-dashild is published with both latest and alpha; the docs use
pnpm create dashild@latest.