Create a new Mainz project.
- Node.js
>= 20.19.0 - For Deno projects,
denomust also be installed
Create a new project with the default runtime:
npm create mainz my-appCreate a starter project:
npm create mainz my-app -- --template starterCreate a Deno project:
npm create mainz my-app -- --runtime denoCreate a Deno starter project:
npm create mainz my-app -- --runtime deno --template starterUse the alpha release:
npm create mainz@alpha my-app--runtime <node|deno|bun>--template <empty|starter>--mainz <specifier>
Examples:
npm create mainz my-app -- --template starter
npm create mainz my-app -- --runtime deno --template starter
npm create mainz my-app -- --mainz jsr:@mainz/mainz@0.1.0-alpha.84If you do not pass --runtime, create-mainz checks installed runtimes in this
order:
nodedenobun
When multiple runtimes are available, node is chosen by default.
bun is detected, but Mainz project bootstrap is not published for Bun yet.
The generated project includes the Mainz tasks/scripts you need, but dev,
build, preview, and diagnose still require an explicit target.
Starter templates already include an app target:
Node starter projects:
cd my-app
npm install
npm run dev -- --target appDeno starter projects:
cd my-app
deno task dev --target appEmpty templates start with no targets. Create one first, then pass it to the command:
Node empty projects:
cd my-app
npm install
npm run mainz -- app create my-app
npm run dev -- --target my-appDeno empty projects:
cd my-app
deno task mainz app create my-app
deno task dev --target my-app