# contract print (/docs/cli/contract-print) > 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. Write the configured contract as a Prisma ORM 8 PSL contract. Location: CLI > contract print `contract print` loads the contract that `contract` names in `prisma.config.ts` and writes it as a Prisma ORM 8 PSL contract. The source can be a Prisma ORM 7 schema, a TypeScript contract, or a PSL contract. Use it to move from a Prisma ORM 7 `schema.prisma`, read through [`prisma7Schema`](https://www.prisma.io/docs/cli/configuration#use-a-prisma-orm-7-schema), to a contract file written for Prisma ORM 8. The command is offline. It does not need a database connection. ## Usage [#usage] #### npm ```bash npx prisma contract print [--output ] ``` #### pnpm ```bash pnpm prisma contract print [--output ] ``` #### yarn ```bash yarn prisma contract print [--output ] ``` #### bun ```bash bunx prisma contract print [--output ] ``` ## Options [#options] | Option | What it does | | ----------------- | ---------------------------------------------------------------------------------------------------------- | | `--output ` | Writes the PSL to this file. Without it, the command writes the PSL to standard output and writes no file. | | `--config ` | Read this config file instead of `./prisma.config.ts`. | | `--json` | Prints a machine-readable result, with the PSL in `psl.text`. | ## Examples [#examples] #### npm ```bash npx prisma contract print npx prisma contract print --output ./src/prisma/contract.prisma npx prisma contract print --json ``` #### pnpm ```bash pnpm prisma contract print pnpm prisma contract print --output ./src/prisma/contract.prisma pnpm prisma contract print --json ``` #### yarn ```bash yarn prisma contract print yarn prisma contract print --output ./src/prisma/contract.prisma yarn prisma contract print --json ``` #### bun ```bash bunx prisma contract print bunx prisma contract print --output ./src/prisma/contract.prisma bunx prisma contract print --json ``` Without `--output`, standard output gets only the PSL, while the status line goes to standard error. So you can redirect or pipe it: ```bash npx prisma contract print > contract.v8.prisma ``` The PSL is printed as it is, not as data lines, so tabs and line breaks in it are not escaped. With `--output`, standard output gets nothing. [Global flags](https://www.prisma.io/docs/cli/global-flags#data-lines-of-prisma-orm-commands) lists the data lines of the other commands. ## What it writes [#what-it-writes] The file starts with `// use prisma-8`, the first line `contract emit` looks for in a `.prisma` file. When you point `contract` at the file and run `contract emit`, you get the same contract as before, with the same hashes, so the database needs no migration and no new `db sign`. A value that Prisma ORM generates in your application, rather than in the database, is written with `@onCreate(...)` and `@onUpdate(...)` after the field's type. `@onCreate` sets the value when a row is created, and `@onUpdate` sets it again on every update. So a Prisma ORM 7 `@default(uuid())` prints as `@onCreate(uuid())`, and an `@updatedAt` field prints as, for example, `DateTime(storage: timestamp) @onCreate(now()) @onUpdate(now())`. A Prisma ORM 7 `@default(now())` prints as `@default(now()) @onCreate(now())`, because the Prisma ORM 7 client also filled it on create. In a Prisma ORM 8 schema you write these attributes too: `contract emit` refuses `@default(uuid())` and points you to `@onCreate(uuid())`. `@default(now())` and `@default(autoincrement())` still work, because the database fills those values. A date, time, or bytes default prints with the name of its type in front of the value, and the value in backticks, such as ``@default(timestamptz`2024-01-01T00:00:00Z`)``. A column whose database type has no Prisma ORM 8 field type prints as ``Raw(sql`...`)``, which declares the column by the database's name for its type, such as ``Raw(sql`ltree`)``. A Prisma ORM 7 schema with an `Unsupported(...)` field cannot be printed yet. Prisma ORM 8 reads such a field as a column with no field on the model, so your code cannot read or write it. A `Raw(...)` field is different: it is a field on the model, and your code reads and writes its value. Prisma ORM 8 PSL has no way to declare a column without a field, so keep the Prisma ORM 7 schema as the contract source until it does. An `@ignore` field or an `@@ignore` model stops the command the same way, with `CONTRACT.PRINT_UNSUPPORTED`, because its column or table stays in the contract with no field or model. Removing `@ignore` or `@@ignore` from the Prisma ORM 7 schema changes no table, so it plans no migration, but the field or model then appears in the client. After that, the schema prints. When a part of the contract has no PSL form, the command names that part, fails, and writes nothing. It also refuses an `--output` path that is one of the files it reads, `prisma.config.ts`, or a file `contract emit` writes. A warning in the contract source, such as `PSL_DEPRECATED_SCALAR_NAME`, does not stop the command. It is reported as a diagnostic whose `severity` is `warn`. In `--json` output, the warning is an entry of the result's `diagnostics`, with `code` set to `CONTRACT.SOURCE_DIAGNOSTIC` and the warning's own code in `meta.code`. ## Next steps [#next-steps] - Set `contract` in `prisma.config.ts` to the file you wrote, as [Configuration](https://www.prisma.io/docs/cli/configuration) shows. - Run [`contract emit`](https://www.prisma.io/docs/cli/contract-emit) to write `contract.json` and `contract.d.ts` from it. ## 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 ORM CLI commands with prisma.config.ts and global flags. - [contract emit](https://www.prisma.io/docs/cli/contract-emit): Emit Prisma ORM contract artifacts.