Skip to main content
Prisma Documentation Docs

Search documentation

Type to search this documentation.

On this pageOverview

create-prisma

create-prisma creates a new Prisma ORM project from an app template. It installs Prisma ORM, emits the contract, and generates a deployable Prisma Composer app. PostgreSQL projects use Composer's native Prisma Postgres provider, including migrations and a typed runtime client.

Use it when you want to start from a working app. If you already have an app, follow Add Prisma ORM to an existing PostgreSQL project or Add Prisma ORM to an existing MongoDB project instead.

Run the CLI with your package manager and answer the prompts:

bun create prisma@latest my-app
Bash
pnpm create prisma@latest my-app
Bash
yarn create prisma@latest my-app
Bash
npm create prisma@latest -- my-app

The prompts cover the project name, the app template, the database provider, the contract authoring style, the package manager, whether to install agent skill files for coding assistants, and whether to deploy right away. Skill files go into .claude/, .cursor/, .agents/, and .devin/ by default; answer no, or pass --skills none, to skip them. To remove them later, set skills: { agents: [] } in prisma.config.ts and run prisma skills sync; see Configuration. Generated Node.js projects expect Node.js 22.18 or newer (on the 24 line, 24.11 or newer); Node.js 24 is recommended.

The last prompt is:

text
Deploy to Prisma now?

The prompt defaults to Yes. --yes accepts the defaults for the other prompts but answers No here, so --yes on its own never deploys; --json deploys unless you pass --no-deploy. Choose no to deploy later with the generated deploy script. When more than one Prisma workspace session is available, the CLI asks which workspace receives the deployment; pass --workspace <id-or-name> to pick one without a prompt, or omit it to use the active workspace. Choosing another workspace also updates the Prisma CLI's active workspace session.

The prompts cover the project name, the app template, the database provider, the contract authoring style, the package manager, whether to install agent skill files for coding assistants, and whether to deploy right away. Skill files go into .claude/, .cursor/, .agents/, and .devin/ by default; answer no, or pass --skills none, to skip them. To remove them later, set skills: { agents: [] } in prisma.config.ts and run prisma skills sync; see Configuration. Generated Node.js projects expect Node.js 22.18 or newer (on the 24 line, 24.11 or newer); Node.js 24 is recommended.

The last prompt is:

Deploy to Prisma now?

The prompt defaults to Yes. --yes accepts the defaults for the other prompts but answers No here, so --yes on its own never deploys; --json deploys unless you pass --no-deploy. Choose no to deploy later with the generated deploy script. When more than one Prisma workspace session is available, the CLI asks which workspace receives the deployment; pass --workspace <id-or-name> to pick one without a prompt, or omit it to use the active workspace. Choosing another workspace also updates the Prisma CLI's active workspace session.

Pass flags when you already know the project shape. --yes accepts the defaults for anything you leave out:

bun create prisma@latest my-app --template next --provider postgres --yes
Bash
pnpm create prisma@latest my-app --template next --provider postgres --yes
Bash
yarn create prisma@latest my-app --template next --provider postgres --yes
Bash
npm create prisma@latest -- my-app --template next --provider postgres --yes

create is the default subcommand, so npm create prisma@latest -- create my-app ... and npm create prisma@latest -- my-app ... are the same command. Everything after -- goes to create-prisma; without the separator npm keeps the flags for itself.

FlagWhat it does
<name> or --name <name>The project name and directory.
--template <name>Chooses the app template (see below).
--provider postgres|postgresql|mongo|mongodbChooses the database: PostgreSQL relational models or MongoDB document models.
--authoring psl|typescriptChooses the contract authoring style.
--package-manager npm|pnpm|yarn|bun|denoChooses the package manager used to install dependencies.
--skills <agents>|noneWhich coding agents get skill files, or none to opt out. Same values and effect as prisma init --skills; the choice is recorded in the skills config section.
--deploy / --no-deployDeploys the generated app to Prisma immediately, or skips that step.
--workspace <id-or-name>The Prisma workspace to deploy into.
--yesSkips prompts and accepts the default choices, which means no deploy.
--forceScaffolds into a non-empty directory, overwriting the generated starter and Prisma files (config, contract, and db.ts). It refuses when the target has a non-empty migrations/ directory.
--verboseShows the full command output during setup. Not compatible with --json.
--jsonRuns non-interactively and writes one JSON result object to stdout, for agents and automation. Deploys unless you pass --no-deploy.

