Prisma CLI
$ prisma Official Med RiskPrisma CLI manages schema.prisma validation, type-safe Prisma Client code generation, and SQL migrations (prisma migrate). Offers deterministic non-interactive commands like prisma validate, prisma generate, and prisma migrate deploy for CI and coding agents.
npm install -D prisma npx prisma validate and npx prisma generate are foundational local TypeScript compiler steps that must run via CLI rather than MCP.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Deterministic validate, generate, migrate status, and --create-only flags work well in agent loops, though output is mostly plain text rather than JSON.
- Non-interactive
validate,generate, andmigrate status; lacks--json
--create-only lets agents inspect generated SQL before execution; destructive migrate reset requires --force in non-TTY shells.
migrate dev --create-onlyseparates SQL generation from execution
Standard npm devDependency (npx prisma) across macOS, Linux, and Windows.
- Installed via project
npm/npxacross all major OSes
Unifies schema validation, migration generation, introspection (db pull), and TypeScript typegen.
- Core workflow for TypeScript ORM projects
Official prisma/prisma repository under Apache-2.0 with massive ecosystem adoption.
- Official
prisma/prismarepository
Thorough official CLI reference with clear flag descriptions.
- Official CLI reference at prisma.io/docs
Security, Auth & Guardrails
Database connection URLs read from DATABASE_URL in .env or prisma.config.ts; optional Prisma Data Platform key via PRISMA_API_KEY.
Prisma ORM and CLI are 100% free and Apache-2.0 open-source.
# Prisma CLI Agent Rules - Run `npx prisma validate` and `npx prisma generate` after every `schema.prisma` edit. - Use `npx prisma migrate dev --create-only --name <desc>` to generate SQL for review before applying. - NEVER run `npx prisma migrate reset` or `npx prisma db push --force-reset` without explicit approval.
Agent-Ready Command Recipes
Safe Read-Only Queries
npx prisma validate
Checks schema.prisma syntax and relation integrity without connecting to a database.
npx prisma migrate status
Reports whether the target database is in sync with local prisma/migrations.
Controlled Writes & Previews
npx prisma generate
Compiles local TypeScript types and client code from schema.prisma.
Strengths for Agents
- +
prisma validatecatches schema relation errors offline in milliseconds. - +
prisma migrate dev --create-onlycreates inspectable SQL files without mutating the database. - +
prisma generateimmediately updates TypeScript types fortscfeedback loops.
Caveats & Pitfalls
- ! Lacks
--jsonoutput onmigrate statusandvalidate. - ! Running
prisma studiostarts a blocking local web server.