Skip to main content
Prisma Documentation Docs

Search documentation

Type to search this documentation.

On this pageOverview

Overview

Prisma ORM ships with a unified Prisma CLI. One binary contains the ORM commands and the platform commands for Prisma Composer, Prisma Compute, Prisma Postgres, and object-store buckets.

The Prisma ORM CLI ships in the prisma package. Run it without installing:

title="bun"
bunx prisma --help

bunx prisma contract emit
pnpm
pnpm prisma --help
pnpm prisma contract emit
yarn
yarn prisma --help
yarn prisma contract emit
npm
npx prisma --help
npx prisma contract emit

With prisma installed in your project, these commands become plain prisma contract emit and so on.

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

The platform commands manage the services, databases, and buckets your app runs on. With deploy and dev you deploy a Prisma Composer app to Prisma Compute and run it locally; with service and git you manage services, their versions, logs, and domains, and the repository connection. With postgres you spin up and manage Prisma Postgres databases. With bucket you create blob-storage buckets and their access keys. auth, project, and branch handle the account, project, and branch plumbing around them. Each command group has its own page in this section. Deployments are created by deploy, by a git push once you set up deploy on push, or from the Console, and each deploy produces a service version.

There are two main entry points. Platform users deploy apps, create databases, and provision buckets with the platform commands. ORM users manage their schema, contracts, and migrations with the ORM and migration commands.

Sign in, then build and deploy a Prisma Composer app. deploy creates the project on its first run, and a new project needs a region, set in the deploy config or as PRISMA_REGION; see deploy.

bunx prisma auth login

bun run build

bunx prisma deploy module.ts
Bash
pnpm prisma auth login
pnpm run build
pnpm prisma deploy module.ts
Bash
yarn prisma auth login
yarn build
yarn prisma deploy module.ts
Bash
npx prisma auth login
npm run build
npx prisma deploy module.ts

To deploy on every push, also connect the repository with git connect and add the deploy workflow; see Deploy on push.

Follow a deploy with service logs and manage the result with the service commands.

To deploy on every push, also connect the repository with git connect and add the deploy workflow; see Deploy on push.

Follow a deploy with service logs and manage the result with the service commands.

bunx prisma postgres create mydb

bunx prisma postgres connection create mydb
Bash
pnpm prisma postgres create mydb
pnpm prisma postgres connection create mydb
Bash
yarn prisma postgres create mydb
yarn prisma postgres connection create mydb
Bash
npx prisma postgres create mydb
npx prisma postgres connection create mydb

postgres create prints a one-time connection URL; postgres connection create mints another when you need one. See postgres.

postgres create prints a one-time connection URL; postgres connection create mints another when you need one. See postgres.

bunx prisma bucket create --name my-bucket

bunx prisma bucket key create <bucket-id>
Bash
pnpm prisma bucket create --name my-bucket
pnpm prisma bucket key create <bucket-id>
Bash
yarn prisma bucket create --name my-bucket
yarn prisma bucket key create <bucket-id>
Bash
npx prisma bucket create --name my-bucket
npx prisma bucket key create <bucket-id>

bucket key create prints the key's one-time credentials. See bucket.

bucket key create prints the key's one-time credentials. See bucket.

bunx prisma@latest orm init --target postgres --authoring psl

bunx prisma contract emit

bunx prisma db init --db "$DATABASE_URL" --advance-ref db
Bash
pnpm dlx prisma@latest orm init --target postgres --authoring psl
pnpm prisma contract emit
pnpm prisma db init --db "$DATABASE_URL" --advance-ref db
Bash
yarn dlx prisma@latest orm init --target postgres --authoring psl
yarn prisma contract emit
yarn prisma db init --db "$DATABASE_URL" --advance-ref db
Bash
npx prisma@latest orm init --target postgres --authoring psl
npx prisma contract emit
npx prisma db init --db "$DATABASE_URL" --advance-ref db

db init and db update advance the ref named db on their own when you leave --db off and let the connection come from prisma.config.ts. Passing --db suppresses that, so add --advance-ref db to keep the ref current. Without it, --db leaves any existing db ref where it was, and a later migration plan starts from that stale contract; if the ref was never created, migration plan refuses with MIGRATION.PLAN_ORIGIN_UNKNOWN as soon as migrations exist on disk.

