Skip to main content

ZenStack CLI Reference

Usage​

zenstack [options] [command]

ΞΆ ZenStack is a Prisma power pack for building full-stack apps.

Documentation: https://zenstack.dev.

Options:
-v --version display CLI version
-h, --help display help for command

Commands:
info [path] Get information of installed ZenStack and related packages.
init [options] [path] Initialize an existing project for ZenStack.
generate [options] Generates RESTful API and Typescript client for your data model.
help [command] display help for command

Sub Commands​

init​

Initializes an existing project to use ZenStack.

zenstack init [options] [path]

Arguments​

NameDescriptionDefault
pathProject pathcurrent folder

Options​

NameDescriptionDefault
--prismalocation of Prisma schema file to bootstrap from<project path>/prisma/schema.prisma
-p, --package-managerpackage manager to use: "npm", "yarn", or "pnpm"auto detect
--no-version-checkdo not check for new versions of ZenStackfalse

Examples​

Initialize current folder with default settings.

npx zenstack init

Initialize "myapp" folder with custom package manager and schema location.

npx zenstack init -p pnpm --prisma prisma/my.schema myapp

generate​

Generates Prisma schema and other artifacts as specified by "plugin"s in ZModel.

zenstack generate [options]

Arguments​

NameDescriptionDefault
pathProject pathcurrent folder

Options​

NameDescriptionDefault
--schemaschema file (with extension .zmodel)./schema.zmodel
-p, --package-managerpackage manager to use: "npm", "yarn", or "pnpm"auto detect
-o, --output <path>default output directory for TS/JS files generated by built-in pluginsnode_modules/.zenstack
--no-default-pluginsdo not automatically run built-in pluginsfalse
--no-compiledo not compile the output of built-in pluginsfalse
--no-version-checkdo not check for new versions of ZenStackfalse

Examples​

Generate with default settings.

npx zenstack generate

Generate with custom package manager and schema location.

npx zenstack generate -p pnpm --schema src/my.zmodel

info​

Get information of installed ZenStack and related packages.

zenstack info [options] [path]

Arguments​

NameDescriptionDefault
pathProject pathcurrent folder