npx skills add ...
npx skills add prisma/cursor-plugin --skill prisma-cli-generate
npx skills add prisma/cursor-plugin --skill prisma-cli-generate
prisma generate. Reference when using this Prisma feature.
Generates assets based on the generator blocks in your Prisma schema, most commonly Prisma Client.
If you're using Bun, run Prisma with bunx --bun so it doesn't fall back to Node.js:
schema.prisma file| Option | Description |
|---|---|
--schema | Custom path to your Prisma schema |
--config | Custom path to your Prisma config file |
--sql | Generate typed sql module |
--watch | Watch the Prisma schema and rerun after a change |
--generator | Generator to use (may be provided multiple times) |
--no-hints | Hides the hint messages but still outputs errors and warnings |
--require-models | Do not allow generating a client without models |
Auto-regenerates when schema.prisma changes.
prisma-clientoutput is now required - client no longer generates to node_modulesNote: In v7, migrate dev no longer auto-runs generate.
Run before building your application.
After running prisma generate, your output directory contains:
Import the client:
prisma generate --sqlgenerator client {
provider = "prisma-client"
output = "../generated"
}// Before (v6)
import { PrismaClient } from '@prisma/client'
// After (v7)
import { PrismaClient } from '../generated/client'prisma migrate dev --name my_migration
prisma generategenerator client {
provider = "prisma-client"
output = "../generated"
}
generator zod {
provider = "zod-prisma-types"
output = "../generated/zod"
}prisma generate # Runs all generatorsgenerated/
├── client.ts
├── models/
├── enums.ts
└── ...import { PrismaClient, Prisma } from '../generated/client'