@nice-code/commander 0.100.0 → 0.103.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -33,6 +33,8 @@ export default defineCommanderConfig({
33
33
 
34
34
  ```bash
35
35
  bunx nice-commander up # `web` → starts api first, waits for it to be READY, then web
36
+ # ✓ api ready → http://127.0.0.1:8787
37
+ bunx nice-commander up --json # the same generation as data: outcome, state, pid, urls per id
36
38
  bunx nice-commander status # live table
37
39
  bunx nice-commander ui # the browser view
38
40
  bunx nice-commander down web
@@ -97,34 +99,57 @@ The process overview follows the current filters. Reduced-motion preferences dis
97
99
  ## Finding and stopping port owners
98
100
 
99
101
  ```bash
100
- nice-commander doctor # includes PIDs for occupied, inactive endpoints
102
+ nice-commander doctor # occupied, inactive endpoints — each owner marked STRAY or not
101
103
  nice-commander ports # inspect all configured exclusive TCP endpoints
102
104
  nice-commander ports journey-backend journey-web
103
- nice-commander ports journey-backend --kill 12345 # review and confirm this PID
105
+ nice-commander ports journey-backend --kill 12345 # review and confirm this PID
106
+ nice-commander ports journey-backend --kill-owner # stop whatever holds its endpoints, no PID needed
107
+ nice-commander up journey-backend --replace-same # take the port from a stray, then start
108
+ nice-commander doctor --reap-strays # stop every stray on a configured port
104
109
  ```
105
110
 
106
- Inspection shows each listener's PID, executable, parent PID, working directory and process-start
107
- identity. It does not prove that a listener is a duplicate: another application may use the same
108
- port. Command arguments and environment variables are not collected.
111
+ Inspection shows each listener's PID, executable, parent PID, working directory, process-start
112
+ identity and whether it is a **stray**: this definition's own command (argv and cwd both equal),
113
+ running outside the daemon — typically something you started by hand in a terminal that has since
114
+ gone away. The match walks up the listener's parents, so `bun run dev` → vite → the socket still
115
+ matches a definition of `bun run dev`. Anything else is a **stranger**: another application may use
116
+ the same port, and inspection does not guess. Command arguments are read for the match and are not
117
+ shown or stored.
118
+
119
+ A start that finds a stray on an exclusive port refuses and says so, naming the pid and the fix.
120
+ `up --replace-same` (or `replaceSame: true` on the definition, or under `defaults`) stops the stray
121
+ as a tree — root command first, so its wrapper cannot respawn it — with the same SIGTERM → grace →
122
+ SIGKILL ladder a stop uses, then starts the definition. A stranger on the port is named and always
123
+ refused, with or without the flag; nothing is ever killed on the strength of a port alone.
109
124
 
110
125
  `--kill PID` sends SIGTERM after confirmation; `--yes` supplies explicit noninteractive consent.
111
- If the listener will not stop, inspect again and use `--kill PID --force` to choose SIGKILL.
112
- Only the selected listener is signalled, not its parent or process tree. A watcher may restart it;
113
- inspect again to see the replacement. Multiple listeners are listed individually.
126
+ `--kill-owner` does the same for every verified listener on the selection's exclusive endpoints
127
+ without your having to copy a PID first. If the listener will not stop, inspect again and add
128
+ `--force` to choose SIGKILL. A stray is signalled as its tree; a stranger only as the selected
129
+ listener, so a watcher may restart it — inspect again to see the replacement. Multiple listeners
130
+ are listed individually.
114
131
 
115
132
  In the UI, **inspect ports** appears on inactive process rows (including failed starts), and in
116
- expanded details for active rows. Review the owner, choose **stop PID** or **force kill PID**,
117
- and confirm. Once the port is free, **retry start** runs the normal startup checks again.
133
+ expanded details for active rows. Each listener carries its stray verdict; a stray offers
134
+ **replace stray and start** (the same as `--replace-same`). Otherwise review the owner, choose
135
+ **stop PID** or **force kill PID**, and confirm. Once the port is free, **retry start** runs the
136
+ normal startup checks again.
118
137
 
119
138
  The identity and endpoint are rechecked before termination. Inspection tokens expire after five
120
139
  minutes and can be used once. Active configured port owners must be stopped with their ordinary
121
140
  stop control first; Commander and its ancestors are protected. `ports` works without starting a
122
- daemon, and `doctor` remains read-only unless `--reap` is explicitly requested.
141
+ daemon. `doctor` remains read-only unless `--reap` (a crashed daemon's ledger orphans) or
142
+ `--reap-strays` (strays on configured ports, confirmed one by one, `--yes` for scripts) is
143
+ explicitly requested; strangers are listed and left alone by both.
144
+
145
+ A refused start stays readable: `status` shows `start failed: …` on the row until a later start
146
+ succeeds or the process is stopped, and a `blocked: dependency "x" is not running` note clears by
147
+ itself once `x` is ready.
123
148
 
124
149
  Owner inspection currently supports macOS and Linux with `lsof` and `ps` available. Visibility
125
150
  is limited by OS permissions. Remote, shared and observed endpoints are never termination
126
151
  targets. A missing tool or unknown identity produces a diagnostic instead of authorizing a kill.
127
- Windows owner inspection is not supported yet.
152
+ Windows owner inspection is not supported yet, so on Windows every port owner is a stranger.
128
153
 
129
154
  ## Developing the web UI (`bun run dev`)
130
155