Prisma 8 is here.Read the docs

Choose a Prisma 8 setup path

Choose the fastest path to try Prisma 8 in a new or existing project.

Start with a quickstart if you want Prisma 8 to create the app. Use the existing-project path if you already have an app and database.

Start a new project

bunx create-prisma@latest

The create-prisma reference lists every template and flag.

Use with your agent
Use with your agent
Create a new [framework] application with Prisma 8, seed it, and run it locally.

If I have not told you which framework, stop and ask before scaffolding. Valid --template values: next, hono, nuxt, astro, nest, svelte, tanstack-start, elysia.

1. Scaffold the app: `npx create-prisma@latest create my-app --template [framework] --provider postgres --yes`.
2. Get a database connection string: use the one I give you, or create a Prisma Postgres database with `npx create-db@latest` and show me the claim URL it prints. Export it as `DATABASE_URL` in the shell; the generated scripts read the environment variable, not `.env`.
3. From the project directory, apply the starter contract: `npm run db:init`. Sample users are seeded automatically on the app's first query; there is no separate seed script.
4. Edit the starter contract under `src/prisma/` into a small schema for my use case, then run `npm run contract:emit` and plan and apply the migration: `npx prisma@latest migration plan`, then `npx prisma@latest db migrate --yes`. Migration planning diffs the emitted contract, so the emit step is required.
5. Update the seed script under `src/prisma/` and the app routes to query the new schema, start `npm run dev` in the background (with `DATABASE_URL` exported), and verify with a request against the running app. For the `nest` template, if routes return 500s with `reading 'findAll'` in the logs, add explicit `@Inject()` tokens as shown in https://www.prisma.io/docs/guides/frameworks/nestjs.md.

Use the installed Prisma 8 skills and the current Prisma docs: https://www.prisma.io/docs/llms.txt (append `.md` to any docs URL for a markdown version).

Add to an existing project

bunx prisma@latest orm init
Use with your agent
Use with your agent
Add Prisma 8 to this existing project.

This flow is for PostgreSQL. If the project uses MongoDB, follow https://www.prisma.io/docs/prisma-orm/add-to-existing-project/mongodb.md instead; for other databases, stop and tell me.

1. Run `npx prisma@latest orm init --yes --target postgres --authoring psl` (the flags are required when the CLI cannot prompt). It writes `prisma.config.ts`, a starter contract and `db.ts` under `src/prisma/`, and installs dependencies. Then run `npx prisma@latest skills sync` to install the Prisma 8 skills; `orm init` may end with `CLI.INIT_SKILL_INSTALL_FAILED`, which the sync repairs.
2. Set `DATABASE_URL` in `.env` to my database. If I did not give you one, create a Prisma Postgres database with `npx create-db@latest`, put its connection string in `.env`, and show me the claim URL it prints so I can keep the database.
3. If the database already has tables, infer the contract from it: `npx prisma@latest contract infer`, then `npx prisma@latest contract emit`, then sign it with `npx prisma@latest db sign`. If the database is empty, keep the starter contract and run `npx prisma@latest db init`.
4. Write one query with the generated `db` client in an existing code path, run it, and show me the returned rows.

Follow https://www.prisma.io/docs/prisma-orm/add-to-existing-project/postgresql.md and the installed Prisma 8 skills.

After setup

  • Use the generated app scripts for the first run.
  • Open prisma-next.md or the installed Prisma 8 skills when you want agent-ready guidance inside the project.
  • Change the starter contract when you are ready to model your own data.
  • Open the Prisma 8 overview when you want the concepts behind the setup.

On this page