Skip to main content
The prisma-next CLI emits contracts, verifies and signs databases, and runs migrations from a type-safe contract. It is a devDependency — install it once per project and invoke it via your package manager’s script runner or npx/pnpm dlx.

Installation

Add prisma-next as a development dependency:
No install needed for new projects — run init directly with your package manager’s one-off runner:
prisma-next init prompts for your database (PostgreSQL or MongoDB) and schema location, scaffolds the config, schema, and runtime files, installs the target facade (for example @prisma-next/postgres) plus prisma-next, and emits your first contract.

Commands

Run prisma-next --help or prisma-next <command> --help for the full option surface of any command.

Global flags

All commands accept the following flags:

Exit codes

Config discovery

The CLI looks for prisma-next.config.ts in the current working directory only — it does not walk up the directory tree. To use a config file at a different path, pass --config <path> (relative or absolute).
Config loading uses c12 under the hood but is constrained to CWD. Running the CLI from a directory without a prisma-next.config.ts and without --config will produce a usage error (exit code 2).

Programmatic use

prisma-next is a CLI distribution only — it has no library exports. Importing from the prisma-next package (root or any subpath) will fail at runtime. Authors of build integrations, extension packs, and advanced config wiring should install @prisma-next/cli and import from its subpaths:
These subpaths are less stable than the facade packages (@prisma-next/postgres/config, @prisma-next/mongo/config). For application-level config, prefer the facade packages.

Command groups

contract emit

Emit contract.json and contract.d.ts from your schema.

contract infer

Infer a PSL contract from a live database for brownfield adoption.

db init

Bootstrap a new database to match the current contract (additive only).

db verify

Verify the database marker and schema match the emitted contract.

migration plan

Plan a new migration from contract changes — works fully offline.

migration apply

Apply planned migrations to a target database.