Prisma Next is in early access.Read the docs

Prisma Next CLI

Reference for the Prisma Next command line interface.

The Prisma Next CLI is exposed as prisma-next. It reads your prisma-next.config.ts, emits contract artifacts, verifies databases, and manages Prisma Next migrations.

Install the CLI package in a Prisma Next project:

npm install -D prisma-next

Then run commands with your package manager:

npx prisma-next help
npx prisma-next contract emit

For a full app scaffold, use a Prisma Next quickstart. That path creates the project files and package scripts for you. This CLI reference is for the lower-level commands those scripts call.

Common workflows

Start an existing project:

prisma-next init --target postgres --authoring psl
prisma-next contract emit
prisma-next db init --db "$DATABASE_URL"

Adopt an existing database:

prisma-next contract infer --db "$DATABASE_URL" --output ./prisma/contract.prisma
prisma-next contract emit
prisma-next db sign --db "$DATABASE_URL"
prisma-next db verify --db "$DATABASE_URL"

Use checked-in migrations:

prisma-next contract emit
prisma-next migration plan --name add-users
prisma-next migration status --db "$DATABASE_URL"
prisma-next migration apply --db "$DATABASE_URL"
prisma-next db verify --db "$DATABASE_URL"

Command groups

CommandPurpose
prisma-next initAdd Prisma Next files to a project.
prisma-next contract emitEmit contract.json and contract.d.ts from your contract source.
prisma-next contract inferInfer a starter PSL contract from an existing database.
prisma-next db initCreate missing database structures from the current contract and sign the database.
prisma-next db updateReconcile an existing database with the current contract.
prisma-next db schemaInspect the live database schema.
prisma-next db signRecord that a database matches the current contract.
prisma-next db verifyCheck that a database still matches the current contract.
prisma-next migration planCreate an on-disk migration package from contract changes.
prisma-next migration newScaffold a migration package for manual authoring.
prisma-next migration applyApply pending on-disk migrations.
prisma-next migration statusShow migration history and applied state.
prisma-next migration showInspect a migration package.
prisma-next migration refManage named migration refs.

Global flags

Most Prisma Next commands accept these flags.

FlagWhat it does
--jsonPrint machine-readable output. Use this in CI and scripts.
-q, --quietSuppress nonessential output.
-v, --verbosePrint more detail.
--traceInclude stack traces for failures.
--colorForce colored output.
--no-colorDisable colored output.
--interactiveAllow prompts.
--no-interactiveDisable prompts.
-y, --yesAccept prompts where the command supports confirmation.

Use prisma-next <command> --help when you need the exact command help from the installed preview version.

On this page