# Overview (/docs/cli)

> For the complete Prisma documentation index, see [llms.txt](https://www.prisma.io/docs/llms.txt). A markdown version of any docs page is available by appending `.md` to its URL.

Prisma CLI reference

Location: Overview

Prisma ORM ships with a unified Prisma CLI. One binary contains the ORM commands and the platform commands for [Prisma Composer](https://www.prisma.io/docs/composer), [Prisma Compute](https://www.prisma.io/docs/compute), Prisma Postgres, and object-store buckets.

> [!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](https://www.prisma.io/docs/orm/v7) and its setup paths at [/v7/getting-started](https://www.prisma.io/docs/v7/getting-started).
> 
> For what release candidate means, when the final release is expected, and how to stay on version 7, see [Release status](https://www.prisma.io/docs/orm/release-status). For the Prisma ORM 8 name of every Prisma ORM 7 API, see [Coming from Prisma ORM 7](https://www.prisma.io/docs/orm/coming-from-prisma-orm-7).

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

  

#### bun

```bash
bunx prisma --help
bunx prisma contract emit
```

#### pnpm

```bash
pnpm prisma --help
pnpm prisma contract emit
```

#### yarn

```bash
yarn prisma --help
yarn prisma contract emit
```

#### npm

```bash
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](https://www.prisma.io/docs/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`](https://www.prisma.io/docs/cli/deploy) and [`dev`](https://www.prisma.io/docs/cli/dev) you deploy a [Prisma Composer](https://www.prisma.io/docs/composer) app to [Prisma Compute](https://www.prisma.io/docs/compute) and run it locally; with [`service`](https://www.prisma.io/docs/cli/service) and [`git`](https://www.prisma.io/docs/cli/git) you manage services, their versions, logs, and domains, and the repository connection. With [`postgres`](https://www.prisma.io/docs/cli/postgres) you spin up and manage [Prisma Postgres](https://www.prisma.io/docs/postgres) databases. With [`bucket`](https://www.prisma.io/docs/cli/bucket) you create blob-storage buckets and their access keys. [`auth`](https://www.prisma.io/docs/cli/auth), [`project`](https://www.prisma.io/docs/cli/project), and [`branch`](https://www.prisma.io/docs/cli/branch) handle the account, project, and branch plumbing around them. Each command group has its own page in this section. Deployments are created by a git push to the connected repository, the [Console](https://pris.ly/pdp), or `deploy`, 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, create or link a project, and connect the repository; every push then deploys. A [Prisma Composer](https://www.prisma.io/docs/composer) app deploys directly with `deploy`:

  

#### bun

```bash
bunx prisma auth login
bunx prisma project create my-app
bunx prisma git connect
bunx prisma deploy module.ts
```

#### pnpm

```bash
pnpm prisma auth login
pnpm prisma project create my-app
pnpm prisma git connect
pnpm prisma deploy module.ts
```

#### yarn

```bash
yarn prisma auth login
yarn prisma project create my-app
yarn prisma git connect
yarn prisma deploy module.ts
```

#### npm

```bash
npx prisma auth login
npx prisma project create my-app
npx prisma git connect
npx prisma deploy module.ts
```

Follow a deploy with [`service logs`](https://www.prisma.io/docs/cli/service) and manage the result with the [`service` commands](https://www.prisma.io/docs/cli/service).

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

  

#### bun

```bash
bunx prisma postgres create mydb
bunx prisma postgres connection create mydb
```

#### pnpm

```bash
pnpm prisma postgres create mydb
pnpm prisma postgres connection create mydb
```

#### yarn

```bash
yarn prisma postgres create mydb
yarn prisma postgres connection create mydb
```

#### 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`](https://www.prisma.io/docs/cli/postgres).

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

  

#### bun

```bash
bunx prisma bucket create --name my-bucket
bunx prisma bucket key create <bucket-id>
```

#### pnpm

```bash
pnpm prisma bucket create --name my-bucket
pnpm prisma bucket key create <bucket-id>
```

#### yarn

```bash
yarn prisma bucket create --name my-bucket
yarn prisma bucket key create <bucket-id>
```

#### 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`](https://www.prisma.io/docs/cli/bucket).

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

  

#### bun

```bash
bunx prisma@latest orm init --target postgres --authoring psl
bunx prisma contract emit
bunx prisma db init --db "$DATABASE_URL" --advance-ref db
```

#### 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
```

#### 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
```

#### 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](https://www.prisma.io/docs/cli/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`](https://www.prisma.io/docs/cli/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]

  

#### bun

```bash
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

```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"
```

#### 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"
```

#### 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.

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

  

#### bun

```bash
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

```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"
```

#### 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"
```

#### 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.

## Agent skills [#agent-skills]

Prisma packages ship [agent skills](https://www.prisma.io/docs/ai/tools/skills): instructions that teach AI coding agents the installed version's commands and APIs. [`init`](https://www.prisma.io/docs/cli/init) prepares a repository once, and [`skills sync`](https://www.prisma.io/docs/cli/skills) keeps the installed copies matching your package versions.

  

#### bun

```bash
bunx --bun prisma@latest init
bunx prisma skills sync
```

#### pnpm

```bash
pnpm dlx prisma@latest init
pnpm prisma skills sync
```

#### yarn

```bash
yarn dlx prisma@latest init
yarn prisma skills sync
```

#### npm

```bash
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, and `lsp` starts the Prisma ORM language server (spawned by editors, not run interactively; see [Editor support](https://www.prisma.io/docs/orm/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](https://www.prisma.io/docs/cli/global-flags).

## Related pages

- [`Choose a Prisma ORM setup path`](https://www.prisma.io/docs/getting-started): Choose the fastest path to try Prisma ORM in a new or existing project.
- [`Console`](https://www.prisma.io/docs/console): Learn how to use the Console to manage and integrate Prisma products into your application.
- [`Deploy the full Prisma stack`](https://www.prisma.io/docs/full-stack-tutorial): A single tutorial from empty directory to live URL, with Prisma Composer, Prisma ORM, and Prisma Postgres.
- [`Introduction to Prisma ORM`](https://www.prisma.io/docs/prisma-orm): Prisma ORM 8 is the current release.
- [`Local development`](https://www.prisma.io/docs/local-development): Run the whole Prisma stack on your machine, with your app on Bun, a local Prisma Postgres database, and local object storage.