description | slug | sidebar_label | sidebar_position |
---|---|---|---|
Installation |
/install |
Installation |
2 |
import ZenStackInit from './_components/_zenstack-init.md';
You can install ZenStack to your project using one of the following methods.
The easiest way to install ZenStack is to use the zenstack init
command. In an existing TypeScript project folder, run the following command:
npx zenstack@latest init
The following steps show how to install using "npm" as package manager. Replace it with the one you use for your project (like pnpm or yarn).
-
Make sure Prisma is installed
-
Install the
zenstack
CLI package as a dev dependencynpm install --save-dev zenstack@latest
-
Install the
@zenstackhq/runtime
package as a regular dependencynpm install @zenstackhq/runtime@latest
-
Bootstrap ZModel from Prisma schema
If you have a Prisma schema file, copy it to
schema.zmodel
in the project root folder. Remember, you should edit theschema.zmodel
moving forward. Theprisma/schema.prisma
file will automatically regenerate when you runzenstack generate
.