Add Prisma to an existing project Copy promptAdd 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. Prisma 8 with your own PostgreSQL database Quickstart View Copy promptPrisma 8 with your own PostgreSQL database Copy promptCreate a new [framework] application with Prisma 8 against my existing PostgreSQL database.
If I have not given you a connection string, stop and ask; do not invent one. Valid --template values: next, hono, nuxt, astro, nest, svelte, tanstack-start, elysia.
1. Scaffold: `npx create-prisma@latest create my-app --template [framework] --provider postgres --yes`.
2. Export my connection string as `DATABASE_URL` in the shell; the generated scripts read the environment variable, not `.env`. From the project directory: `npm run db:init`, then start `npm run dev` in the background and verify the sample query returns data. Sample users are seeded automatically on the app's first query; there is no separate seed script.
3. Evolve the starter contract under `src/prisma/` into my schema, then run `npm run contract:emit`, `npx prisma@latest migration plan`, and `npx prisma@latest db migrate --yes`.
Do not provision any hosted database. Use the installed Prisma 8 skills and https://www.prisma.io/docs/llms.txt for current docs. Prisma ORM only (Prisma 7) Quickstart View Copy promptPrisma ORM only (Prisma 7) Copy promptAdd Prisma ORM 7 to this project with my existing database.
If I have not given you a database connection string and none exists in the project, stop and ask.
1. Run `npx prisma@7.10.0 init` (Prisma 7). For an existing database, set DATABASE_URL in `.env` and introspect it with `npx prisma db pull`; for a new schema, define models in `prisma/schema.prisma` and run `npx prisma migrate dev --name init`. If migrate dev asks to reset the database, stop and ask me first.
2. Install the driver adapter for the database (Prisma 7 requires one), e.g. `npm install @prisma/adapter-pg` for PostgreSQL, and pass it to `new PrismaClient({ adapter })`. Generate the client with `npx prisma generate` and write one query in an existing code path.
3. Run the query (e.g. with `npx tsx`) and show me the output, the schema, and the query you added.
Current docs: https://www.prisma.io/docs/orm/v7.md and https://www.prisma.io/docs/llms.txt. Prisma Postgres only Copy promptCreate a Prisma Postgres database for this project.
1. Run `npx create-db@latest`. It creates a temporary Prisma Postgres database without an account and prints a connection string plus a claim URL.
2. Put the connection string in `.env` as DATABASE_URL and wire it into whichever of Prisma ORM, Kysely, Drizzle, TypeORM, or node-postgres the project already uses (detect it from package.json; if none, ask me). Verify the connection with one trivial query such as `select 1`.
3. Remind me to open the claim URL to keep the database in my Prisma workspace.
Current docs: https://www.prisma.io/docs/postgres.md. Prisma Compute only Copy promptDeploy this app to Prisma Compute using `npx prisma@latest`.
Compute runs apps declared with Prisma Composer: your server code plus a small TypeScript declaration. Port the app following https://www.prisma.io/docs/composer/porting-an-app.md. SvelteKit and Deno are not supported yet; if the app is one of those, stop and tell me.
1. Install `@prisma/composer` and `@prisma/composer-prisma-cloud`, and pin `effect` in package.json to the exact version in `node_modules/@prisma/composer/package.json` (`"overrides": { "effect": "<that version>" }`). Then install the Composer skill with `npx prisma@latest skills sync`, and use it.
2. Declare the app: a `service.ts` with `compute({ name, deps, build })`, a `module.ts` that provisions it, and a `prisma-composer.config.ts`. Read the port from `service.port()` and bind 0.0.0.0. Replace other `process.env` reads with the service input schema, binding credentials like DATABASE_URL with `envSecret`. Composer does not build: produce one self-contained entry file per service (for example `esbuild <server> --bundle --platform=node --format=esm --outfile=dist/server.mjs`), or use the framework build adapter (Next.js needs the `nextjs` adapter and `output: "standalone"`).
3. Verify locally: run the build, then `npx prisma@latest dev module.ts`, and curl the printed local URL.
4. Confirm I am signed in with `npx prisma@latest auth whoami`; if not, stop and ask me to run `npx prisma@latest auth login` (it opens a browser).
5. Deploy: run the build, then `npx prisma@latest deploy module.ts` with the app's env values (like DATABASE_URL) exported in the shell; the first deploy copies input values up to the deployment. Verify the printed public URL with curl.
Current docs: https://www.prisma.io/docs/composer/porting-an-app.md and https://www.prisma.io/docs/prisma-compute/deploy.md. If you're using MongoDB, follow the MongoDB quickstart or add Prisma 8 to an existing MongoDB app . If you work with Kysely , Drizzle , or TypeORM , follow the Prisma Postgres quickstart for that tool.