@seaveyon/harness-switch 0.17.0 → 0.19.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
@@ -4,44 +4,80 @@
4
4
 
5
5
  English | [简体中文](https://github.com/B1anker/harness-switch/blob/main/README.zh-CN.md)
6
6
 
7
- **harness-switch** is a Bun-powered web control plane for managing API profiles on an SSH or headless server. It switches API Base URL, API key, and model profiles for **Claude Code**, **Codex**, **Kimi Code**, **Pi**, and **DeepSeek Harness (DSH)**.
7
+ **harness-switch** is a local control plane for switching the API configuration used by **Claude Code**, **Codex**, **Kimi Code**, **Pi**, and **DeepSeek Harness (DSH)**. Run it on the computer that runs those tools; open its browser UI, choose a saved profile, and activate it.
8
8
 
9
- It is a configuration manager, not an API proxy: it does not route or inspect model traffic.
9
+ It writes the tools’ native configuration files directly. It is not a proxy, never receives model traffic, and does not need you to source a shell script.
10
10
 
11
- ## Install and run
11
+ ## What you get
12
12
 
13
- Requires [Bun](https://bun.sh) >= 1.2.
13
+ | Capability | What it means |
14
+ |---|---|
15
+ | One profile per provider or use case | Switch base URL, key, model, and harness-specific options from one UI. |
16
+ | Safe native-file writes | Every activation is validated, transactional, backed up, and can be undone. |
17
+ | Credential reuse | Store a key once in Provider Vault and reuse it across profiles. |
18
+ | Import, export, and sync | Adopt existing configs, move encrypted bundles between machines, or copy config between Unix users. |
19
+ | Diagnostics | Compare the active profile with live files, detect drift, and re-apply or adopt changes. |
20
+
21
+ ## Compatibility
22
+
23
+ | Area | Support |
24
+ |---|---|
25
+ | Operating systems | macOS, Windows, Linux |
26
+ | Runtime | Node.js >= 18.17 or Bun >= 1.2 |
27
+ | Browser access | Open `http://127.0.0.1:8787` on the same machine by default |
28
+ | Remote access | Optional SSH tunnel or a properly secured reverse proxy |
29
+ | Multiple local users | Unix-like hosts; Windows manages the account that starts the service |
30
+
31
+ ## Get started
32
+
33
+ Start with any package runner:
14
34
 
15
35
  ```bash
16
- bunx @seaveyon/harness-switch
36
+ npx -y @seaveyon/harness-switch@latest
37
+ pnpm dlx @seaveyon/harness-switch@latest
38
+ bunx @seaveyon/harness-switch@latest
17
39
  ```
18
40
 
19
- Or install it globally:
41
+ `pnpx @seaveyon/harness-switch@latest` is also supported where `pnpx` is available. Or install it globally:
20
42
 
21
43
  ```bash
22
- bun add -g @seaveyon/harness-switch
44
+ npm install -g @seaveyon/harness-switch
45
+ # pnpm add -g @seaveyon/harness-switch
46
+ # bun add -g @seaveyon/harness-switch
23
47
  harness-switch
24
48
  ```
25
49
 
26
- The server listens on `127.0.0.1:8787` by default. The first startup prints a randomly generated Web password in the terminal.
50
+ The command starts a background daemon on `127.0.0.1:8787` and prints the path to the generated Web password. Then:
51
+
52
+ 1. Open [http://127.0.0.1:8787](http://127.0.0.1:8787) in a browser on that machine.
53
+ 2. Sign in with the generated password.
54
+ 3. Create a profile for one harness and select **Activate**.
27
55
 
28
- For a remote SSH server, keep the server bound to loopback and use an SSH tunnel:
56
+ Use `harness-switch status` to see the URL, log, data directory, and password-file location. On macOS and Linux, the default password file is:
57
+
58
+ ```bash
59
+ cat ~/.harness-switch/web_password
60
+ ```
61
+
62
+ ### Accessing a remote machine
63
+
64
+ SSH is optional. When harness-switch runs on a remote or headless host, keep it bound to loopback and forward the port:
29
65
 
30
66
  ```bash
31
67
  ssh -N -L 8787:127.0.0.1:8787 user@your-server
32
68
  ```
33
69
 
34
- Then open <http://127.0.0.1:8787> in your local browser.
70
+ Then open <http://127.0.0.1:8787> in your local browser. Use `harness-switch status`, `stop`, or `server` to inspect, stop, or run the service in the foreground.
35
71
 
36
72
  ### Interface language
37
73
 
38
74
  The web UI supports English and Simplified Chinese. Use the language button in the login page or dashboard header to switch languages. Chinese remains the default for existing behavior; your selection is stored in the browser and is reused on later visits. The setting affects only the web interface—it does not change profile data or generated configuration files.
39
75
 
40
- ## Configuration
76
+ ## Switch a tool
41
77
 
42
78
  Create one or more profiles per harness in the web UI. A profile holds a display name, API Base URL, API key, model, notes, and whatever extra fields that harness needs. Select **Activate** to make a profile current.
43
79
 
44
- Activation writes each tool's own configuration file. Nothing depends on you having sourced a shell script, which is what makes it work for long-lived processes that spawn a CLI as a child.
80
+ Activation writes each tool's own configuration file. Changes apply to the machine where harness-switch runs; it cannot change a tool already running elsewhere.
45
81
 
46
82
  | Harness | File written | Write mode | Takes effect |
47
83
  |---|---|---|---|
@@ -61,22 +97,22 @@ Notes on individual harnesses:
61
97
  - **Pi** (`@earendil-works/pi-coding-agent`) registers a custom provider in `models.json` and points `settings.json` at it via `defaultProvider` / `defaultModel`. The API key must live in that provider entry (or `auth.json`); otherwise Pi shows "No models available" and asks for `/login`. A `--model` flag still overrides the default at runtime.
62
98
  - **DeepSeek Harness** registers a custom `llm-pi-ai` provider, stores the API key in its separate credentials document, and updates `agent-default-model`. Existing sessions keep their selected route; newly created sessions use the activated profile.
63
99
 
64
- `~/.harness-switch/env.sh` remains as a compatibility layer and only contains variables the corresponding tool genuinely honours. It is needed only when a Codex profile uses the environment-variable auth mode:
100
+ `~/.harness-switch/env.sh` is only a compatibility layer for Codex’s environment-variable auth mode:
65
101
 
66
102
  ```bash
67
103
  source ~/.harness-switch/env.sh
68
104
  ```
69
105
 
70
- Two known limitations:
106
+ Keep in mind:
71
107
 
72
108
  - Writing TOML goes through parse and re-serialize, so comments and layout in `config.toml` are lost. YAML and JSON keep their comments and key order.
73
- - The web UI changes files on the **server**. It cannot touch an already-running shell or your local machine.
109
+ - It cannot rewrite the environment of an already-running shell.
74
110
 
75
111
  ### Advanced: taking over the raw file
76
112
 
77
113
  Any field the form does not expose can be set by editing the raw file content in the profile's **Advanced: raw configuration** section. Once edited, that file is generated from your text instead of the form fields until you select **Restore automatic generation**. Content that cannot be parsed back is rejected before it reaches disk.
78
114
 
79
- ### Backups and rollback
115
+ ## Keep changes safe
80
116
 
81
117
  Before every write, the previous content of each target file is snapshotted into `~/.harness-switch/backups/`, keeping the most recent 10. The backup panel restores a snapshot verbatim, comments included. Snapshots never land next to the live file, because tools like Claude Code scan their own config directory.
82
118
 
@@ -86,7 +122,7 @@ Backup directories live in the managed user's own home, so on a root-run service
86
122
 
87
123
  Switching away from a profile first reads the live file back into that profile's record, so edits you made directly in the CLI tool are not lost on the next switch.
88
124
 
89
- ### Operation receipts and undo
125
+ ### Recovery after an interrupted write
90
126
 
91
127
  An in-process `try/catch` only covers a thrown error. A power cut, SIGKILL, OOM or an upgrade restart never gives it the chance to run, and the native config, the profile store and the recorded active profile can be left describing three different states.
92
128
 
@@ -99,11 +135,13 @@ PREPARED → APPLYING → METADATA_COMMITTED → COMMITTED
99
135
 
100
136
  On startup the service settles whatever it finds, for every account it may manage. The boundary that matters is `METADATA_COMMITTED`: by then everything the operation set out to change is already on disk, so it rolls forward to `COMMITTED` rather than undoing a switch the user saw succeed. Anything still at `APPLYING` may be half written and is rolled back whole. A rollback that itself fails is recorded as `DEGRADED` and surfaced in the UI for a human.
101
137
 
102
- Writing `active.json` now happens inside the same transaction as the native files, so the config on disk and the record of what is live can no longer disagree. Each record doubles as a receipt: the files it changed, the backup id, the target user and where it got to. The **Operation log** in the top bar lists them and offers a one-click undo that puts the native files *and* `active.json` back together, rather than just restoring a few files. The undo takes its own snapshot first. Once a backup has been rotated away, its receipt is automatically marked as no longer undoable.
138
+ Writing `active.json` now happens inside the same transaction as the native files, so the config on disk and the record of what is live can no longer disagree. Each record doubles as a receipt: the files it changed, the backup id, the target user and where it got to. Each harness’s right-hand **Operation history** card lists them and offers a one-click undo that puts the native files *and* `active.json` back together, rather than just restoring a few files. The undo takes its own snapshot first. Once a backup has been rotated away, its receipt is automatically marked as no longer undoable.
103
139
 
104
140
  `HSW_JOURNAL_RETAIN` controls how many receipts are kept; the default is 50.
105
141
 
106
- ### Importing configuration you already have
142
+ ## Bring in and move configuration
143
+
144
+ ### Import configuration you already have
107
145
 
108
146
  If you configured these tools by hand before installing harness-switch, **Import existing config** in the top bar adopts that setup instead of making you retype it.
109
147
 
@@ -113,17 +151,17 @@ Each candidate is decided on its own: store it as a standalone profile, or extra
113
151
 
114
152
  **Neither the scan nor the import touches the tools' own config files.** An import writes only to harness-switch's own profile store and vault; making it take effect still requires an explicit activation. A config file that exists but cannot be parsed causes that tool to be skipped with a reason, rather than guessed at.
115
153
 
116
- ### Moving every profile to another machine
154
+ ### Move profiles to another machine
117
155
 
118
- Use **Import / Export** in the top bar to create one `.hsw-backup` file containing every Harness profile, API key, raw-file override, and current activation choice. The bundle is encrypted with a migration password you choose, so it does not depend on the source machine's `aes-256-gcm.key`.
156
+ Use **Import / Export** in the top bar to create one `.hsw-backup` file containing every Harness profile, Provider Vault credential and endpoint, API key, raw-file override, and current activation choice. The bundle is encrypted with a migration password you choose, so it does not depend on the source machine's `aes-256-gcm.key`.
119
157
 
120
- On the destination machine, select the bundle and enter the migration password. The UI shows profile counts and same-name conflicts before it writes anything. Import keeps destination profiles by default; overwriting is an explicit choice. Restoring the exported activation state is optional.
158
+ On the destination machine, select the bundle and enter the migration password. The UI shows profile counts, credential counts, and same-name profile conflicts before it writes anything. Import keeps destination profiles by default; overwriting is an explicit choice. Provider Vault entries are always restored as isolated copies and never replace a destination credential; an ID conflict gets a new imported ID, and imported profiles reference that copy. Restoring the exported activation state is optional.
121
159
 
122
160
  A Codex official-login cache (`$CODEX_HOME/auth.json`) is **excluded by default**. When a valid cache is available, you may explicitly include it in the encrypted bundle. Import offers the separate migration choice only when the bundled and destination JSON values differ. This carries a reusable Codex/ChatGPT login session: share such a bundle only with a trusted recipient, and expect upstream expiry or revocation to still require a fresh `codex login`. An existing destination cache is backed up before replacement; copied caches are written as the destination user with mode `0600`.
123
161
 
124
162
  Keep the migration password separately from the bundle. It cannot be recovered from the export file.
125
163
 
126
- ### Provider Vault: shared credentials
164
+ ### Reuse credentials with Provider Vault
127
165
 
128
166
  The **Provider Vault** stores an API key once under a named entry with one or more named endpoints (each a base URL), encrypted with the same AES-256-GCM key that protects `profiles.json`. A profile can reference a vault entry instead of carrying its own key:
129
167
 
@@ -132,9 +170,11 @@ The **Provider Vault** stores an API key once under a named entry with one or mo
132
170
  - An entry that is referenced by any profile cannot be deleted (HTTP `409`).
133
171
  - Detach a profile by clearing the provider selection in the profile form; the cached key stays as the profile's own inline key.
134
172
 
135
- ### Configuration drift
173
+ ## Verify and repair configuration
136
174
 
137
- The dashboard's **Configuration drift** panel compares what the active profile would render against the actual files on disk, using parsed-value comparison for JSON/TOML/YAML so a re-render that only reorders keys does not count as drift. Each file is reported as:
175
+ ### Detect configuration drift
176
+
177
+ The dashboard **Diagnostics** panel also compares what the active profile would render against the actual files on disk, using parsed-value comparison for JSON/TOML/YAML so a re-render that only reorders keys does not count as drift. Each file is reported as:
138
178
 
139
179
  - `in-sync` — disk matches what the profile would write,
140
180
  - `drifted` — disk differs from what the profile would write,
@@ -147,15 +187,17 @@ Two repair actions are offered per harness:
147
187
  - **Re-apply** rewrites the live files from the active profile, with the usual backup-before-write and all-or-nothing rollback.
148
188
  - **Adopt live configuration** reads the live files back into the profile record (same path as the pre-switch backfill). It refuses with `409` when the profile has manual raw overrides, and never adopts content the tool itself could not parse.
149
189
 
150
- ### Diagnostics (Doctor)
190
+ ### Run diagnostics
151
191
 
152
- The **Diagnostics (Doctor)** panel runs read-only checks per harness: whether the tool's CLI is on `PATH` (`install`), whether each target's config directory exists (`configDir`), whether each target file exists and is readable/writable (`files`, with a warning when a config file holding credentials is group/other-readable), whether the files parse (`parse`), and whether live state drifts from the active profile (`drift`). A global update check reports whether a newer release exists (`updatedAvailable`).
192
+ **Diagnostics (Doctor)** run per harness from that tool’s right-hand column: for CLI-delivered tools, whether the executable is on `PATH` (`install`; skipped for web-service harnesses such as DeepSeek Harness), whether each target file exists and is readable/writable (`files`, with a warning when a config file holding credentials is group/other-readable), whether the files parse (`parse`), and whether live state drifts from the active profile (`drift`). A global update check reports whether a newer release exists (`updatedAvailable`).
153
193
 
154
194
  The connectivity probe is **disabled by default in the MVP**: passing `--probe` only records a `unknown`-status check that reports the active base URL and explains that no network request is made.
155
195
 
156
- ### Local Unix users
196
+ ## Manage local Unix users
197
+
198
+ This optional multi-user feature is for Unix-like hosts. On Windows, harness-switch manages the account that starts it.
157
199
 
158
- The dashboard header can switch between local login users such as `root` and `alice`. Each user has independent profiles, Provider Vault, encryption key, active state and backups under their own home. Selecting a user does not write any harness file; only an explicit activation does.
200
+ The account menu at the right of the dashboard header switches between local login users such as `root` and `alice`, and keeps sign-out alongside those identity actions. Each user has independent profiles, Provider Vault, encryption key, active state and backups under their own home. Selecting a user does not write any harness file; only an explicit activation does.
159
201
 
160
202
  “Sync user config” performs a one-time copy of another user's profiles and referenced Provider Vault credentials into the selected user. Secrets are decrypted only on the server and re-encrypted with the destination user's local key. Active state, backups and native config files are not copied. Same-name profiles are skipped by default and can be explicitly overwritten.
161
203
 
@@ -163,17 +205,24 @@ A source user's Codex official-login cache (`auth.json`) is the sole optional ex
163
205
 
164
206
  Cross-user writes require access to the destination home. Managing both `root` and regular users therefore normally requires running harness-switch as root; newly created files and directories are assigned to the destination UID/GID. The Web password then grants control over every exposed user's configs, so keep the loopback bind and SSH tunnel. Use `HSW_USERS=root,alice` to restrict the manageable accounts.
165
207
 
166
- ### CLI automation
208
+ ## Automate with the CLI
167
209
 
168
- The same business logic is available from the terminal without opening the browser or starting any listener: the CLI builds the same service graph in-process and reads/writes the same data directory, so it works even when the daemon is not running. Every command supports `--json` for scripting:
210
+ The CLI talks to the running local daemon and uses the same authenticated HTTP API as the Web UI. Start the daemon once before using API-backed commands. `help` and `version` work offline; data commands support `--json` (or `-j`) for scripting:
169
211
 
170
212
  ```bash
171
213
  harness-switch list # harnesses, active profile, profile counts
214
+ harness-switch profiles [claude] # secret-free profile list, optionally filtered
215
+ harness-switch create claude main \
216
+ --base-url https://api.example.com/v1 \
217
+ --model claude-sonnet-4-5 \
218
+ --api-key-env ANTHROPIC_TOKEN # safer than putting a key in shell history
172
219
  harness-switch providers # Provider Vault entries
173
220
  harness-switch doctor # read-only diagnostics
174
- harness-switch doctor --probe --harness claude
175
- harness-switch plan claude # drift inspection for a harness
221
+ harness-switch doctor --strict --harness claude # exit 1 if a check has error status
222
+ harness-switch plan claude main # exact native files activation would write
176
223
  harness-switch activate claude main --yes # activate a profile
224
+ harness-switch official claude --yes # return to the tool's built-in login
225
+ harness-switch delete claude old --yes # inactive profiles only
177
226
  harness-switch users # manageable local Unix users
178
227
  harness-switch list --user alice # inspect alice's independent store
179
228
  harness-switch activate codex main --user alice --yes
@@ -187,7 +236,9 @@ harness-switch operations # operation receipts, newest first
187
236
  harness-switch undo <operation-id> # revert one complete operation
188
237
  ```
189
238
 
190
- `plan <harness>` prints the drift inspection of the active profile (expected vs. current content per file); without an active profile it reports `status: unknown`. `activate` prompts for confirmation on a TTY and requires `--yes` in non-interactive terminals (CI). JSON output mirrors the HTTP API response shapes (`HarnessesResponse`, `ProvidersResponse`, `DoctorResponse`, `DriftSummary`, `ActivateResponse`), so scripts can reuse the same field names. `HSW_DATA_DIR` and `HSW_HOME_DIR` override where it reads state (defaults: `~/.harness-switch` and `$HOME`).
239
+ `plan <harness> <profile>` includes exact rendered content and therefore may include an API key. Mutating commands prompt on a TTY and require `--yes` in non-interactive terminals (CI). Prefer `--api-key-env VAR` to `--api-key VALUE` so credentials do not enter shell history or the process list. Run `harness-switch help` for the complete command reference. `HSW_URL` selects a non-default local endpoint; `HSW_DATA_DIR` tells the CLI where to find `web_password`.
240
+
241
+ JSON failures retain the HTTP status and stable server error code when available. Each CLI invocation logs out its temporary API session before exiting, so repeated automation does not grow the persisted Web session table.
191
242
 
192
243
  ## Security
193
244
 
@@ -207,6 +258,7 @@ This protects against accidental plaintext disclosure in profile storage, but do
207
258
  |---|---:|---|
208
259
  | `HOST` | `127.0.0.1` | Bind address. Keep the default when using SSH tunnelling. |
209
260
  | `PORT` | `8787` | Listening port. |
261
+ | `HSW_URL` | `http://127.0.0.1:$PORT` | Base URL used by API-backed CLI commands. |
210
262
  | `HSW_DATA_DIR` | `~/.harness-switch` | Control-plane and service-owner data directory; other users use `.harness-switch` in their own home. |
211
263
  | `HSW_HOME_DIR` | `$HOME` | Service owner's home override, mainly for tests and containers. |
212
264
  | `HSW_USERS` | auto-discovered | Comma-separated allowlist such as `root,alice`. The service owner is always manageable. |
@@ -239,6 +291,7 @@ The UI is a React SPA. Authentication uses an HttpOnly `hsw_session` cookie.
239
291
  | `DELETE` | `/api/harnesses/:id/profiles/:name` | Delete; `409` for the active profile |
240
292
  | `GET` | `/api/harnesses/:id/profiles/:name/preview` | The exact content that would be written |
241
293
  | `POST` | `/api/harnesses/:id/profiles/:name/activate` | Write the native config, then commit the switch |
294
+ | `POST` | `/api/harnesses/:id/official/activate` | Return a supported harness to its built-in account login |
242
295
  | `GET` | `/api/backups` | Snapshots, newest first |
243
296
  | `POST` | `/api/backups/:id/restore` | Restore a snapshot verbatim |
244
297
  | `POST` | `/api/transfer/export` | Create a passphrase-encrypted portable bundle |
@@ -254,38 +307,39 @@ The UI is a React SPA. Authentication uses an HttpOnly `hsw_session` cookie.
254
307
  | `GET` | `/api/doctor` | Read-only diagnostics (`?probe=1` includes the MVP-disabled, non-network probe check) |
255
308
  | `GET` | `/api/scan` | Providers the five tools already have on disk; read-only, credentials masked |
256
309
  | `POST` | `/api/scan/import` | Save selected candidates as profiles or vault entries; the tools' own config is untouched |
257
- | `GET` | `/api/operations` | Operation receipts, newest first |
310
+ | `GET` | `/api/operations` | Operation receipts, newest first (`?harness=claude` to filter) |
258
311
  | `GET` | `/api/operations/:id` | One receipt |
259
312
  | `POST` | `/api/operations/:id/undo` | Put the native files and the active profile back to before that operation |
260
313
 
261
314
  Every POST/PATCH body is validated against a shared Zod schema (`packages/shared/src/schemas.ts`) that the server and the web client both build on. A malformed shape is rejected with a `400` naming the field *before* it reaches storage, instead of being persisted and only surfacing as a `500` on the next activation. Unknown fields are dropped rather than rejected, so an older client keeps working while nothing unrecognised enters the store.
262
315
 
263
- ## Background daemon (bunx / npx)
316
+ ## Background daemon (npx / pnpm / Bun)
264
317
 
265
318
  The published CLI runs as a background daemon by default: the command returns
266
319
  immediately, the server keeps running after the terminal is closed, and
267
320
  re-running after a release restarts the daemon on the newest version.
268
321
 
269
322
  ```bash
270
- bunx @seaveyon/harness-switch@latest # start, or update + restart the daemon
271
- bunx @seaveyon/harness-switch@latest status # pid, url, log path
272
- bunx @seaveyon/harness-switch@latest stop # stop the daemon
273
- bunx @seaveyon/harness-switch@latest server # run in the foreground instead
274
- bunx @seaveyon/harness-switch@latest list # CLI automation (see above)
323
+ npx -y @seaveyon/harness-switch@latest # start, or update + restart the daemon
324
+ npx -y @seaveyon/harness-switch@latest status # pid, url, log path
325
+ npx -y @seaveyon/harness-switch@latest stop # stop the daemon
326
+ npx -y @seaveyon/harness-switch@latest server # run in the foreground instead
327
+ npx -y @seaveyon/harness-switch@latest list # CLI automation (see above)
275
328
  ```
276
329
 
277
- `npx -y @seaveyon/harness-switch@latest` works the same way. Append `@latest`
278
- so `bunx`/`npx` fetch the newest release before running.
330
+ Replace `npx -y` with `pnpm dlx`, `pnpx`, or `bunx` as preferred. Append `@latest`
331
+ so the package runner fetches the newest release before running. The same executable supports both Node.js and Bun; use `node dist/harness-switch.js` or `bun dist/harness-switch.js` when running an installed build directly.
279
332
 
280
- The daemon writes its pid to `~/.harness-switch/daemon.pid` and its log to
333
+ The daemon writes its PID, instance identity, and listening address to `~/.harness-switch/daemon.pid` and its log to
281
334
  `~/.harness-switch/daemon.log` (a fresh log per start). The first run creates
282
335
  the web password in `~/.harness-switch/web_password` and prints it to the log.
283
336
  When a daemon is already running, a new invocation stops it before starting the
284
337
  new process, so the port never conflicts and the newest code wins.
285
338
 
339
+ Startup reports success only after the new process answers `/healthz`. `status` returns a non-zero exit code when the recorded daemon is not healthy. Before `stop` or an update sends a signal, the recorded instance identity is verified so a stale, reused PID cannot terminate an unrelated process.
340
+
286
341
  The dashboard polls the npm registry and shows a one-click **update button**
287
- next to the version badge when a newer release exists; it runs the same
288
- `bunx <package>@latest` restart under the hood and reloads the page once the
342
+ next to the version badge when a newer release exists; it uses `npx -y` under Node.js or `bun x` under Bun to restart, then reloads the page once the
289
343
  new version is up. Update logs land in `~/.harness-switch/update.log`.
290
344
 
291
345
  Under systemd (or any supervisor), run the CLI in the foreground instead: