prisma generate. Reference when using this Prisma feature.
npx skills add https://github.com/prisma/cursor-plugin --skill prisma-cli-generate
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'
Take prisma/prisma-cli-generate from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.