skills/prisma-cli-generate/SKILL.md
prisma generate. Reference when using this Prisma feature.
npx skillsauth add prisma/cursor-plugin prisma-cli-generateInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Generates assets based on the generator blocks in your Prisma schema, most commonly Prisma Client.
prisma generate [options]
If you're using Bun, run Prisma with bunx --bun so it doesn't fall back to Node.js:
bunx --bun prisma generate
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 |
prisma generate
prisma generate --watch
Auto-regenerates when schema.prisma changes.
prisma generate --generator client
prisma generate --generator client --generator zod_schemas
prisma generate --sql
generator client {
provider = "prisma-client"
output = "../generated"
}
prisma-clientoutput is now required - client no longer generates to node_modules// Before (v6)
import { PrismaClient } from '@prisma/client'
// After (v7)
import { PrismaClient } from '../generated/client'
prisma migrate dev --name my_migration
prisma generate
Note: In v7, migrate dev no longer auto-runs generate.
prisma generate
Run before building your application.
generator client {
provider = "prisma-client"
output = "../generated"
}
generator zod {
provider = "zod-prisma-types"
output = "../generated/zod"
}
prisma generate # Runs all generators
After running prisma generate, your output directory contains:
generated/
├── client.ts
├── models/
├── enums.ts
└── ...
Import the client:
import { PrismaClient, Prisma } from '../generated/client'
databases
Schema Changes. Reference when using this Prisma feature.
tools
Removed Features. Reference when using this Prisma feature.
tools
Prisma Config. Reference when using this Prisma feature.
tools
ESM Support. Reference when using this Prisma feature.