From 8245a6e8f0bf78222d52dd77f1b434ae6205dbd3 Mon Sep 17 00:00:00 2001 From: zumbrunn Date: Thu, 22 Oct 2026 09:27:48 +0200 Subject: [PATCH 1/7] docs(cli): dune ps finds the dune CLI and task wrappers, reports "not listening", and has --stop Co-Authored-By: Claude Opus 5.5 --- 07.reference/01.cli/default.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/07.reference/01.cli/default.md b/07.reference/01.cli/default.md index 5362ccb..d27b53c 100644 --- a/07.reference/01.cli/default.md +++ b/07.reference/01.cli/default.md @@ -24,7 +24,8 @@ All commands are run with `dune` (or `deno task dune`). | `dune serve --root my-site` | Serve a site in a subdirectory without `cd`-ing into it first. | | `dune dev --env-file` | Load `.env` from the site root into the process environment before plugins/config are read. | | `dune dev --env-file=path/to/file` | Same, from an explicit path (relative to the site root, or absolute). | -| `dune ps` | List dune dev/serve instances currently running on this machine — PID, mode, site title, root, and the port(s) actually listening. Scans the process table; works retroactively on anything already running. macOS/Linux only. | +| `dune ps` | List dune dev/serve instances currently running on this machine — PID, mode, site title, root, the port(s) actually listening, and the command line. Scans the process table, so it works retroactively on anything already running. Finds servers started through the generated `main.ts`, the `dune` CLI itself (`cli.ts dev`, the global shim, `jsr:@dune/core/cli`) and `deno task dev|serve`; a server's wrapper, re-exec child and esbuild workers are reported as one instance. A process that is running but holds no port is shown as **not listening** (typically a server started on a port something else already held, which never exits). macOS/Linux only. | +| `dune ps --stop` | Stop every instance found, with its child processes (SIGTERM). Asks first; `--yes` skips the prompt, and without a terminal it refuses unless `--yes` is given. It never signals itself or its parent processes, and it stops *everything* it lists, so run plain `dune ps` first on a machine shared with other work. | `--env-file` is off by default — nothing auto-loads secrets from disk on a plain `dune dev`/`serve`. It parses simple `KEY=VALUE` lines (blank lines and `#` comments skipped, surrounding quotes stripped); a key already set in the environment always wins over the file. An explicitly-requested file that doesn't exist is a hard error, not a silent no-op. Also accepted by `dune serve`. From c307d92daa37939b413c6d6f33bea77ff44a2340 Mon Sep 17 00:00:00 2001 From: zumbrunn Date: Thu, 22 Oct 2026 09:33:32 +0200 Subject: [PATCH 2/7] docs(cli): document dune ps --idle, the selective stop Co-Authored-By: Claude Opus 5.5 --- 07.reference/01.cli/default.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/07.reference/01.cli/default.md b/07.reference/01.cli/default.md index d27b53c..9137acb 100644 --- a/07.reference/01.cli/default.md +++ b/07.reference/01.cli/default.md @@ -25,7 +25,8 @@ All commands are run with `dune` (or `deno task dune`). | `dune dev --env-file` | Load `.env` from the site root into the process environment before plugins/config are read. | | `dune dev --env-file=path/to/file` | Same, from an explicit path (relative to the site root, or absolute). | | `dune ps` | List dune dev/serve instances currently running on this machine — PID, mode, site title, root, the port(s) actually listening, and the command line. Scans the process table, so it works retroactively on anything already running. Finds servers started through the generated `main.ts`, the `dune` CLI itself (`cli.ts dev`, the global shim, `jsr:@dune/core/cli`) and `deno task dev|serve`; a server's wrapper, re-exec child and esbuild workers are reported as one instance. A process that is running but holds no port is shown as **not listening** (typically a server started on a port something else already held, which never exits). macOS/Linux only. | -| `dune ps --stop` | Stop every instance found, with its child processes (SIGTERM). Asks first; `--yes` skips the prompt, and without a terminal it refuses unless `--yes` is given. It never signals itself or its parent processes, and it stops *everything* it lists, so run plain `dune ps` first on a machine shared with other work. | +| `dune ps --stop` | Stop every instance listed, with its child processes (SIGTERM). Asks first; `--yes` skips the prompt, and without a terminal it refuses unless `--yes` is given. It never signals itself or its parent processes. It stops *everything* it lists, so on a machine shared with other work run plain `dune ps` first, or use `--idle`. | +| `dune ps --idle` | Only the instances that are running but **not listening** (hung or leftover processes). On its own it is a preview; `dune ps --stop --idle` stops just those and leaves live servers alone. An instance whose port state is unknown (no `lsof`) is never treated as idle. | `--env-file` is off by default — nothing auto-loads secrets from disk on a plain `dune dev`/`serve`. It parses simple `KEY=VALUE` lines (blank lines and `#` comments skipped, surrounding quotes stripped); a key already set in the environment always wins over the file. An explicitly-requested file that doesn't exist is a hard error, not a silent no-op. Also accepted by `dune serve`. From 29bef432353a934406055bf41002a0304ee338c5 Mon Sep 17 00:00:00 2001 From: zumbrunn Date: Thu, 22 Oct 2026 10:45:13 +0200 Subject: [PATCH 3/7] docs(cli): dune ps --stop escalates to SIGKILL after a grace period Co-Authored-By: Claude Opus 5.5 --- 07.reference/01.cli/default.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/07.reference/01.cli/default.md b/07.reference/01.cli/default.md index 9137acb..0a28503 100644 --- a/07.reference/01.cli/default.md +++ b/07.reference/01.cli/default.md @@ -25,7 +25,7 @@ All commands are run with `dune` (or `deno task dune`). | `dune dev --env-file` | Load `.env` from the site root into the process environment before plugins/config are read. | | `dune dev --env-file=path/to/file` | Same, from an explicit path (relative to the site root, or absolute). | | `dune ps` | List dune dev/serve instances currently running on this machine — PID, mode, site title, root, the port(s) actually listening, and the command line. Scans the process table, so it works retroactively on anything already running. Finds servers started through the generated `main.ts`, the `dune` CLI itself (`cli.ts dev`, the global shim, `jsr:@dune/core/cli`) and `deno task dev|serve`; a server's wrapper, re-exec child and esbuild workers are reported as one instance. A process that is running but holds no port is shown as **not listening** (typically a server started on a port something else already held, which never exits). macOS/Linux only. | -| `dune ps --stop` | Stop every instance listed, with its child processes (SIGTERM). Asks first; `--yes` skips the prompt, and without a terminal it refuses unless `--yes` is given. It never signals itself or its parent processes. It stops *everything* it lists, so on a machine shared with other work run plain `dune ps` first, or use `--idle`. | +| `dune ps --stop` | Stop every instance listed, with its child processes: SIGTERM, a 10-second grace period for a real server to drain, then SIGKILL for anything still alive (the pids that needed it are named). Asks first; `--yes` skips the prompt, and without a terminal it refuses unless `--yes` is given. It never signals itself or its parent processes. It stops *everything* it lists, so on a machine shared with other work run plain `dune ps` first, or use `--idle`. | | `dune ps --idle` | Only the instances that are running but **not listening** (hung or leftover processes). On its own it is a preview; `dune ps --stop --idle` stops just those and leaves live servers alone. An instance whose port state is unknown (no `lsof`) is never treated as idle. | `--env-file` is off by default — nothing auto-loads secrets from disk on a plain `dune dev`/`serve`. It parses simple `KEY=VALUE` lines (blank lines and `#` comments skipped, surrounding quotes stripped); a key already set in the environment always wins over the file. An explicitly-requested file that doesn't exist is a hard error, not a silent no-op. Also accepted by `dune serve`. From ee1213e4ff4592887420143cb5a0031f40ffc03d Mon Sep 17 00:00:00 2001 From: zumbrunn Date: Mon, 26 Oct 2026 20:40:36 +0100 Subject: [PATCH 4/7] docs(cli): dune stop replaces dune ps --stop / --idle Refs duneorg/dune#46 Co-Authored-By: Claude Sonnet 5.5 --- 07.reference/01.cli/default.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/07.reference/01.cli/default.md b/07.reference/01.cli/default.md index 0a28503..be74cf7 100644 --- a/07.reference/01.cli/default.md +++ b/07.reference/01.cli/default.md @@ -24,9 +24,12 @@ All commands are run with `dune` (or `deno task dune`). | `dune serve --root my-site` | Serve a site in a subdirectory without `cd`-ing into it first. | | `dune dev --env-file` | Load `.env` from the site root into the process environment before plugins/config are read. | | `dune dev --env-file=path/to/file` | Same, from an explicit path (relative to the site root, or absolute). | -| `dune ps` | List dune dev/serve instances currently running on this machine — PID, mode, site title, root, the port(s) actually listening, and the command line. Scans the process table, so it works retroactively on anything already running. Finds servers started through the generated `main.ts`, the `dune` CLI itself (`cli.ts dev`, the global shim, `jsr:@dune/core/cli`) and `deno task dev|serve`; a server's wrapper, re-exec child and esbuild workers are reported as one instance. A process that is running but holds no port is shown as **not listening** (typically a server started on a port something else already held, which never exits). macOS/Linux only. | -| `dune ps --stop` | Stop every instance listed, with its child processes: SIGTERM, a 10-second grace period for a real server to drain, then SIGKILL for anything still alive (the pids that needed it are named). Asks first; `--yes` skips the prompt, and without a terminal it refuses unless `--yes` is given. It never signals itself or its parent processes. It stops *everything* it lists, so on a machine shared with other work run plain `dune ps` first, or use `--idle`. | -| `dune ps --idle` | Only the instances that are running but **not listening** (hung or leftover processes). On its own it is a preview; `dune ps --stop --idle` stops just those and leaves live servers alone. An instance whose port state is unknown (no `lsof`) is never treated as idle. | +| `dune ps` | List dune dev/serve instances currently running on this machine — PID, mode, site title, root, the port(s) actually listening, and the command line. Read-only. Scans the process table, so it works retroactively on anything already running. Finds servers started through the generated `main.ts`, the `dune` CLI itself (`cli.ts dev`, the global shim, `jsr:@dune/core/cli`) and `deno task dev|serve`; a server's wrapper, re-exec child and esbuild workers are reported as one instance. A process that is running but holds no port is shown as **not listening** (typically a server started on a port something else already held, which never exits). macOS/Linux only. | +| `dune stop ` | Stop one instance, with its child processes. The pid can be any process `dune ps` shows for it. Sends SIGTERM and waits up to 10 seconds for a server to drain; a process that ignores it is reported, not killed. Asks first; `--yes` skips the prompt, and without a terminal it refuses unless `--yes` is given. It never signals itself or its parent processes. Exit code 1 if the pid matches no instance or something would not stop. | +| `dune stop --port ` | Stop the instance listening on that port. | +| `dune stop --idle` | Stop only instances that are running but **not listening** (hung or leftover processes), leaving live servers alone. An instance whose port state is unknown (no `lsof`) is never treated as idle. | +| `dune stop --all` | Stop every instance `dune ps` lists. A target is always required — a bare `dune stop` only prints usage (exit 2) — so stopping everything has to be asked for by name; on a machine shared with other work, run `dune ps` first. | +| `dune stop … --force` | Also SIGKILL processes that ignore SIGTERM after the grace period, naming them. Opt-in: killing a wrapper process can leave its child running. | `--env-file` is off by default — nothing auto-loads secrets from disk on a plain `dune dev`/`serve`. It parses simple `KEY=VALUE` lines (blank lines and `#` comments skipped, surrounding quotes stripped); a key already set in the environment always wins over the file. An explicitly-requested file that doesn't exist is a hard error, not a silent no-op. Also accepted by `dune serve`. From 0c69db23b5cc0986753c7651a10d308473b4a750 Mon Sep 17 00:00:00 2001 From: zumbrunn Date: Mon, 26 Oct 2026 21:52:04 +0100 Subject: [PATCH 5/7] docs(cli): dune ps health probe and instance registry Refs duneorg/dune#53 Co-Authored-By: Claude Sonnet 5.5 --- 07.reference/01.cli/default.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/07.reference/01.cli/default.md b/07.reference/01.cli/default.md index be74cf7..4e953d0 100644 --- a/07.reference/01.cli/default.md +++ b/07.reference/01.cli/default.md @@ -24,12 +24,12 @@ All commands are run with `dune` (or `deno task dune`). | `dune serve --root my-site` | Serve a site in a subdirectory without `cd`-ing into it first. | | `dune dev --env-file` | Load `.env` from the site root into the process environment before plugins/config are read. | | `dune dev --env-file=path/to/file` | Same, from an explicit path (relative to the site root, or absolute). | -| `dune ps` | List dune dev/serve instances currently running on this machine — PID, mode, site title, root, the port(s) actually listening, and the command line. Read-only. Scans the process table, so it works retroactively on anything already running. Finds servers started through the generated `main.ts`, the `dune` CLI itself (`cli.ts dev`, the global shim, `jsr:@dune/core/cli`) and `deno task dev|serve`; a server's wrapper, re-exec child and esbuild workers are reported as one instance. A process that is running but holds no port is shown as **not listening** (typically a server started on a port something else already held, which never exits). macOS/Linux only. | +| `dune ps` | List dune dev/serve instances currently running on this machine — PID, mode, site title, root, the port(s) actually listening, and the command line. Read-only. Scans the process table, so it works retroactively on anything already running. Finds servers started through the generated `main.ts`, the `dune` CLI itself (`cli.ts dev`, the global shim, `jsr:@dune/core/cli`) and `deno task dev|serve`; a server's wrapper, re-exec child and esbuild workers are reported as one instance. A process that is running but holds no port is shown as **not listening** (typically a server started on a port something else already held, which never exits). Every listening instance is also sent a request to `/health/live`; one that accepts the connection but never answers (a blocked event loop) is shown as **NOT RESPONDING**. Instances record themselves in `~/.dune/instances/` (`DUNE_REGISTRY_DIR` overrides), so one started in an unusual way is still listed, with its `@dune/core` version. macOS/Linux only. | | `dune stop ` | Stop one instance, with its child processes. The pid can be any process `dune ps` shows for it. Sends SIGTERM and waits up to 10 seconds for a server to drain; a process that ignores it is reported, not killed. Asks first; `--yes` skips the prompt, and without a terminal it refuses unless `--yes` is given. It never signals itself or its parent processes. Exit code 1 if the pid matches no instance or something would not stop. | | `dune stop --port ` | Stop the instance listening on that port. | -| `dune stop --idle` | Stop only instances that are running but **not listening** (hung or leftover processes), leaving live servers alone. An instance whose port state is unknown (no `lsof`) is never treated as idle. | +| `dune stop --idle` | Stop only instances that aren't serving: running but **not listening**, or listening but **not responding** (hung or leftover processes), leaving live servers alone. An instance whose port state is unknown (no `lsof`) is never treated as idle. | | `dune stop --all` | Stop every instance `dune ps` lists. A target is always required — a bare `dune stop` only prints usage (exit 2) — so stopping everything has to be asked for by name; on a machine shared with other work, run `dune ps` first. | -| `dune stop … --force` | Also SIGKILL processes that ignore SIGTERM after the grace period, naming them. Opt-in: killing a wrapper process can leave its child running. | +| `dune stop … --force` | Also SIGKILL processes that ignore SIGTERM after the grace period, naming them. Opt-in: killing a wrapper process can leave its child running. A server stuck in a loop can't handle SIGTERM at all, so this is how to end a hung one. | `--env-file` is off by default — nothing auto-loads secrets from disk on a plain `dune dev`/`serve`. It parses simple `KEY=VALUE` lines (blank lines and `#` comments skipped, surrounding quotes stripped); a key already set in the environment always wins over the file. An explicitly-requested file that doesn't exist is a hard error, not a silent no-op. Also accepted by `dune serve`. From 7069093c05b2ba89d4a5141f1088df9c9c58ab3b Mon Sep 17 00:00:00 2001 From: zumbrunn Date: Mon, 26 Oct 2026 23:22:28 +0100 Subject: [PATCH 6/7] docs(cli): dune stop acts only on confirmed instances; probe details Refs duneorg/dune#53 Co-Authored-By: Claude Sonnet 5.5 --- 07.reference/01.cli/default.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/07.reference/01.cli/default.md b/07.reference/01.cli/default.md index 4e953d0..ad5acda 100644 --- a/07.reference/01.cli/default.md +++ b/07.reference/01.cli/default.md @@ -24,11 +24,11 @@ All commands are run with `dune` (or `deno task dune`). | `dune serve --root my-site` | Serve a site in a subdirectory without `cd`-ing into it first. | | `dune dev --env-file` | Load `.env` from the site root into the process environment before plugins/config are read. | | `dune dev --env-file=path/to/file` | Same, from an explicit path (relative to the site root, or absolute). | -| `dune ps` | List dune dev/serve instances currently running on this machine — PID, mode, site title, root, the port(s) actually listening, and the command line. Read-only. Scans the process table, so it works retroactively on anything already running. Finds servers started through the generated `main.ts`, the `dune` CLI itself (`cli.ts dev`, the global shim, `jsr:@dune/core/cli`) and `deno task dev|serve`; a server's wrapper, re-exec child and esbuild workers are reported as one instance. A process that is running but holds no port is shown as **not listening** (typically a server started on a port something else already held, which never exits). Every listening instance is also sent a request to `/health/live`; one that accepts the connection but never answers (a blocked event loop) is shown as **NOT RESPONDING**. Instances record themselves in `~/.dune/instances/` (`DUNE_REGISTRY_DIR` overrides), so one started in an unusual way is still listed, with its `@dune/core` version. macOS/Linux only. | -| `dune stop ` | Stop one instance, with its child processes. The pid can be any process `dune ps` shows for it. Sends SIGTERM and waits up to 10 seconds for a server to drain; a process that ignores it is reported, not killed. Asks first; `--yes` skips the prompt, and without a terminal it refuses unless `--yes` is given. It never signals itself or its parent processes. Exit code 1 if the pid matches no instance or something would not stop. | +| `dune ps` | List your dune dev/serve instances currently running on this machine — PID, mode, version, site title, root, the port(s) actually listening, and the command line. Mostly read-only: it scans the process table, so it works retroactively on anything already running, and it sends a `GET /health/live` to each listening instance (this appears in the instance's access log). Finds servers started through the generated `main.ts`, the `dune` CLI itself (`cli.ts dev`, the global shim, `jsr:@dune/core/cli`) and `deno task dev|serve`; a server's wrapper, re-exec child and esbuild workers are reported as one instance. Instances also record themselves in `~/.dune/instances/` (`DUNE_REGISTRY_DIR` overrides), so one started in an unusual way is still listed. A process that is running but holds no port is shown as **not listening**. A listening instance that fails three health probes in a row (about 10 seconds) is shown as **NOT RESPONDING**: a blocked event loop accepts the connection but never answers. It probes the port the instance registered, else every listening port, counting only dune's own answer. A process that matches dune only by its command line, with no `config/site.yaml` at its root, is listed but marked unconfirmed. Only your own processes are shown. macOS/Linux only. | +| `dune stop ` | Stop one instance, with its **whole process tree** (including any other tool a `deno task` wrapper started). The pid can be any process `dune ps` shows for it, including an unconfirmed one (with a warning). Sends SIGTERM and waits up to 10 seconds for a server to drain; a process that ignores it is reported, not killed. Each pid's start time is re-checked immediately before it is signalled, so a pid that exited and was reused while the prompt was open is never hit. Asks first; `--yes` skips the prompt, and without a terminal it refuses unless `--yes` is given. It never signals itself or its parent processes. Exit code 1 if the pid matches no instance or something would not stop. | | `dune stop --port ` | Stop the instance listening on that port. | -| `dune stop --idle` | Stop only instances that aren't serving: running but **not listening**, or listening but **not responding** (hung or leftover processes), leaving live servers alone. An instance whose port state is unknown (no `lsof`) is never treated as idle. | -| `dune stop --all` | Stop every instance `dune ps` lists. A target is always required — a bare `dune stop` only prints usage (exit 2) — so stopping everything has to be asked for by name; on a machine shared with other work, run `dune ps` first. | +| `dune stop --idle` | Stop only **confirmed** instances that aren't serving: running but **not listening**, or listening but **not responding**, for at least 2 minutes (younger ones may still be starting, for example indexing a large site). Leaves live servers alone. An instance whose port state is unknown (no `lsof`) is never treated as idle. | +| `dune stop --all` | Stop every **confirmed** instance `dune ps` lists (a `config/site.yaml` at its root, or an entry in the instance registry). Anything that only looks like dune by its command line, such as another Deno project's `main.ts serve`, is left out and reported; name it by pid if you mean it. A target is always required — a bare `dune stop` only prints usage (exit 2) — so stopping everything has to be asked for by name. | | `dune stop … --force` | Also SIGKILL processes that ignore SIGTERM after the grace period, naming them. Opt-in: killing a wrapper process can leave its child running. A server stuck in a loop can't handle SIGTERM at all, so this is how to end a hung one. | `--env-file` is off by default — nothing auto-loads secrets from disk on a plain `dune dev`/`serve`. It parses simple `KEY=VALUE` lines (blank lines and `#` comments skipped, surrounding quotes stripped); a key already set in the environment always wins over the file. An explicitly-requested file that doesn't exist is a hard error, not a silent no-op. Also accepted by `dune serve`. From a74684b0b35985a539ceb82ec5f76136e04e91c3 Mon Sep 17 00:00:00 2001 From: zumbrunn Date: Tue, 27 Oct 2026 16:41:26 +0100 Subject: [PATCH 7/7] docs(cli): what 'confirmed' means for dune stop; permissions Refs duneorg/dune#46 Co-Authored-By: Claude Sonnet 5.5 --- 07.reference/01.cli/default.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/07.reference/01.cli/default.md b/07.reference/01.cli/default.md index ad5acda..8de35fa 100644 --- a/07.reference/01.cli/default.md +++ b/07.reference/01.cli/default.md @@ -24,11 +24,11 @@ All commands are run with `dune` (or `deno task dune`). | `dune serve --root my-site` | Serve a site in a subdirectory without `cd`-ing into it first. | | `dune dev --env-file` | Load `.env` from the site root into the process environment before plugins/config are read. | | `dune dev --env-file=path/to/file` | Same, from an explicit path (relative to the site root, or absolute). | -| `dune ps` | List your dune dev/serve instances currently running on this machine — PID, mode, version, site title, root, the port(s) actually listening, and the command line. Mostly read-only: it scans the process table, so it works retroactively on anything already running, and it sends a `GET /health/live` to each listening instance (this appears in the instance's access log). Finds servers started through the generated `main.ts`, the `dune` CLI itself (`cli.ts dev`, the global shim, `jsr:@dune/core/cli`) and `deno task dev|serve`; a server's wrapper, re-exec child and esbuild workers are reported as one instance. Instances also record themselves in `~/.dune/instances/` (`DUNE_REGISTRY_DIR` overrides), so one started in an unusual way is still listed. A process that is running but holds no port is shown as **not listening**. A listening instance that fails three health probes in a row (about 10 seconds) is shown as **NOT RESPONDING**: a blocked event loop accepts the connection but never answers. It probes the port the instance registered, else every listening port, counting only dune's own answer. A process that matches dune only by its command line, with no `config/site.yaml` at its root, is listed but marked unconfirmed. Only your own processes are shown. macOS/Linux only. | -| `dune stop ` | Stop one instance, with its **whole process tree** (including any other tool a `deno task` wrapper started). The pid can be any process `dune ps` shows for it, including an unconfirmed one (with a warning). Sends SIGTERM and waits up to 10 seconds for a server to drain; a process that ignores it is reported, not killed. Each pid's start time is re-checked immediately before it is signalled, so a pid that exited and was reused while the prompt was open is never hit. Asks first; `--yes` skips the prompt, and without a terminal it refuses unless `--yes` is given. It never signals itself or its parent processes. Exit code 1 if the pid matches no instance or something would not stop. | +| `dune ps` | List your dune dev/serve instances currently running on this machine — PID, mode, version, site title, root, the port(s) actually listening, and the command line. Mostly read-only: it scans the process table, so it works retroactively on anything already running, and it sends a `GET /health/live` to each listening instance (this appears in the instance's access log). Finds servers started through the generated `main.ts`, the `dune` CLI itself (`cli.ts dev`, the global shim, `jsr:@dune/core/cli`) and `deno task dev|serve`; a server's wrapper, re-exec child and esbuild workers are reported as one instance. Instances also record themselves in `~/.dune/instances/` (`DUNE_REGISTRY_DIR` overrides), so one started in an unusual way is still listed. A process that is running but holds no port is shown as **not listening**. A listening instance that fails three health probes in a row (about 10 seconds) is shown as **NOT RESPONDING**: a blocked event loop accepts the connection but never answers. It probes the port the instance registered, else every listening port, counting only dune's own answer. A process that matches dune only by its command line, with no `config/site.yaml` at the root that command line points to, is listed but marked unconfirmed. Only your own processes are shown. It needs permission to run `ps` and `lsof` (`--allow-run`, or `-A`) and says so rather than reporting no instances. macOS/Linux only. | +| `dune stop ` | Stop one instance, with its **whole process tree** (including any other tool a `deno task` wrapper started). The pid can be any process `dune ps` shows for it, including an unconfirmed one (with a warning). The prompt shows each instance's full command line. Sends SIGTERM and waits up to 10 seconds for a server to drain; a process that ignores it is reported, not killed. Each pid's start time is re-checked immediately before it is signalled, so a pid that exited and was reused while the prompt was open is never hit. Asks first; `--yes` skips the prompt, and without a terminal it refuses unless `--yes` is given. It never signals itself or its parent processes. Exit code 1 if the pid matches no instance or something would not stop. | | `dune stop --port ` | Stop the instance listening on that port. | | `dune stop --idle` | Stop only **confirmed** instances that aren't serving: running but **not listening**, or listening but **not responding**, for at least 2 minutes (younger ones may still be starting, for example indexing a large site). Leaves live servers alone. An instance whose port state is unknown (no `lsof`) is never treated as idle. | -| `dune stop --all` | Stop every **confirmed** instance `dune ps` lists (a `config/site.yaml` at its root, or an entry in the instance registry). Anything that only looks like dune by its command line, such as another Deno project's `main.ts serve`, is left out and reported; name it by pid if you mean it. A target is always required — a bare `dune stop` only prints usage (exit 2) — so stopping everything has to be asked for by name. | +| `dune stop --all` | Stop every **confirmed** instance `dune ps` lists. An instance is confirmed when its own command line points at a dune site (the directory of the `main.ts` it runs, its `--root`, or the dune CLI's working directory, each holding a `config/site.yaml`) or when it registered itself in the instance registry. Merely running from inside a site directory confirms nothing, so another Deno project's `main.ts serve` is left out and reported; name it by pid if you mean it. A target is always required — a bare `dune stop` only prints usage (exit 2) — so stopping everything has to be asked for by name. | | `dune stop … --force` | Also SIGKILL processes that ignore SIGTERM after the grace period, naming them. Opt-in: killing a wrapper process can leave its child running. A server stuck in a loop can't handle SIGTERM at all, so this is how to end a hung one. | `--env-file` is off by default — nothing auto-loads secrets from disk on a plain `dune dev`/`serve`. It parses simple `KEY=VALUE` lines (blank lines and `#` comments skipped, surrounding quotes stripped); a key already set in the environment always wins over the file. An explicitly-requested file that doesn't exist is a hard error, not a silent no-op. Also accepted by `dune serve`.