# CLI configuration (/docs/cli/next/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 Next CLI commands with prisma-next.config.ts and global flags.

Location: CLI > Next > CLI configuration

Prisma Next CLI commands use `prisma-next.config.ts` as the project entrypoint for contract emission, database operations, and migrations.

## Config file [#config-file]

Commands that need project context read the Prisma Next config from your project. For PostgreSQL projects, use the Postgres config helper:

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

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

For MongoDB projects, import `defineConfig` from `@prisma-next/mongo/config` instead.

Pass `--config` when your config file is not in the default project location:

```bash
prisma-next contract emit --config ./config/prisma-next.config.ts
```

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

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

```typescript title="prisma-next.config.ts"
import { defineConfig } from "@prisma-next/postgres/config";

export default defineConfig({
  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 `migration apply`.

## Extension packs [#extension-packs]

Add extension control descriptors to the config when your contract uses extension-provided types:

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

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

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

## Database URLs [#database-urls]

Database commands accept `--db <url>`. If you omit it, Prisma Next can use the database connection from `prisma-next.config.ts`.

```bash
prisma-next db verify --db "$DATABASE_URL"
```

## Environment variables [#environment-variables]

| Variable       | What it does                                                                           |
| -------------- | -------------------------------------------------------------------------------------- |
| `DATABASE_URL` | Common place to store the database connection string used by config files and scripts. |
| `NO_COLOR=1`   | Disables colored terminal output.                                                      |

## Output modes [#output-modes]

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

```bash
prisma-next db verify --db "$DATABASE_URL" --json
```

Use `--no-interactive` for scripts that must never pause for user input.

## Related pages

- [`prisma-next contract emit`](https://www.prisma.io/docs/cli/next/contract-emit): Emit Prisma Next contract artifacts.
- [`prisma-next contract infer`](https://www.prisma.io/docs/cli/next/contract-infer): Infer a starter contract from an existing database.
- [`prisma-next db init`](https://www.prisma.io/docs/cli/next/db-init): Initialize a database from the current Prisma Next contract.
- [`prisma-next db schema`](https://www.prisma.io/docs/cli/next/db-schema): Inspect a live database schema.
- [`prisma-next db sign`](https://www.prisma.io/docs/cli/next/db-sign): Sign a database with the current Prisma Next contract.