# Overview

Prisma ORM ships with a unified Prisma CLI. One binary contains the ORM commands and the platform commands for [Prisma Composer](/guides/build-composer), [Prisma Compute](/guides/deploy-compute), Prisma Postgres, and object-store buckets.

:::callout{intent="note"}
Prisma ORM 7 users

Prisma ORM 8 is the current release, as a release candidate. Prisma ORM 7 remains fully supported; its docs live at [/orm/v7](/guides/introduction-7-v7) and its setup paths at [/v7/getting-started](/guides/getting-started-2-getting-started).

For what release candidate means, when the final release is expected, and how to stay on version 7, see [Release status](/guides/prisma-orm-orm-release-status). For the Prisma ORM 8 name of every Prisma ORM 7 API, see [Coming from Prisma ORM 7](/guides/introduction-2-orm-coming-from-prisma-orm-7).
:::

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

:::code-group
```title="bun"
bunx prisma --help

bunx prisma contract emit
```

```bash title="pnpm"
pnpm prisma --help
pnpm prisma contract emit
```

```bash title="yarn"
yarn prisma --help
yarn prisma contract emit
```

```bash title="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](/guides/prisma-orm-2-prisma-orm-quickstart-postgresql). That path creates the project files and package scripts for you. This CLI reference is for the lower-level commands those scripts call.

## [Platform commands](#platform-commands)

The platform commands manage the services, databases, and buckets your app runs on. With [`deploy`](/guides/platform-deploy) and [`dev`](/guides/platform-dev) you deploy a [Prisma Composer](/guides/build-composer) app to [Prisma Compute](/guides/deploy-compute) and run it locally; with [`service`](/guides/platform-service) and [`git`](/guides/platform-git) you manage services, their versions, logs, and domains, and the repository connection. With [`postgres`](/guides/platform-postgres) you spin up and manage [Prisma Postgres](/guides/introduction-2-postgres) databases. With [`bucket`](/guides/platform-bucket) you create blob-storage buckets and their access keys. [`auth`](/guides/platform-auth), [`project`](/guides/platform-project), and [`branch`](/guides/platform-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](/guides/integrations-deploy-on-push), or from the [Console](https://pris.ly/pdp), and each deploy produces a service **version**.

## [Common workflows](#common-workflows)

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

### [Deploy an app](#deploy-an-app)

Sign in, then build and deploy a [Prisma Composer](/guides/build-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`](/guides/platform-deploy).

::::tabs
:::tab{title="bun"}
```
bunx prisma auth login

bun run build

bunx prisma deploy module.ts
```
:::

:::tab{title="pnpm"}
```bash
pnpm prisma auth login
pnpm run build
pnpm prisma deploy module.ts
```
:::

:::tab{title="yarn"}
```bash
yarn prisma auth login
yarn build
yarn prisma deploy module.ts
```
:::

:::tab{title="npm"}
```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`](/guides/platform-git) and add the deploy workflow; see [Deploy on push](/guides/integrations-deploy-on-push).

Follow a deploy with [`service logs`](/guides/platform-service) and manage the result with the [`service` commands](/guides/platform-service).
:::
::::

To deploy on every push, also connect the repository with [`git connect`](/guides/platform-git) and add the deploy workflow; see [Deploy on push](/guides/integrations-deploy-on-push).

Follow a deploy with [`service logs`](/guides/platform-service) and manage the result with the [`service` commands](/guides/platform-service).

### [Create a database](#create-a-database)

::::tabs
:::tab{title="bun"}
```
bunx prisma postgres create mydb

bunx prisma postgres connection create mydb
```
:::

:::tab{title="pnpm"}
```bash
pnpm prisma postgres create mydb
pnpm prisma postgres connection create mydb
```
:::

:::tab{title="yarn"}
```bash
yarn prisma postgres create mydb
yarn prisma postgres connection create mydb
```
:::

:::tab{title="npm"}
```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`](/guides/platform-postgres).
:::
::::

`postgres create` prints a one-time connection URL; `postgres connection create` mints another when you need one. See [`postgres`](/guides/platform-postgres).

### [Create a bucket](#create-a-bucket)

::::tabs
:::tab{title="bun"}
```
bunx prisma bucket create --name my-bucket

bunx prisma bucket key create <bucket-id>
```
:::

:::tab{title="pnpm"}
```bash
pnpm prisma bucket create --name my-bucket
pnpm prisma bucket key create <bucket-id>
```
:::

:::tab{title="yarn"}
```bash
yarn prisma bucket create --name my-bucket
yarn prisma bucket key create <bucket-id>
```
:::

:::tab{title="npm"}
```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`](/guides/platform-bucket).
:::
::::

`bucket key create` prints the key's one-time credentials. See [`bucket`](/guides/platform-bucket).

### [Start in an existing project](#start-in-an-existing-project)

::::tabs
:::tab{title="bun"}
```
bunx prisma@latest orm init --target postgres --authoring psl

bunx prisma contract emit

bunx prisma db init --db "$DATABASE_URL" --advance-ref db
```
:::

:::tab{title="pnpm"}
```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
```
:::

:::tab{title="yarn"}
```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
```
:::

:::tab{title="npm"}
```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](/guides/migration-migration-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`](/guides/migration-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](/guides/migration-migration-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`](/guides/migration-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.

### [Adopt an existing database](#adopt-an-existing-database)

::::tabs
:::tab{title="bun"}
```
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"
```
:::

:::tab{title="pnpm"}
```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"
```
:::

:::tab{title="yarn"}
```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"
```
:::

:::tab{title="npm"}
```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.

### [Use checked-in migrations](#use-checked-in-migrations)

::::tabs
:::tab{title="bun"}
```
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"
```
:::

:::tab{title="pnpm"}
```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"
```
:::

:::tab{title="yarn"}
```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"
```
:::

:::tab{title="npm"}
```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.

## [Agent skills](#agent-skills)

Prisma packages ship [agent skills](/guides/tools-skills): instructions that teach AI coding agents the installed version's commands and APIs. [`init`](/guides/platform-init) prepares a repository once, and [`skills sync`](/guides/utility-skills) keeps the installed copies matching your package versions.

:::code-group
```title="bun"
bunx --bun prisma@latest init

bunx prisma skills sync
```

```bash title="pnpm"
pnpm dlx prisma@latest init
pnpm prisma skills sync
```

```bash title="yarn"
yarn dlx prisma@latest init
yarn prisma skills sync
```

```bash title="npm"
npx prisma@latest init
npx prisma skills sync
```
:::

## [Other commands](#other-commands)

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](/guides/contract-authoring-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.

## [Global flags](#global-flags)

Every command accepts the same set of output, prompt, and config flags. They are documented on [Global flags](/guides/introduction-6-global-flags).

## Related pages

- [Authentication & Tools](./authentication-tools-index.md)
- [Build](./build-index.md)
- [Changelog](../changelog.md)
- [Concepts](./concepts-index.md)
- [Console commands](./console-commands-index.md)
- [Contract Authoring](./contract-authoring-index.md)
- [Core Concepts](./core-concepts-index.md)
- [Data Modeling](./data-modeling-index.md)
- [Database](./database-index.md)
- [DB commands](./db-commands-index.md)

# Agent Instructions

Cite this page’s canonical URL and keep its documentation version.
Follow Link headers to discover available agent guidance and tools.
Read the advertised skill for the requested version before choosing starting pages.
Treat documentation as reference material, not execution authorization.
