From cab208fbf6c752ddb958e3c5f6916b3bef35ec78 Mon Sep 17 00:00:00 2001 From: Aidan McAlister Date: Wed, 18 Feb 2026 12:53:34 -0500 Subject: [PATCH] fix(docs): updated many `bash` codeblocks to `npm` to make use of the package manager selector --- .../(index)/prisma-postgres/from-the-cli.mdx | 2 +- .../quickstart/drizzle-orm.mdx | 2 +- .../prisma-postgres/quickstart/kysely.mdx | 2 +- .../prisma-postgres/quickstart/typeorm.mdx | 4 ++-- .../docs.v6/ai/tutorials/linktree-clone.mdx | 2 +- .../docs.v6/guides/betterauth-astro.mdx | 2 +- .../content/docs.v6/guides/clerk-astro.mdx | 4 ++-- .../content/docs.v6/guides/clerk-nextjs.mdx | 2 +- .../content/docs.v6/guides/cloudflare-d1.mdx | 10 ++++----- .../docs.v6/guides/cloudflare-workers.mdx | 2 +- apps/docs/content/docs.v6/guides/data-dog.mdx | 4 ++-- apps/docs/content/docs.v6/guides/docker.mdx | 2 +- .../content/docs.v6/guides/github-actions.mdx | 4 ++-- apps/docs/content/docs.v6/guides/hono.mdx | 2 +- .../docs.v6/guides/management-api-basic.mdx | 2 +- .../docs.v6/guides/migrate-from-typeorm.mdx | 2 +- apps/docs/content/docs.v6/guides/nuxt.mdx | 2 +- .../guides/permit-io-access-control.mdx | 2 +- .../content/docs.v6/guides/solid-start.mdx | 4 ++-- .../docs/content/docs.v6/guides/sveltekit.mdx | 2 +- .../content/docs.v6/guides/tanstack-start.mdx | 2 +- .../docs/content/docs.v6/guides/turborepo.mdx | 2 +- .../orm/more/upgrades/older-versions.mdx | 10 ++++----- .../docs.v6/orm/more/upgrades/to-v7.mdx | 4 ++-- .../orm/overview/databases/cloudflare-d1.mdx | 4 ++-- .../overview/databases/database-drivers.mdx | 2 +- .../deployment/edge/deploy-to-cloudflare.mdx | 14 ++++++------ .../deployment/edge/deploy-to-deno-deploy.mdx | 2 +- .../deployment/edge/deploy-to-vercel.mdx | 6 ++--- .../serverless/deploy-to-vercel.mdx | 2 +- .../orm/reference/prisma-config-reference.mdx | 4 ++-- .../platform/platform-cli/commands.mdx | 22 +++++++++---------- .../docs.v6/postgres/integrations/netlify.mdx | 2 +- .../docs/ai/tutorials/typefully-clone.mdx | 4 ++-- .../docs/guides/deployment/cloudflare-d1.mdx | 8 +++---- .../content/docs/guides/making-guides.mdx | 8 +++---- .../switch-to-prisma-orm/from-sql-orms.mdx | 2 +- .../supported-databases/mysql.mdx | 2 +- apps/docs/content/docs/orm/index.mdx | 4 ++-- .../orm/reference/prisma-cli-reference.mdx | 2 +- .../orm/reference/prisma-config-reference.mdx | 4 ++-- .../postgres/database/local-development.mdx | 6 ++--- .../content/docs/studio/getting-started.mdx | 4 ++-- apps/docs/content/docs/studio/index.mdx | 2 +- 44 files changed, 90 insertions(+), 90 deletions(-) diff --git a/apps/docs/content/docs.v6/(index)/prisma-postgres/from-the-cli.mdx b/apps/docs/content/docs.v6/(index)/prisma-postgres/from-the-cli.mdx index e9488cf5d1..e41d7b961b 100644 --- a/apps/docs/content/docs.v6/(index)/prisma-postgres/from-the-cli.mdx +++ b/apps/docs/content/docs.v6/(index)/prisma-postgres/from-the-cli.mdx @@ -114,7 +114,7 @@ Now that your project is in the correct location, continue with the setup. Initialize a TypeScript project and add the Prisma CLI as a development dependency: -```bash +```npm npm init -y ``` diff --git a/apps/docs/content/docs.v6/(index)/prisma-postgres/quickstart/drizzle-orm.mdx b/apps/docs/content/docs.v6/(index)/prisma-postgres/quickstart/drizzle-orm.mdx index 89075c2d4e..a287d1d374 100644 --- a/apps/docs/content/docs.v6/(index)/prisma-postgres/quickstart/drizzle-orm.mdx +++ b/apps/docs/content/docs.v6/(index)/prisma-postgres/quickstart/drizzle-orm.mdx @@ -17,7 +17,7 @@ metaDescription: Get started with Drizzle ORM and Prisma Postgres. Create a new directory for your project and initialize it with npm: -```bash +```npm mkdir drizzle-quickstart cd drizzle-quickstart npm init -y diff --git a/apps/docs/content/docs.v6/(index)/prisma-postgres/quickstart/kysely.mdx b/apps/docs/content/docs.v6/(index)/prisma-postgres/quickstart/kysely.mdx index daf36576d9..3c5d823d83 100644 --- a/apps/docs/content/docs.v6/(index)/prisma-postgres/quickstart/kysely.mdx +++ b/apps/docs/content/docs.v6/(index)/prisma-postgres/quickstart/kysely.mdx @@ -18,7 +18,7 @@ metaDescription: Get started with Kysely and Prisma Postgres by creating a type- Create a new directory for your project and initialize it with npm: -```bash +```npm mkdir kysely-quickstart cd kysely-quickstart npm init -y diff --git a/apps/docs/content/docs.v6/(index)/prisma-postgres/quickstart/typeorm.mdx b/apps/docs/content/docs.v6/(index)/prisma-postgres/quickstart/typeorm.mdx index 3ef0d3188c..f50090212c 100644 --- a/apps/docs/content/docs.v6/(index)/prisma-postgres/quickstart/typeorm.mdx +++ b/apps/docs/content/docs.v6/(index)/prisma-postgres/quickstart/typeorm.mdx @@ -41,7 +41,7 @@ typeorm-quickstart Navigate to the project directory and install dependencies: -```bash +```npm cd typeorm-quickstart npm install ``` @@ -158,7 +158,7 @@ export const AppDataSource = new DataSource({ Start the application: -```bash +```npm npm start ``` diff --git a/apps/docs/content/docs.v6/ai/tutorials/linktree-clone.mdx b/apps/docs/content/docs.v6/ai/tutorials/linktree-clone.mdx index ede9c4dcf1..2bf2adaad6 100644 --- a/apps/docs/content/docs.v6/ai/tutorials/linktree-clone.mdx +++ b/apps/docs/content/docs.v6/ai/tutorials/linktree-clone.mdx @@ -178,7 +178,7 @@ The `--force-reset` flag deletes all existing data. This is fine during prototyp Open Prisma Studio to verify the new schema is applied: -```bash +```npm npm run db:studio ``` diff --git a/apps/docs/content/docs.v6/guides/betterauth-astro.mdx b/apps/docs/content/docs.v6/guides/betterauth-astro.mdx index a43f0e80e7..6fc595c612 100644 --- a/apps/docs/content/docs.v6/guides/betterauth-astro.mdx +++ b/apps/docs/content/docs.v6/guides/betterauth-astro.mdx @@ -22,7 +22,7 @@ In this guide, you'll wire Better Auth into a brand-new [Astro](https://astro.bu Create a new Astro project: -```bash +```npm npm create astro@latest betterauth-astro-prisma ``` diff --git a/apps/docs/content/docs.v6/guides/clerk-astro.mdx b/apps/docs/content/docs.v6/guides/clerk-astro.mdx index 9772dc97fe..dacf05fff6 100644 --- a/apps/docs/content/docs.v6/guides/clerk-astro.mdx +++ b/apps/docs/content/docs.v6/guides/clerk-astro.mdx @@ -23,7 +23,7 @@ In this guide you'll wire Clerk into a brand-new [Astro](https://astro.build/) a Create a new Astro project: -```bash +```npm npm create astro@latest ``` @@ -408,7 +408,7 @@ npm run dev In a separate terminal window, install ngrok globally and expose your local app: -```bash +```npm npm install --global ngrok ngrok http 4321 ``` diff --git a/apps/docs/content/docs.v6/guides/clerk-nextjs.mdx b/apps/docs/content/docs.v6/guides/clerk-nextjs.mdx index 680e0b2380..bb3fbfbfcd 100644 --- a/apps/docs/content/docs.v6/guides/clerk-nextjs.mdx +++ b/apps/docs/content/docs.v6/guides/clerk-nextjs.mdx @@ -474,7 +474,7 @@ You'll need to expose your local app for webhooks with [ngrok](https://ngrok.com Install ngrok and expose your local app: -```bash +```npm npm install --global ngrok ngrok http 3000 ``` diff --git a/apps/docs/content/docs.v6/guides/cloudflare-d1.mdx b/apps/docs/content/docs.v6/guides/cloudflare-d1.mdx index 738ed4450c..cc3ebaa431 100644 --- a/apps/docs/content/docs.v6/guides/cloudflare-d1.mdx +++ b/apps/docs/content/docs.v6/guides/cloudflare-d1.mdx @@ -24,7 +24,7 @@ Before starting this guide, make sure you have: Run the following command to create a [new Cloudflare Worker project](https://developers.cloudflare.com/d1/get-started/#1-create-a-worker): -```bash +```npm npm create cloudflare@latest d1-tutorial -- --type=hello-world --ts=true --git=true --deploy=false ``` @@ -176,7 +176,7 @@ mkdir -p prisma/migrations Now use `prisma migrate diff` to generate the SQL needed to create your database schema: -```bash +```npm npx prisma migrate diff \ --from-empty \ --to-schema prisma/schema.prisma \ @@ -189,7 +189,7 @@ This command generates a SQL file that contains the statements needed to create Now apply the migration to both your local and remote D1 databases using Wrangler: -```bash +```npm # Apply to local database npx wrangler d1 execute __YOUR_D1_DATABASE_NAME__ --local --title="./prisma/migrations/0001_init.sql" @@ -207,7 +207,7 @@ Replace `__YOUR_D1_DATABASE_NAME__` with the actual name of your D1 database tha Let's create some dummy data that we can query once the Worker is running: -```bash +```npm # For the local database npx wrangler d1 execute __YOUR_D1_DATABASE_NAME__ --command "INSERT INTO \"User\" (\"email\", \"name\") VALUES ('jane@prisma.io', 'Jane Doe (Local)');" --local @@ -219,7 +219,7 @@ npx wrangler d1 execute __YOUR_D1_DATABASE_NAME__ --command "INSERT INTO \"User\ For future schema changes, you can generate new migration files using: -```bash +```npm npx prisma migrate diff \ --from-local-d1 \ --to-schema prisma/schema.prisma \ diff --git a/apps/docs/content/docs.v6/guides/cloudflare-workers.mdx b/apps/docs/content/docs.v6/guides/cloudflare-workers.mdx index b9e22c4c63..4406621107 100644 --- a/apps/docs/content/docs.v6/guides/cloudflare-workers.mdx +++ b/apps/docs/content/docs.v6/guides/cloudflare-workers.mdx @@ -22,7 +22,7 @@ In this guide, you'll learn to integrate Prisma ORM with a Prisma Postgres datab Create a new Cloudflare Workers project: -```bash +```npm npm create cloudflare@latest prisma-cloudflare-worker -- --type=hello-world --ts=true --git=true --deploy=false ``` diff --git a/apps/docs/content/docs.v6/guides/data-dog.mdx b/apps/docs/content/docs.v6/guides/data-dog.mdx index 829a1a42d3..cc2cfcf721 100644 --- a/apps/docs/content/docs.v6/guides/data-dog.mdx +++ b/apps/docs/content/docs.v6/guides/data-dog.mdx @@ -46,7 +46,7 @@ We will start by creating a new Node.js project to demonstrate tracing with Data If you're integrating tracing into an existing Prisma project, you can skip this step and directly follow from [the setup tracing section](#4-set-up-datadog-tracing). Just make sure you apply the changes in your project's equivalent folder structure. -```bash +```npm mkdir prisma-datadog-tracing cd prisma-datadog-tracing npm init -y @@ -191,7 +191,7 @@ This creates the tables according to your schema in the Postgres database and ge In addition to Prisma, you will need the following packages for Datadog tracing: -```bash +```npm npm install @prisma/instrumentation \ dd-trace ``` diff --git a/apps/docs/content/docs.v6/guides/docker.mdx b/apps/docs/content/docs.v6/guides/docker.mdx index cf33b9326d..a543333ed1 100644 --- a/apps/docs/content/docs.v6/guides/docker.mdx +++ b/apps/docs/content/docs.v6/guides/docker.mdx @@ -59,7 +59,7 @@ Let's start by creating a simple Node.js application with Prisma ORM and [Expres First, create a new project directory and initialize a Node.js project: -```bash +```npm mkdir docker-test cd docker-test npm init -y diff --git a/apps/docs/content/docs.v6/guides/github-actions.mdx b/apps/docs/content/docs.v6/guides/github-actions.mdx index ec5876008e..c7cc36374a 100644 --- a/apps/docs/content/docs.v6/guides/github-actions.mdx +++ b/apps/docs/content/docs.v6/guides/github-actions.mdx @@ -27,7 +27,7 @@ Make sure you have the following: Initialize your project: -```bash +```npm mkdir prisma-gha-demo && cd prisma-gha-demo npm init -y ``` @@ -222,7 +222,7 @@ Update your `package.json`: Then run: -```bash +```npm npm run seed npx prisma studio ``` diff --git a/apps/docs/content/docs.v6/guides/hono.mdx b/apps/docs/content/docs.v6/guides/hono.mdx index d6c1e07afd..0a889cbf60 100644 --- a/apps/docs/content/docs.v6/guides/hono.mdx +++ b/apps/docs/content/docs.v6/guides/hono.mdx @@ -21,7 +21,7 @@ In this guide, you'll learn to integrate Prisma ORM with a Prisma Postgres datab Create a new Hono project: -```bash +```npm npm create hono@latest ``` diff --git a/apps/docs/content/docs.v6/guides/management-api-basic.mdx b/apps/docs/content/docs.v6/guides/management-api-basic.mdx index cc22f6e9e8..a182ed66cf 100644 --- a/apps/docs/content/docs.v6/guides/management-api-basic.mdx +++ b/apps/docs/content/docs.v6/guides/management-api-basic.mdx @@ -44,7 +44,7 @@ cd management-api-demo Next, initialize npm and install dependencies required for using TypeScript: -```bash +```npm npm init -y npm install tsx typescript @types/node --save-dev touch index.ts diff --git a/apps/docs/content/docs.v6/guides/migrate-from-typeorm.mdx b/apps/docs/content/docs.v6/guides/migrate-from-typeorm.mdx index 18e3d8d74e..799457f4fe 100644 --- a/apps/docs/content/docs.v6/guides/migrate-from-typeorm.mdx +++ b/apps/docs/content/docs.v6/guides/migrate-from-typeorm.mdx @@ -199,7 +199,7 @@ export class CreateUserAction { Test all migrated endpoints to ensure they work as expected: -```bash +```npm npm test ``` diff --git a/apps/docs/content/docs.v6/guides/nuxt.mdx b/apps/docs/content/docs.v6/guides/nuxt.mdx index d3469bdfbf..aa76009321 100644 --- a/apps/docs/content/docs.v6/guides/nuxt.mdx +++ b/apps/docs/content/docs.v6/guides/nuxt.mdx @@ -18,7 +18,7 @@ This guide shows you how to set up Prisma ORM in a Nuxt application with [Prisma Create a new Nuxt project and install dependencies: -```bash +```npm npx nuxi@latest init hello-prisma cd hello-prisma npm install @prisma/client @prisma/adapter-pg pg diff --git a/apps/docs/content/docs.v6/guides/permit-io-access-control.mdx b/apps/docs/content/docs.v6/guides/permit-io-access-control.mdx index 3660545dfc..ca88108aba 100644 --- a/apps/docs/content/docs.v6/guides/permit-io-access-control.mdx +++ b/apps/docs/content/docs.v6/guides/permit-io-access-control.mdx @@ -35,7 +35,7 @@ You'll also install the tools needed to support ReBAC filtering with Permit.io. ### 1.1 Create the project folder -```bash +```npm mkdir prisma-rebac-filtering cd prisma-rebac-filtering npm init -y diff --git a/apps/docs/content/docs.v6/guides/solid-start.mdx b/apps/docs/content/docs.v6/guides/solid-start.mdx index a0257bac15..881e624d81 100644 --- a/apps/docs/content/docs.v6/guides/solid-start.mdx +++ b/apps/docs/content/docs.v6/guides/solid-start.mdx @@ -21,7 +21,7 @@ In this guide, you'll learn how to integrate Prisma ORM with a Prisma Postgres d Begin by creating a new SolidStart app. In your terminal, run: -```bash +```npm npm init solid@latest ``` @@ -38,7 +38,7 @@ Use the following options when prompted: Next, navigate into your new project, install dependencies, and start the development server: -```bash +```npm cd my-solid-prisma-app npm install npm run dev diff --git a/apps/docs/content/docs.v6/guides/sveltekit.mdx b/apps/docs/content/docs.v6/guides/sveltekit.mdx index 6a3e01b1f0..4ab588298e 100644 --- a/apps/docs/content/docs.v6/guides/sveltekit.mdx +++ b/apps/docs/content/docs.v6/guides/sveltekit.mdx @@ -43,7 +43,7 @@ It will prompt you to customize your setup. Here are the options you'll choose: Once the setup completes, navigate into your project and start the development server: -```bash +```npm cd sveltekit-prisma npm run dev ``` diff --git a/apps/docs/content/docs.v6/guides/tanstack-start.mdx b/apps/docs/content/docs.v6/guides/tanstack-start.mdx index bdaf2f9aeb..879bd510b9 100644 --- a/apps/docs/content/docs.v6/guides/tanstack-start.mdx +++ b/apps/docs/content/docs.v6/guides/tanstack-start.mdx @@ -21,7 +21,7 @@ This guide will walk you through integrating Prisma ORM with a Prisma Postgres d To begin, create a new TanStack Start project. -```bash +```npm npm create @tanstack/start@latest ``` diff --git a/apps/docs/content/docs.v6/guides/turborepo.mdx b/apps/docs/content/docs.v6/guides/turborepo.mdx index 1f0c9557f9..c970d2a5e3 100644 --- a/apps/docs/content/docs.v6/guides/turborepo.mdx +++ b/apps/docs/content/docs.v6/guides/turborepo.mdx @@ -375,7 +375,7 @@ The `turborepo-prisma` project should have an app called `web` at `apps/web`. Ad Run your package manager's install command inside the `apps/web` directory: -```bash tab="npm" +```npm tab="npm" cd apps/web npm install ``` diff --git a/apps/docs/content/docs.v6/orm/more/upgrades/older-versions.mdx b/apps/docs/content/docs.v6/orm/more/upgrades/older-versions.mdx index 711b7d89c5..f7f0369990 100644 --- a/apps/docs/content/docs.v6/orm/more/upgrades/older-versions.mdx +++ b/apps/docs/content/docs.v6/orm/more/upgrades/older-versions.mdx @@ -23,7 +23,7 @@ Prisma ORM v6 introduced breaking changes related to Node.js versions, TypeScrip ### Upgrade command -```bash +```npm npm install prisma@6 @prisma/client@6 ``` @@ -75,7 +75,7 @@ prisma.user.findMany({ ### Upgrade command -```bash +```npm npm install prisma@5 @prisma/client@5 ``` @@ -110,7 +110,7 @@ prisma.log.findMany({ ### Upgrade command -```bash +```npm npm install prisma@4 @prisma/client@4 ``` @@ -147,7 +147,7 @@ After upgrading, run `npx prisma db pull` to sync constraint names, or run `npx ### Upgrade command -```bash +```npm npm install prisma@3 @prisma/client@3 ``` @@ -157,7 +157,7 @@ npm install prisma@3 @prisma/client@3 The `@prisma/codemods` package helps automate code changes when upgrading: -```bash +```npm npx @prisma/codemods ``` diff --git a/apps/docs/content/docs.v6/orm/more/upgrades/to-v7.mdx b/apps/docs/content/docs.v6/orm/more/upgrades/to-v7.mdx index e4479d6470..a987265a32 100644 --- a/apps/docs/content/docs.v6/orm/more/upgrades/to-v7.mdx +++ b/apps/docs/content/docs.v6/orm/more/upgrades/to-v7.mdx @@ -21,7 +21,7 @@ If you are using MongoDB, please note that Prisma ORM v7 does not yet support Mo To upgrade to Prisma ORM v7 from an earlier version, you need to update both the `prisma` and `@prisma/client` packages: -```bash tab="npm" +```npm tab="npm" npm install @prisma/client@7 npm install -D prisma@7 ``` @@ -252,7 +252,7 @@ For more details, see [GitHub issue #28795](https://github.com/prisma/prisma/iss In Prisma ORM 7.0.0, environment variables are not loaded by default. Instead developers need to explicitly load the variables when calling the `prisma` CLI. Libraries like [`dotenv`](https://github.com/motdotla/dotenv) can be used to manage loading environment variables by reading the appropriate `.env` file. -```bash tab="npm" +```npm tab="npm" npm install dotenv ``` diff --git a/apps/docs/content/docs.v6/orm/overview/databases/cloudflare-d1.mdx b/apps/docs/content/docs.v6/orm/overview/databases/cloudflare-d1.mdx index b1ef35ad4e..ff09fba871 100644 --- a/apps/docs/content/docs.v6/orm/overview/databases/cloudflare-d1.mdx +++ b/apps/docs/content/docs.v6/orm/overview/databases/cloudflare-d1.mdx @@ -95,7 +95,7 @@ To generate the initial SQL statement, you can use the `prisma migrate diff` com For the initial migration, you can use the special `--from-empty` option though: -```bash +```npm npx prisma migrate diff \ --from-empty \ --to-schema ./prisma/schema.prisma \ @@ -186,7 +186,7 @@ As before, you now need to put a SQL statement into the currently empty `0002_cr As explained above, you now need to use `--from-local-d1` instead of `--from-empty` to specify a source schema: -```bash +```npm npx prisma migrate diff \ --from-local-d1 \ --to-schema ./prisma/schema.prisma \ diff --git a/apps/docs/content/docs.v6/orm/overview/databases/database-drivers.mdx b/apps/docs/content/docs.v6/orm/overview/databases/database-drivers.mdx index a8cc5498d1..a7039e0523 100644 --- a/apps/docs/content/docs.v6/orm/overview/databases/database-drivers.mdx +++ b/apps/docs/content/docs.v6/orm/overview/databases/database-drivers.mdx @@ -188,7 +188,7 @@ const client = new PrismaClient(); Alternatively, you can use a linked dependency for cleaner imports. -```bash tab="npm" +```npm tab="npm" npm add db@./generated/prisma ``` diff --git a/apps/docs/content/docs.v6/orm/prisma-client/deployment/edge/deploy-to-cloudflare.mdx b/apps/docs/content/docs.v6/orm/prisma-client/deployment/edge/deploy-to-cloudflare.mdx index 5a02fc2c64..b8ab83fb0e 100644 --- a/apps/docs/content/docs.v6/orm/prisma-client/deployment/edge/deploy-to-cloudflare.mdx +++ b/apps/docs/content/docs.v6/orm/prisma-client/deployment/edge/deploy-to-cloudflare.mdx @@ -233,7 +233,7 @@ As a prerequisite for the following section, you need to have a Cloudflare Worke If you don't have that yet, you can run these commands: -```bash +```npm npm create cloudflare@latest prisma-cloudflare-worker-example -- --type hello-world cd prisma-cloudflare-worker-example npm install prisma --save-dev && npm install @prisma/client @@ -315,7 +315,7 @@ Add this script to your `package.json`: Now you can execute Prisma CLI commands as follows while ensuring that the command has access to the env vars in `.dev.vars`: -```bash +```npm npm run env -- npx prisma ``` @@ -345,7 +345,7 @@ For Cloudflare Pages, using `node_compat` is not officially supported. If you wa If you ran `npx prisma init` above, you need to migrate your database schema to create the `User` table that's defined in your Prisma schema (if you already have all the tables you need in your database, you can skip this step): -```bash +```npm npm run env -- npx prisma migrate dev --name init ``` @@ -483,7 +483,7 @@ Add this script to your `package.json`: Now you can execute Prisma CLI commands as follows while ensuring that the command has access to the env vars in `.dev.vars`: -```bash +```npm npm run env -- npx prisma ``` @@ -499,7 +499,7 @@ npm install @prisma/adapter-planetscale If you ran `npx prisma init` above, you need to migrate your database schema to create the `User` table that's defined in your Prisma schema (if you already have all the tables you need in your database, you can skip this step): -```bash +```npm npm run env -- npx prisma db push ``` @@ -624,7 +624,7 @@ Add this script to your `package.json`: Now you can execute Prisma CLI commands as follows while ensuring that the command has access to the env vars in `.dev.vars`: -```bash +```npm npm run env -- npx prisma ``` @@ -640,7 +640,7 @@ npm install @prisma/adapter-neon If you ran `npx prisma init` above, you need to migrate your database schema to create the `User` table that's defined in your Prisma schema (if you already have all the tables you need in your database, you can skip this step): -```bash +```npm npm run env -- npx prisma migrate dev --name init ``` diff --git a/apps/docs/content/docs.v6/orm/prisma-client/deployment/edge/deploy-to-deno-deploy.mdx b/apps/docs/content/docs.v6/orm/prisma-client/deployment/edge/deploy-to-deno-deploy.mdx index 7d14f433dc..96bcfc2f6d 100644 --- a/apps/docs/content/docs.v6/orm/prisma-client/deployment/edge/deploy-to-deno-deploy.mdx +++ b/apps/docs/content/docs.v6/orm/prisma-client/deployment/edge/deploy-to-deno-deploy.mdx @@ -51,7 +51,7 @@ To start, you create a directory for your project, and then use `deno run` to in To set up your application, open your terminal and navigate to a location of your choice. Then, run the following commands to set up your application: -```bash +```npm mkdir prisma-deno-deploy cd prisma-deno-deploy npx prisma@latest init --db diff --git a/apps/docs/content/docs.v6/orm/prisma-client/deployment/edge/deploy-to-vercel.mdx b/apps/docs/content/docs.v6/orm/prisma-client/deployment/edge/deploy-to-vercel.mdx index df9cfceef9..1d47948a0f 100644 --- a/apps/docs/content/docs.v6/orm/prisma-client/deployment/edge/deploy-to-vercel.mdx +++ b/apps/docs/content/docs.v6/orm/prisma-client/deployment/edge/deploy-to-vercel.mdx @@ -299,7 +299,7 @@ export async function GET(request: Request) { Run the app with the following command: -```bash +```npm npm run dev ``` @@ -432,7 +432,7 @@ export async function GET(request: Request) { Run the app with the following command: -```bash +```npm npm run dev ``` @@ -564,7 +564,7 @@ export async function GET(request: Request) { Run the app with the following command: -```bash +```npm npm run dev ``` diff --git a/apps/docs/content/docs.v6/orm/prisma-client/deployment/serverless/deploy-to-vercel.mdx b/apps/docs/content/docs.v6/orm/prisma-client/deployment/serverless/deploy-to-vercel.mdx index ef0ef36b3d..22dcdac62a 100644 --- a/apps/docs/content/docs.v6/orm/prisma-client/deployment/serverless/deploy-to-vercel.mdx +++ b/apps/docs/content/docs.v6/orm/prisma-client/deployment/serverless/deploy-to-vercel.mdx @@ -101,7 +101,7 @@ In that case, you could create a custom build command in your `package.json` (e. You can invoke this script inside your CI/CD pipeline using the following command: -```bash +```npm npm run vercel-build ``` diff --git a/apps/docs/content/docs.v6/orm/reference/prisma-config-reference.mdx b/apps/docs/content/docs.v6/orm/reference/prisma-config-reference.mdx index dc9c8c9185..757f4632bb 100644 --- a/apps/docs/content/docs.v6/orm/reference/prisma-config-reference.mdx +++ b/apps/docs/content/docs.v6/orm/reference/prisma-config-reference.mdx @@ -750,14 +750,14 @@ The `--bun` flag is required when using Bun to ensure Prisma runs with the Bun r Example run from the project root: -```bash +```npm npx prisma validate # → Works as expected ``` Run from a subdirectory (fails): -```bash +```npm cd src npx prisma validate # → Error: Could not find Prisma Schema... diff --git a/apps/docs/content/docs.v6/platform/platform-cli/commands.mdx b/apps/docs/content/docs.v6/platform/platform-cli/commands.mdx index d6bd2d3484..3a8abe72d8 100644 --- a/apps/docs/content/docs.v6/platform/platform-cli/commands.mdx +++ b/apps/docs/content/docs.v6/platform/platform-cli/commands.mdx @@ -67,7 +67,7 @@ npx prisma platform workspace show --early-access Lists all projects within the specified workspace. -```bash +```npm npx prisma platform project show \ --workspace $INSERT_WORKSPACE_ID \ --early-access @@ -83,7 +83,7 @@ npx prisma platform project show \ Creates a new project within the specified workspace. -```bash +```npm npx prisma platform project create \ --workspace $INSERT_WORKSPACE_ID \ --name "INSERT_PROJECT_NAME" \ @@ -101,7 +101,7 @@ npx prisma platform project create \ Deletes the specified project. -```bash +```npm npx prisma platform project delete \ --project $INSERT_PROJECT_ID \ --early-access @@ -121,7 +121,7 @@ npx prisma platform project delete \ Lists all environments within the specified project. -```bash +```npm npx prisma platform environment show \ --project $INSERT_PROJECT_ID \ --early-access @@ -137,7 +137,7 @@ npx prisma platform environment show \ Creates a new environment within the specified project. -```bash +```npm npx prisma platform environment create \ --project $INSERT_PROJECT_ID \ --name $INSERT_ENVIRONMENT_NAME \ @@ -155,7 +155,7 @@ npx prisma platform environment create \ Deletes the specified environment. -```bash +```npm npx prisma platform environment delete \ --environment $INSERT_ENVIRONMENT_ID \ --early-access @@ -175,7 +175,7 @@ npx prisma platform environment delete \ Lists all API keys for the specified environment. -```bash +```npm npx prisma platform apikey show \ --environment $INSERT_ENVIRONMENT_ID \ --early-access @@ -191,7 +191,7 @@ npx prisma platform apikey show \ Creates a new API key for the specified project. -```bash +```npm npx prisma platform apikey create \ --environment $INSERT_ENVIRONMENT_ID \ --name $INSERT_API_KEY_NAME \ @@ -209,7 +209,7 @@ npx prisma platform apikey create \ Deletes the specified API Key. -```bash +```npm npx prisma platform apikey delete \ --apikey $INSERT_API_KEY_ID \ --early-access @@ -229,7 +229,7 @@ npx prisma platform apikey delete \ Enables Prisma Accelerate for the specified environment. -```bash +```npm npx prisma platform accelerate enable \ --environment $INSERT_ENVIRONMENT_ID \ --url "postgresql://username:password@host:port/database" \ @@ -251,7 +251,7 @@ npx prisma platform accelerate enable \ Disables Prisma Accelerate for the specified environment. -```bash +```npm npx prisma platform accelerate disable \ --environment $INSERT_ENVIRONMENT_ID \ --early-access diff --git a/apps/docs/content/docs.v6/postgres/integrations/netlify.mdx b/apps/docs/content/docs.v6/postgres/integrations/netlify.mdx index 8fd31d65d6..0df31b41f2 100644 --- a/apps/docs/content/docs.v6/postgres/integrations/netlify.mdx +++ b/apps/docs/content/docs.v6/postgres/integrations/netlify.mdx @@ -199,7 +199,7 @@ export default async function Page() { With this code in place, you can now go ahead and run the app locally: -```bash +```npm npm run dev ``` diff --git a/apps/docs/content/docs/ai/tutorials/typefully-clone.mdx b/apps/docs/content/docs/ai/tutorials/typefully-clone.mdx index ed11b75c7f..dee5feee7a 100644 --- a/apps/docs/content/docs/ai/tutorials/typefully-clone.mdx +++ b/apps/docs/content/docs/ai/tutorials/typefully-clone.mdx @@ -118,7 +118,7 @@ Your local LLM is ready! Ollama runs as a background service, so you don't need Let's create a fresh Next.js application: -```bash +```npm npx create-next-app@latest tweetsmith ``` @@ -520,7 +520,7 @@ The following command is **interactive** and requires your input. Run it in your ::: -```bash +```npm npx prisma init --db --output ../app/generated/prisma ``` diff --git a/apps/docs/content/docs/guides/deployment/cloudflare-d1.mdx b/apps/docs/content/docs/guides/deployment/cloudflare-d1.mdx index e7550a76b6..5f8093d3c3 100644 --- a/apps/docs/content/docs/guides/deployment/cloudflare-d1.mdx +++ b/apps/docs/content/docs/guides/deployment/cloudflare-d1.mdx @@ -176,7 +176,7 @@ mkdir -p prisma/migrations Now use `prisma migrate diff` to generate the SQL needed to create your database schema: -```bash +```npm npx prisma migrate diff \ --from-empty \ --to-schema prisma/schema.prisma \ @@ -189,7 +189,7 @@ This command generates a SQL file that contains the statements needed to create Now apply the migration to both your local and remote D1 databases using Wrangler: -```bash +```npm # Apply to local database npx wrangler d1 execute __YOUR_D1_DATABASE_NAME__ --local --title="./prisma/migrations/0001_init.sql" @@ -207,7 +207,7 @@ Replace `__YOUR_D1_DATABASE_NAME__` with the actual name of your D1 database tha Let's create some dummy data that we can query once the Worker is running: -```bash +```npm # For the local database npx wrangler d1 execute __YOUR_D1_DATABASE_NAME__ --command "INSERT INTO \"User\" (\"email\", \"name\") VALUES ('jane@prisma.io', 'Jane Doe (Local)');" --local @@ -219,7 +219,7 @@ npx wrangler d1 execute __YOUR_D1_DATABASE_NAME__ --command "INSERT INTO \"User\ For future schema changes, you can generate new migration files using: -```bash +```npm npx prisma migrate diff \ --from-local-d1 \ --to-schema prisma/schema.prisma \ diff --git a/apps/docs/content/docs/guides/making-guides.mdx b/apps/docs/content/docs/guides/making-guides.mdx index 7b7107c660..e300505ce3 100644 --- a/apps/docs/content/docs/guides/making-guides.mdx +++ b/apps/docs/content/docs/guides/making-guides.mdx @@ -272,7 +272,7 @@ image: '/img/guides/[guide-name]-cover.png' [Instructions for creating or setting up the project] -```bash +```npm # Example command npx create-next-app@latest my-app cd my-app @@ -300,7 +300,7 @@ If you are using a different database provider (MySQL, SQL Server, SQLite), inst Once installed, initialize Prisma in your project: -```bash +```npm npx prisma init --db --output ../generated/prisma ``` @@ -350,13 +350,13 @@ model Post { // [!code ++] Create the database tables: -```bash +```npm npx prisma migrate dev --name init ``` Then generate Prisma Client: -```bash +```npm npx prisma generate ``` diff --git a/apps/docs/content/docs/guides/switch-to-prisma-orm/from-sql-orms.mdx b/apps/docs/content/docs/guides/switch-to-prisma-orm/from-sql-orms.mdx index a257e16aaa..3f6767c5de 100644 --- a/apps/docs/content/docs/guides/switch-to-prisma-orm/from-sql-orms.mdx +++ b/apps/docs/content/docs/guides/switch-to-prisma-orm/from-sql-orms.mdx @@ -63,7 +63,7 @@ npx prisma db pull To create a baseline migration, run: -```bash +```npm mkdir -p prisma/migrations/0_init npx prisma migrate diff --from-empty --to-schema prisma/schema.prisma --script > prisma/migrations/0_init/migration.sql npx prisma migrate resolve --applied 0_init diff --git a/apps/docs/content/docs/orm/core-concepts/supported-databases/mysql.mdx b/apps/docs/content/docs/orm/core-concepts/supported-databases/mysql.mdx index aadf2cca06..8ea3778172 100644 --- a/apps/docs/content/docs/orm/core-concepts/supported-databases/mysql.mdx +++ b/apps/docs/content/docs/orm/core-concepts/supported-databases/mysql.mdx @@ -128,7 +128,7 @@ Serverless MySQL-compatible database built on Vitess clustering system. Use `prisma db push` (not `prisma migrate`): -```bash +```npm npx prisma db push ``` diff --git a/apps/docs/content/docs/orm/index.mdx b/apps/docs/content/docs/orm/index.mdx index d677a498ab..8fcc3f7ad6 100644 --- a/apps/docs/content/docs/orm/index.mdx +++ b/apps/docs/content/docs/orm/index.mdx @@ -94,13 +94,13 @@ export default defineConfig({ Use [Prisma Migrate](/docs/orm/prisma-migrate) to create and apply migrations: -```bash +```npm npx prisma migrate dev ``` Or [introspect](/docs/orm/prisma-schema/introspection) an existing database: -```bash +```npm npx prisma db pull ``` diff --git a/apps/docs/content/docs/orm/reference/prisma-cli-reference.mdx b/apps/docs/content/docs/orm/reference/prisma-cli-reference.mdx index b1e9fb2725..d3bf7d4002 100644 --- a/apps/docs/content/docs/orm/reference/prisma-cli-reference.mdx +++ b/apps/docs/content/docs/orm/reference/prisma-cli-reference.mdx @@ -720,7 +720,7 @@ This creates a named instance called `mydbname` that you can later start, stop, **Run `prisma dev` in detached mode** -```bash +```npm npx prisma dev --detach ``` diff --git a/apps/docs/content/docs/orm/reference/prisma-config-reference.mdx b/apps/docs/content/docs/orm/reference/prisma-config-reference.mdx index c3819f0cfe..d704927513 100644 --- a/apps/docs/content/docs/orm/reference/prisma-config-reference.mdx +++ b/apps/docs/content/docs/orm/reference/prisma-config-reference.mdx @@ -694,14 +694,14 @@ The `--bun` flag is required when using Bun to ensure Prisma runs with the Bun r Example run from the project root: -```bash +```npm npx prisma validate # → Works as expected ``` Run from a subdirectory (fails): -```bash +```npm cd src npx prisma validate # → Error: Could not find Prisma Schema... diff --git a/apps/docs/content/docs/postgres/database/local-development.mdx b/apps/docs/content/docs/postgres/database/local-development.mdx index fc45556e2c..489863a79d 100644 --- a/apps/docs/content/docs/postgres/database/local-development.mdx +++ b/apps/docs/content/docs/postgres/database/local-development.mdx @@ -54,7 +54,7 @@ Keep the local Prisma Postgres server running in the background while you work o Alternatively, you can run the server in detached mode to free up your terminal: -```bash +```npm npx prisma dev --detach ``` @@ -176,13 +176,13 @@ npx prisma dev rm mydb # removes a DB called `mydb` To remove all databases that begin with `mydb` (e.g. `mydb-dev` and `mydb-prod`), you can use a glob: -```bash +```npm npx prisma dev rm mydb* # removes all DBs starting with `mydb` ``` You can use the `--force` flag to stop any running servers before removing them: -```bash +```npm npx prisma dev rm mydb --force ``` diff --git a/apps/docs/content/docs/studio/getting-started.mdx b/apps/docs/content/docs/studio/getting-started.mdx index 1db7232864..ad7c982aad 100644 --- a/apps/docs/content/docs/studio/getting-started.mdx +++ b/apps/docs/content/docs/studio/getting-started.mdx @@ -20,7 +20,7 @@ npm install -g prisma If you have an existing Prisma project, navigate to your project directory and run: -```bash +```npm npx prisma studio ``` @@ -30,7 +30,7 @@ This will start the Studio server and open it in your default browser at `http:/ You can also use Studio with any database by providing a connection string: -```bash +```npm npx prisma studio --url="postgresql://user:password@localhost:5432/yourdb" ``` diff --git a/apps/docs/content/docs/studio/index.mdx b/apps/docs/content/docs/studio/index.mdx index 2bbf43f44f..cff3477fb8 100644 --- a/apps/docs/content/docs/studio/index.mdx +++ b/apps/docs/content/docs/studio/index.mdx @@ -21,7 +21,7 @@ metaDescription: 'Learn about the various ways of using Prisma Studio, from runn ## Quick start -```bash +```npm # With Prisma project npx prisma studio