create is the default subcommand, so npm create prisma@latest -- create my-app ... and npm create prisma@latest -- my-app ... are the same command. Everything after -- goes to create-prisma; without the separator npm keeps the flags for itself.

Flag What it does
<name> or --name <name> The project name and directory.
--template <name> Chooses the app template (see below).
--provider postgres|postgresql|mongo|mongodb Chooses the database: PostgreSQL relational models or MongoDB document models.
--authoring psl|typescript Chooses the contract authoring style.
--package-manager npm|pnpm|yarn|bun|deno Chooses the package manager used to install dependencies.
--skills <agents>|none Which coding agents get skill files, or none to opt out. Same values and effect as prisma init --skills; the choice is recorded in the skills config section.
--deploy / --no-deploy Deploys the generated app to Prisma immediately, or skips that step.
--workspace <id-or-name> The Prisma workspace to deploy into.
--yes Skips prompts and accepts the default choices, which means no deploy.
--force Scaffolds into a non-empty directory, overwriting the generated starter and Prisma files (config, contract, and db.ts). It refuses when the target has a non-empty migrations/ directory.
--verbose Shows the full command output during setup. Not compatible with --json.
--json Runs non-interactively and writes one JSON result object to stdout, for agents and automation. Deploys unless you pass --no-deploy.
--template App
minimal A minimal server with one query
next Next.js
hono Hono
elysia Elysia
nest NestJS
svelte SvelteKit
astro Astro
nuxt Nuxt
tanstack-start TanStack Start

Every template supports PostgreSQL and MongoDB, PSL or TypeScript contract authoring, and npm, pnpm, Yarn, and Bun. Each framework guide walks the generated app from the first query to a deploy.

Deno is supported for local minimal PostgreSQL apps:

deno run -A --minimum-dependency-age=0 npm:create-prisma@latest my-deno-app --template minimal --provider postgres --package-manager deno --no-deploy

Deno 2.9 skips packages published in the previous 24 hours by default, so without --minimum-dependency-age=0 a newly published create-prisma release resolves to an older cached version. Prisma Compute does not support Deno deployments yet, so Deno projects stop at a verified local run.

Set the connection string in your environment, then initialize the database and start the dev server. The generated prisma.config.ts reads DATABASE_URL for PostgreSQL and MONGODB_URL for MongoDB from the process environment and loads no dotenv file (Deno projects are the exception: their scripts pass --env-file=.env), so export the variable in the shell before running the scripts.

cd my-app

npm run db:init

npm run dev

Sample records are seeded on the app's first query. From there, evolve the contract under src/prisma/, run npm run contract:emit, and plan and apply the migration with npx prisma migration plan and npx prisma db migrate. The quickstart covers that loop in detail, and the MongoDB quickstart covers the MongoDB connection string.

The scaffold adds these scripts to package.json:

Script Runs
contract:emit prisma contract emit
db:init prisma db init
db:update prisma db update
db:verify prisma db verify
migration:plan prisma migration plan
migrate prisma db migrate
migration:status prisma migration status
migration:show prisma migration show
skills:sync prisma skills sync || exit 0
postinstall prisma skills sync || exit 0, added by the prisma init the scaffold runs
composer:dev prisma dev module.ts
composer:deploy prisma deploy module.ts
dev:composer the build script, then composer:dev
deploy the build script, then composer:deploy

Deno projects get the Prisma scripts only, each wrapped in deno run -A npm:..., without skills:sync, without postinstall, and without the Composer scripts. --skills none also leaves out skills:sync and postinstall.

Published builds may send anonymous usage telemetry. It never includes project names, file paths, or database URLs. Disable it by setting DO_NOT_TRACK, CREATE_PRISMA_DISABLE_TELEMETRY, or CREATE_PRISMA_TELEMETRY_DISABLED in your environment.

The CLI is open source at prisma/create-prisma.

Suggest an edit

Propose a replacement for this page. The site team reviews it before applying any changes.

Export
Documentation menu