home / databases / prisma

Prisma CLI

Official · Prisma
45k

Prisma ORM CLI for schema setup, client generation, database introspection, migrations, and local database workflows.

$npm install prisma --save-dev
Language
TypeScript
Stars
45,474
Category
Databases
Agent
Ready
Agent Compatibility
JSON Output
Agent Skill
MCP Support
AI Analysis

Prisma CLI is the command surface around Prisma ORM for setting up schemas, generating client code, introspecting existing databases, and running migration workflows in application projects. It also includes local Prisma Postgres development helpers and Prisma Studio launch commands.

What It Enables
  • Initialize a Prisma project, start local Prisma Postgres for development, and generate or regenerate Prisma Client artifacts from schema changes.
  • Introspect an existing database into schema.prisma, validate or format schema files, and compare schema states before applying changes.
  • Create, apply, deploy, resolve, reset, and inspect migrations, or execute SQL and seed flows against the configured datasource.
Agent Fit
  • Best when an agent is already inside a Prisma codebase and needs to inspect schema files, generate client output, or run migration and introspection steps against a known database.
  • Machine-readable output exists but is narrow: prisma version --json and prisma platform status --json are structured, while most high-value ORM commands emit human-oriented text and warnings.
  • Non-interactive commands like db pull, generate, validate, migrate status, and migrate diff compose well in scripts; migrate dev, db push, studio, and destructive reset flows are less suitable for unattended use, though prisma mcp is available when teams want that integration model.
Caveats
  • Most commands depend on a valid prisma.config.ts and reachable database URL; the README notes Prisma does not auto-load .env files for that config.
  • Several workflows are explicitly development-only or open a browser UI, and commands like migrate reset or db push --force-reset can drop data.