Unify Prisma validation, policy guardrails, and developer workflows in a single generator.
π Get PZG Pro β Purchase on GitHub | π Documentation | π‘οΈ Drift Guard
Prisma β Zod generator for end-to-end workflows.π generate validation Β· π gate policies Β· π ship docs Β· βοΈ automate server actions
Green = Free (MIT) β’ Purple/Gold = Pro (Paid)
View Mermaid source
graph TB
classDef coreRoot fill:#1e8449,stroke:#0b5345,stroke-width:4px,color:#fff;
classDef coreCategory fill:#27ae60,stroke:#145a32,stroke-width:3px,color:#fff;
classDef coreItem fill:#58d68d,stroke:#196f3d,color:#0b3d1f;
classDef proRoot fill:#f39c12,stroke:#7d6608,stroke-width:4px,color:#fff;
classDef proCategory fill:#9b59b6,stroke:#512e5f,stroke-width:3px,color:#fff;
classDef proItem fill:#bb8fce,stroke:#5b2c6f,color:#2e0f3a;
subgraph "π― CORE FEATURES (Free Forever)"
PZG[Prisma Zod Generator]
PZG --> GEN[Schema Generation]
PZG --> CUSTOM[Customization]
PZG --> SAFETY[Type Safety]
PZG --> PERF[Performance]
GEN --> GEN1["β‘ Minimal Mode"]
GEN --> GEN2["π Full Mode"]
GEN --> GEN3["ποΈ Custom Mode"]
GEN --> GEN4["π¦ Schema Variants"]
GEN --> GEN5["π’ Decimal Handling"]
GEN --> GEN6["π
DateTime Support"]
CUSTOM --> CUST1["π¨ Naming Patterns"]
CUSTOM --> CUST2["π File Organization"]
CUSTOM --> CUST3["π― Selective Generation"]
CUSTOM --> CUST4["π§ Config Options"]
CUSTOM --> CUST5["π§° Multi-Provider Helpers"]
SAFETY --> SAFE1["β
Zod v4 Formats"]
SAFETY --> SAFE2["π‘οΈ Strict Mode"]
SAFETY --> SAFE3["π Type Checking"]
SAFETY --> SAFE4["π Validation Suites"]
PERF --> PERF1["β‘ Fast Output"]
PERF --> PERF2["π¦ Tree Shaking"]
PERF --> PERF3["π― Selective Imports"]
PERF --> PERF4["π Granular Emit Control"]
end
subgraph "π PRO FEATURES (Paid Plans)"
PRO[PZG Pro]
PRO --> SEC[Security & Governance]
PRO --> DEV[Developer Experience]
PRO --> PLAT[Platform & Scale]
SEC --> SEC1["π‘οΈ Policies & Redaction"]
SEC --> SEC2["π¨ Drift Guard"]
SEC --> SEC3["π PostgreSQL RLS"]
SEC --> SEC4["π§ͺ Contract Testing"]
SEC1 --> SEC1A["Role-Based Policies"]
SEC1 --> SEC1B["Conditional Access"]
SEC1 --> SEC1C["PII Redaction"]
SEC2 --> SEC2A["CI Integration"]
SEC2 --> SEC2B["Breaking Change Alerts"]
SEC2 --> SEC2C["Auto-Block Enforcement"]
DEV --> DEV1["β‘ Server Actions Pack"]
DEV --> DEV2["π Form UX Pack"]
DEV --> DEV3["π API Docs Pack"]
DEV --> DEV4["π Data Factories"]
DEV1 --> DEV1A["Next.js Actions"]
DEV1 --> DEV1B["Type-Safe Handlers"]
DEV1 --> DEV1C["Error Recovery"]
PLAT --> PLAT1["π¦ SDK Publisher"]
PLAT --> PLAT2["π’ Multi-Tenant Kit"]
PLAT --> PLAT3["π Performance Pack"]
PLAT3 --> PLAT3A["Streaming Validation"]
PLAT3 --> PLAT3B["Chunked Processing"]
PLAT3 --> PLAT3C["Memory Efficient Pipelines"]
end
class PZG coreRoot;
class GEN,CUSTOM,SAFETY,PERF coreCategory;
class GEN1,GEN2,GEN3,GEN4,GEN5,GEN6,CUST1,CUST2,CUST3,CUST4,CUST5,SAFE1,SAFE2,SAFE3,SAFE4,PERF1,PERF2,PERF3,PERF4 coreItem;
class PRO proRoot;
class SEC,DEV,PLAT proCategory;
class SEC1,SEC2,SEC3,SEC4,SEC1A,SEC1B,SEC1C,SEC2A,SEC2B,SEC2C,DEV1,DEV2,DEV3,DEV4,DEV1A,DEV1B,DEV1C,PLAT1,PLAT2,PLAT3,PLAT3A,PLAT3B,PLAT3C proItem;
Schema Generation
- β‘ Minimal Mode - Essential CRUD only
- π Full Mode - Complete ecosystem
- ποΈ Custom Mode - Granular control
- π¦ Schema Variants - Input, result, pure models
- π’ Decimal Handling - BigInt & Decimal support
- π DateTime Support - ISO formats & Zod v4
Customization
- π¨ Naming Patterns - Custom schema names
- π Organization - File structure control
- π― Selective Generation - Filter what gets generated
- π§ Config Options - Extensive configuration
- π§° Multi-Provider Helpers - Ready-made presets for each datasource
Type Safety
- β
Zod v4 Formats - ISO string methods (
.iso.date(),.iso.datetime(), etc.) - π‘οΈ Strict Mode - Enforce type correctness
- π Type Checking - Full TypeScript integration
- π Validation - Runtime type validation
Performance
- β‘ Fast Output - Optimized generation
- π¦ Tree Shaking - Remove unused code
- π― Selective Imports - Import only what you need
- π Granular Emit Control - Precise directory + preset outputs
Security & Governance
- π‘οΈ Policies & Redaction (Professional+) - Role-based policies, conditional access, PII protection
- π¨ Drift Guard (Professional+) - Breaking change detection, CI integration
- π PostgreSQL RLS (Professional+) - Row-level security, tenant isolation
- π§ͺ Contract Testing (Business+) - Pact.js integration, consumer-driven contracts
Developer Experience
- β‘ Server Actions Pack (Starter+) - Next.js typed server actions
- π Form UX Pack (Starter+) - React Hook Form + UI library integration
- π API Docs Pack (Business+) - OpenAPI v3, Swagger UI generation
- π Data Factories (Business+) - Test data generation
Platform & Scale
- π¦ SDK Publisher (Professional+) - Generate typed client SDKs
- π’ Multi-Tenant Kit (Enterprise) - Tenant isolation, context management
- π Performance Pack (Professional+) - Streaming validation, chunked processing, memory efficient
βοΈ Tip: Star the repo to keep track of new generators, recipes, and fixes.
# Install
npm install -D prisma-zod-generator
# Add to schema.prisma
generator zod {
provider = "prisma-zod-generator"
}
# Generate
npx prisma generatePoint your config file at the published JSON Schema to get autocomplete, hover docs, and validation errors in any JSON-aware editor:
{
"$schema": "../node_modules/prisma-zod-generator/lib/config/schema.json",
"mode": "full"
}Use a relative path that matches your repo layout (for example ./node_modules/...). See the JSON Schema IntelliSense guide for monorepo examples, CI validation scripts, and tips on shipping the schema with custom tooling.
- See the full documentation for detailed guides, upgrade notes, and feature walkthroughs.
- Browse
recipes/for copy-paste presets, CI snippets, and integration templates that match your stack. - Share
llms.txtwith AI copilots for an on-ramp to the architecture, commands, and conventions.
If Prisma Zod Generator saves you time or catches bugs before production, consider sponsoring to fund maintenance and new feature work.
- On GitHub Sponsors, switch to the One-time tab (second tab) to see the PZG plan tiers. Pick the yearly tiers labeled PZG Starter, PZG Professional, PZG Business, or PZG Enterprise to unlock the corresponding Pro licensesβmonthly βsupportβ tiers (e.g., Pro (Individual)) in the Monthly tab do not include PZG Pro.
Open the One-time tab to see the Prisma Zod Generator Starter, Professional, and Business tiers.
PRs are welcome! Keep diffs focused, open an issue before large refactors, and lean on the test suites for expected behavior and coverage.
When you edit Mermaid blocks in this README, run pnpm render:diagrams afterwards. The script refreshes the SVG fallbacks in docs/assets/diagrams/ so diagrams render correctly on npm and GitHub Mobile.
MIT Β© Omar Dulaimi
Core features: MIT licensed, free forever
Pro features: Commercial license, see pricing