# contract emit (/docs/cli/contract-emit)

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

Emit Prisma 8 contract artifacts.

Location: CLI > contract emit

`contract emit` reads your contract source (TypeScript or Prisma schema) and writes the generated artifacts used by the runtime, verification, and migration tooling.

The command is offline. It does not need a database connection.

## Usage [#usage]

  

#### bun

```bash
bunx prisma@latest contract emit
```

#### pnpm

```bash
pnpm dlx prisma@latest contract emit
```

#### yarn

```bash
yarn dlx prisma@latest contract emit
```

#### npm

```bash
npx prisma@latest contract emit
```

## Options [#options]

| Option                | What it does                                                          |
| --------------------- | --------------------------------------------------------------------- |
| `--output-path <dir>` | Writes `contract.json` and `contract.d.ts` into a specific directory. |
| `--config <path>`     | Read this config file instead of `./prisma.config.ts`.                |
| `--json`              | Prints a machine-readable result.                                     |

## What it creates [#what-it-creates]

The command emits:

* `contract.json`, the canonical machine-readable contract
* `contract.d.ts`, the generated TypeScript contract declarations

Do not edit these files by hand. Re-run `contract emit` after changing the contract source or extension pack list.

## Examples [#examples]

  

#### bun

```bash
bunx prisma@latest contract emit
bunx prisma@latest contract emit --output-path ./generated
bunx prisma@latest contract emit --json
```

#### pnpm

```bash
pnpm dlx prisma@latest contract emit
pnpm dlx prisma@latest contract emit --output-path ./generated
pnpm dlx prisma@latest contract emit --json
```

#### yarn

```bash
yarn dlx prisma@latest contract emit
yarn dlx prisma@latest contract emit --output-path ./generated
yarn dlx prisma@latest contract emit --json
```

#### npm

```bash
npx prisma@latest contract emit
npx prisma@latest contract emit --output-path ./generated
npx prisma@latest contract emit --json
```

## Next steps [#next-steps]

After emitting, choose the database workflow:

* use [`db init`](https://www.prisma.io/docs/cli/db-init) for first-time bootstrap
* use [`db update`](https://www.prisma.io/docs/cli/db-update) for direct reconciliation
* use [`migration plan`](https://www.prisma.io/docs/cli/migration-plan) for checked-in migrations
* use [`db verify`](https://www.prisma.io/docs/cli/db-verify) to check drift

## 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.
- [`Configuration`](https://www.prisma.io/docs/cli/configuration): Configure Prisma 8 CLI commands with prisma.config.ts and global flags.
- [`contract infer`](https://www.prisma.io/docs/cli/contract-infer): Infer a starter contract from an existing database.