# Configuration (/docs/cli/configuration)

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

Configure Prisma ORM CLI commands with prisma.config.ts and global flags.

Location: CLI > Configuration

Prisma ORM CLI commands read `prisma.config.ts` in your project root. The file has one section per part of the CLI. The Prisma ORM data commands read the `orm` section; the [agent skills commands](https://www.prisma.io/docs/cli/skills) read the `skills` section.

## Config file [#config-file]

The outer `definePrismaConfig` comes from `prisma/config` and marks the file as a Prisma ORM 8 CLI config. A Prisma ORM 7 `prisma.config.ts` without that marker is rejected rather than misread. The import resolves from your project's `node_modules`, so `prisma` must be a local dependency. The `orm` section uses the config helper for your database. For PostgreSQL:

```typescript title="prisma.config.ts"
import "dotenv/config";
import { definePrismaConfig } from "prisma/config";
import { defineConfig as ormConfig } from "@prisma/orm-postgres/config";

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

For MongoDB projects, import the section helper from `@prisma/orm-mongo/config` instead. `defineConfig` from `@prisma/cli-engine` is the former name of `definePrismaConfig` and still works, so configs scaffolded by earlier release candidates keep evaluating.

[`orm init`](https://www.prisma.io/docs/cli/orm-init) writes this file for you. Pass `--config` when your config file is not at `./prisma.config.ts`:

  

#### bun

```bash
bunx prisma@latest contract emit --config ./config/prisma.config.ts
```

#### pnpm

```bash
pnpm dlx prisma@latest contract emit --config ./config/prisma.config.ts
```

#### yarn

```bash
yarn dlx prisma@latest contract emit --config ./config/prisma.config.ts
```

#### npm

```bash
npx prisma@latest contract emit --config ./config/prisma.config.ts
```

## Emit-only config [#emit-only-config]

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

```typescript title="prisma.config.ts"
import { definePrismaConfig } from "prisma/config";
import { defineConfig as ormConfig } from "@prisma/orm-postgres/config";

export default definePrismaConfig({
  orm: ormConfig({
    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 `db migrate`.

## Extension packs [#extension-packs]

Add extension control descriptors to the `orm` section when your contract uses extension-provided types:

```typescript title="prisma.config.ts"
import { definePrismaConfig } from "prisma/config";
import { defineConfig as ormConfig } from "@prisma/orm-postgres/config";
import pgvector from "@prisma/orm-extension-pgvector/control";

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

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

## Agent skills [#agent-skills]

The `skills` section controls the [agent skills commands](https://www.prisma.io/docs/cli/skills) and the staleness check:

```typescript title="prisma.config.ts"
import { definePrismaConfig } from "prisma/config";

export default definePrismaConfig({
  skills: {
    agents: ["claude", "cursor"],
    check: true,
  },
});
```

| Field    | What it does                                                                                                                                                                                                                                            |
| -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `agents` | The agent harnesses `skills sync` writes and `skills list` reports: `claude`, `cursor`, `agents`, `devin`. An empty array records that no agent skills are wanted, and the next `skills sync` removes the copies already on disk. Default: all of them. |
| `check`  | Set `false` to stop commands reporting out-of-date skills, for everyone working in the project. Default: `true`.                                                                                                                                        |

[`init`](https://www.prisma.io/docs/cli/init) scaffolds this section for you.

## Database URLs [#database-urls]

Database commands accept `--db <url>`. If you omit it, Prisma ORM uses the database connection from `prisma.config.ts`.

  

#### bun

```bash
bunx prisma@latest db verify --db "$DATABASE_URL"
```

#### pnpm

```bash
pnpm dlx prisma@latest db verify --db "$DATABASE_URL"
```

#### yarn

```bash
yarn dlx prisma@latest db verify --db "$DATABASE_URL"
```

#### npm

```bash
npx prisma@latest db verify --db "$DATABASE_URL"
```

## Environment variables [#environment-variables]

The variables the CLI reads, such as `PRISMA_DISABLE_TELEMETRY`, `PRISMA_SKILLS_CHECK`, and the `PRISMA_SERVICE_TOKEN` pair for CI, are listed on [Environment variables](https://www.prisma.io/docs/cli/environment-variables). `DATABASE_URL` is not one of them: your config file reads it, as in the example above.

## Output modes [#output-modes]

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

  

#### bun

```bash
bunx prisma@latest db verify --db "$DATABASE_URL" --json
```

#### pnpm

```bash
pnpm dlx prisma@latest db verify --db "$DATABASE_URL" --json
```

#### yarn

```bash
yarn dlx prisma@latest db verify --db "$DATABASE_URL" --json
```

#### npm

```bash
npx prisma@latest db verify --db "$DATABASE_URL" --json
```

For an AI agent that reads the output as text rather than parsing JSON, use `--format markdown`; see [Global flags](https://www.prisma.io/docs/cli/global-flags#output-formats).

Use `--no-interactive` for scripts that must never pause for user input. Use `--confirm <token>` to grant a consent prompt non-interactively. For example, [`db update`](https://www.prisma.io/docs/cli/db-update) asks for the database name before a destructive change.

## JSON output [#json-output]

In `--json` mode, commands emit newline-delimited JSON events. Progress events have `kind: "step-finished"`. The final event has `kind: "result"` and carries the `envelope` object your script branches on:

* `envelope.ok`: `true` or `false`.
* `envelope.result`: the command's data, when `ok` is `true`.
* `envelope.error.code`: a dotted `NAMESPACE.SUBCODE`, for example `PROJECT.NOT_FOUND` or `SERVICE.PROJECT_SETUP_REQUIRED`.
* `envelope.error.summary` and `envelope.error.why`: what failed and why it was rejected.
* `envelope.nextActions`: machine-readable follow-up commands, so agents can drive the CLI.

Branch on `envelope.error.code`, not the message text: codes are a stable contract, while message wording can change between releases.

## Related pages

- [`auth`](https://www.prisma.io/docs/cli/auth): Sign in to your Prisma account from the CLI, sign out, and manage workspace sessions.
- [`branch`](https://www.prisma.io/docs/cli/branch): List platform branches for a project.
- [`bucket`](https://www.prisma.io/docs/cli/bucket): Create and manage object-store buckets.
- [`contract emit`](https://www.prisma.io/docs/cli/contract-emit): Emit Prisma ORM contract artifacts.
- [`contract infer`](https://www.prisma.io/docs/cli/contract-infer): Infer a starter contract from an existing database.