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:
bunx prisma --help
bunx prisma contract emitpnpm prisma --help
pnpm prisma contract emityarn prisma --help
yarn prisma contract emitnpx prisma --help
npx prisma contract emitWith 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.tspnpm prisma auth login
pnpm run build
pnpm prisma deploy module.tsyarn prisma auth login
yarn build
yarn prisma deploy module.tsnpx prisma auth login
npm run build
npx prisma deploy module.tsTo 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 mydbpnpm prisma postgres create mydb
pnpm prisma postgres connection create mydbyarn prisma postgres create mydb
yarn prisma postgres connection create mydbnpx prisma postgres create mydb
npx prisma postgres connection create mydbpostgres 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>pnpm prisma bucket create --name my-bucket
pnpm prisma bucket key create <bucket-id>yarn prisma bucket create --name my-bucket
yarn prisma bucket key create <bucket-id>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 dbpnpm dlx prisma@latest orm init --target postgres --authoring psl
pnpm prisma contract emit
pnpm prisma db init --db "$DATABASE_URL" --advance-ref dbyarn dlx prisma@latest orm init --target postgres --authoring psl
yarn prisma contract emit
yarn prisma db init --db "$DATABASE_URL" --advance-ref dbnpx prisma@latest orm init --target postgres --authoring psl
npx prisma contract emit
npx prisma db init --db "$DATABASE_URL" --advance-ref dbdb 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"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"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"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"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"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"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.
bunx --bun prisma@latest init
bunx prisma skills syncpnpm dlx prisma@latest init
pnpm prisma skills syncyarn dlx prisma@latest init
yarn prisma skills syncnpx prisma@latest init
npx prisma skills syncA 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.