Prisma Next is in early access.Read the docs

CLI configuration

Configure Prisma Next CLI commands with prisma-next.config.ts and global flags.

Prisma Next CLI commands use prisma-next.config.ts as the project entrypoint for contract emission, database operations, and migrations.

Config file

Commands that need project context read the Prisma Next config from your project. For PostgreSQL projects, use the Postgres config helper:

prisma-next.config.ts
import "dotenv/config";
import { defineConfig } from "@prisma-next/postgres/config";

export default defineConfig({
  contract: "./prisma/contract.prisma",
  db: {
    connection: process.env["DATABASE_URL"]!,
  },
});

For MongoDB projects, import defineConfig from @prisma-next/mongo/config instead.

Pass --config when your config file is not in the default project location:

prisma-next contract emit --config ./config/prisma-next.config.ts

Emit-only config

contract emit does not connect to a database, so the config can omit db.connection:

prisma-next.config.ts
import { defineConfig } from "@prisma-next/postgres/config";

export default defineConfig({
  contract: "./prisma/contract.prisma",
});

Add db.connection before running commands such as db verify, db sign, db init, db update, db schema, contract infer, or migration apply.

Extension packs

Add extension control descriptors to the config when your contract uses extension-provided types:

prisma-next.config.ts
import { defineConfig } from "@prisma-next/postgres/config";
import pgvector from "@prisma-next/extension-pgvector/control";

export default defineConfig({
  contract: "./prisma/contract.prisma",
  extensions: [pgvector],
  db: {
    connection: process.env["DATABASE_URL"]!,
  },
});

Re-run prisma-next contract emit after changing extension packs, then update the matching runtime client.

Database URLs

Database commands accept --db <url>. If you omit it, Prisma Next can use the database connection from prisma-next.config.ts.

prisma-next db verify --db "$DATABASE_URL"

Environment variables

VariableWhat it does
DATABASE_URLCommon place to store the database connection string used by config files and scripts.
NO_COLOR=1Disables colored terminal output.

Output modes

Use the default text output when running commands locally. Use --json in CI or automation:

prisma-next db verify --db "$DATABASE_URL" --json

Use --no-interactive for scripts that must never pause for user input.

On this page