db init and db update advance the ref named db on their own when you leave --db off and let the connection come from prisma.config.ts. Passing --db suppresses that, so add --advance-ref db to keep the ref current. Without it, --db leaves any existing db ref where it was, and a later migration plan starts from that stale contract; if the ref was never created, migration plan refuses with MIGRATION.PLAN_ORIGIN_UNKNOWN as soon as migrations exist on disk.

bunx prisma contract infer --db "$DATABASE_URL" --output ./prisma/contract.prisma

bunx prisma contract emit

bunx prisma db sign --db "$DATABASE_URL"

bunx prisma db verify --db "$DATABASE_URL"
Bash
pnpm prisma contract infer --db "$DATABASE_URL" --output ./prisma/contract.prisma
pnpm prisma contract emit
pnpm prisma db sign --db "$DATABASE_URL"
pnpm prisma db verify --db "$DATABASE_URL"
Bash
yarn prisma contract infer --db "$DATABASE_URL" --output ./prisma/contract.prisma
yarn prisma contract emit
yarn prisma db sign --db "$DATABASE_URL"
yarn prisma db verify --db "$DATABASE_URL"
Bash
npx prisma contract infer --db "$DATABASE_URL" --output ./prisma/contract.prisma
npx prisma contract emit
npx prisma db sign --db "$DATABASE_URL"
npx prisma db verify --db "$DATABASE_URL"

db sign also sets the db ref to the signed contract, so the next migration plan starts from the database you adopted. Pass --no-advance-ref to sign without moving a ref.

db sign also sets the db ref to the signed contract, so the next migration plan starts from the database you adopted. Pass --no-advance-ref to sign without moving a ref.

bunx prisma contract emit

bunx prisma migration plan --name add_users

bunx prisma migration status --db "$DATABASE_URL"

bunx prisma db migrate --db "$DATABASE_URL" --advance-ref db

bunx prisma db verify --db "$DATABASE_URL"
Bash
pnpm prisma contract emit
pnpm prisma migration plan --name add_users
pnpm prisma migration status --db "$DATABASE_URL"
pnpm prisma db migrate --db "$DATABASE_URL" --advance-ref db
pnpm prisma db verify --db "$DATABASE_URL"
Bash
yarn prisma contract emit
yarn prisma migration plan --name add_users
yarn prisma migration status --db "$DATABASE_URL"
yarn prisma db migrate --db "$DATABASE_URL" --advance-ref db
yarn prisma db verify --db "$DATABASE_URL"
Bash
npx prisma contract emit
npx prisma migration plan --name add_users
npx prisma migration status --db "$DATABASE_URL"
npx prisma db migrate --db "$DATABASE_URL" --advance-ref db
npx prisma db verify --db "$DATABASE_URL"

Plain db migrate never moves a ref; --advance-ref db is what keeps the next migration plan incremental. Leave it off in deploy and CI applies, where a repository ref should not move.

Plain db migrate never moves a ref; --advance-ref db is what keeps the next migration plan incremental. Leave it off in deploy and CI applies, where a repository ref should not move.

Prisma packages ship agent skills: instructions that teach AI coding agents the installed version's commands and APIs. init prepares a repository once, and skills sync keeps the installed copies matching your package versions.

title="bun"
bunx --bun prisma@latest init

bunx prisma skills sync
pnpm
pnpm dlx prisma@latest init
pnpm prisma skills sync
yarn
yarn dlx prisma@latest init
yarn prisma skills sync
npm
npx prisma@latest init
npx prisma skills sync

A few commands ship without dedicated pages yet. contract format formats your PSL contract source in place, including a Prisma ORM 7 schema read through prisma7Schema, and lsp starts the Prisma ORM language server (spawned by editors, not run interactively; see Editor support). The migration group also has read-only inspection commands: migration list (on-disk migrations per contract space; --space, --ascii, --legend), migration log (executed history from the database ledger; --db, --utc, --ascii), migration graph (graph topology; --space, --dot for Graphviz output, --ascii, --legend), and migration check [target] (artifact and graph integrity; --space). Run any of them with --help for the details.

Every command accepts the same set of output, prompt, and config flags. They are documented on Global flags.

Suggest an edit

Propose a replacement for this page. The site team reviews it before applying any changes.

Export
Documentation menu