From ef681e749d346b7e1c1240d62a3eb2a4e03dea47 Mon Sep 17 00:00:00 2001 From: Aman Varshney Date: Wed, 7 Jan 2026 20:44:08 +0530 Subject: [PATCH 1/3] docs: update prisma dev command documentation - Add missing --detach (-d) option to run server in background - Add default value 'default' for --name option - Add --force option documentation for dev rm command --- .../200-prisma-cli-reference.mdx | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/content/200-orm/500-reference/200-prisma-cli-reference.mdx b/content/200-orm/500-reference/200-prisma-cli-reference.mdx index 0214184dd7..60355044ec 100644 --- a/content/200-orm/500-reference/200-prisma-cli-reference.mdx +++ b/content/200-orm/500-reference/200-prisma-cli-reference.mdx @@ -839,13 +839,14 @@ The `dev` command starts a [local Prisma Postgres](/postgres/database/local-deve ### Arguments -| Argument | Required | Description | Default | -| --------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | -| `--name` (or `-n`) | No | Enables targeting a specific database instance. [Learn more](/postgres/database/local-development#using-different-local-prisma-postgres-instances). | | -| `--port` (or `-p`) | No | Main port number the local Prisma Postgres HTTP server will listen on. | `51213` | -| `--db-port` (or `-P`) | No | Port number the local Prisma Postgres database server will listen on. | `51214` | -| `--shadow-db-port` | No | Port number the shadow database server will listen on. | `51215` | -| `--debug` | No | Enable debug logging. | `false` | +| Argument | Required | Description | Default | +| --------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | --------- | +| `--name` (or `-n`) | No | Enables targeting a specific database instance. [Learn more](/postgres/database/local-development#using-different-local-prisma-postgres-instances). | `default` | +| `--port` (or `-p`) | No | Main port number the local Prisma Postgres HTTP server will listen on. | `51213` | +| `--db-port` (or `-P`) | No | Port number the local Prisma Postgres database server will listen on. | `51214` | +| `--shadow-db-port` | No | Port number the shadow database server will listen on. | `51215` | +| `--detach` (or `-d`) | No | Run the server in the background. | `false` | +| `--debug` | No | Enable debug logging. | `false` | ### Examples @@ -971,6 +972,12 @@ To remove all databases that begin with `mydb` (e.g. `mydb-dev` and `mydb-prod`) npx prisma dev rm mydb* # removes all DBs starting with `mydb` ``` +#### Arguments + +| Argument | Required | Description | Default | +| --------- | -------- | -------------------------------------------------------------------------------------------------------------------- | ------- | +| `--force` | No | Stops any running servers before removing them. Without this flag, the command will fail if any server is running. | `false` | + :::note The `rm` command is interactive and includes safety prompts to prevent accidental data loss. From 91fc5e8354015fe6276dbf8c4f050e3fd5a4c098 Mon Sep 17 00:00:00 2001 From: Aman Varshney Date: Wed, 7 Jan 2026 21:02:35 +0530 Subject: [PATCH 2/3] docs: add detached mode example for prisma dev --- .../200-orm/500-reference/200-prisma-cli-reference.mdx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/content/200-orm/500-reference/200-prisma-cli-reference.mdx b/content/200-orm/500-reference/200-prisma-cli-reference.mdx index 60355044ec..26b0217daa 100644 --- a/content/200-orm/500-reference/200-prisma-cli-reference.mdx +++ b/content/200-orm/500-reference/200-prisma-cli-reference.mdx @@ -888,6 +888,14 @@ npx prisma dev --name="mydbname" This creates a named instance called `mydbname` that you can later start, stop, or manage using the instance management commands. +**Run `prisma dev` in detached mode** + +```terminal +npx prisma dev --detach +``` + +This runs the server in the background, freeing up your terminal for other commands. Use `prisma dev ls` to see running servers and `prisma dev stop` to stop them. + ### `dev start` Starts existing [local Prisma Postgres](/postgres/database/local-development) instances in the background. From 2556c6f9798da3597e6d04ca4478a767cf2a6055 Mon Sep 17 00:00:00 2001 From: Aman Varshney Date: Wed, 7 Jan 2026 21:09:32 +0530 Subject: [PATCH 3/3] docs: update local-development with detach and force options - Add --detach option example for running server in background - Add --force option documentation for dev rm command - Fix typo: 'stop' -> 'remove' in dev rm section --- .../300-database/550-local-development.mdx | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/content/250-postgres/300-database/550-local-development.mdx b/content/250-postgres/300-database/550-local-development.mdx index 059443c287..fc0e3fdf61 100644 --- a/content/250-postgres/300-database/550-local-development.mdx +++ b/content/250-postgres/300-database/550-local-development.mdx @@ -50,7 +50,15 @@ If you want to connect via Prisma ORM, hit h on your keyboard, copy t DATABASE_URL="prisma+postgres://localhost:51213/?api_key=__API_KEY__" ``` -Keep the local Prisma Postgres server running in the background while you work on your application. +Keep the local Prisma Postgres server running in the background while you work on your application. + +Alternatively, you can run the server in detached mode to free up your terminal: + +```terminal +npx prisma dev --detach +``` + +This starts the server in the background. Use `prisma dev ls` to see running servers and `prisma dev stop` to stop them. ### 2. Applying migrations and seeding data @@ -166,12 +174,20 @@ npx prisma dev rm npx prisma dev rm mydb # removes a DB called `mydb` ``` -To stop all databases that begin with `mydb` (e.g. `mydb-dev` and `mydb-prod`), you can use a glob: +To remove all databases that begin with `mydb` (e.g. `mydb-dev` and `mydb-prod`), you can use a glob: -``` +```terminal 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: + +```terminal +npx prisma dev rm mydb --force +``` + +Without `--force`, the command will fail if any server is still running. + :::note The `rm` command is interactive and includes safety prompts to prevent accidental data loss. You'll be asked to confirm the action by typing a confirmation phrase that hints at the risks involved.