@contextecf/guardian-cli 0.1.3 → 0.1.5
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 +93 -15
- package/dist/packages/guardian-cli/src/bin.js +1036 -43
- package/dist/packages/guardian-cli/src/index.js +882 -39
- package/dist/packages/guardian-cli/src/runtime.d.ts +214 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -16,6 +16,7 @@ Then open the Control Tower in your default browser:
|
|
|
16
16
|
|
|
17
17
|
```bash
|
|
18
18
|
guardian launch
|
|
19
|
+
guardian open
|
|
19
20
|
```
|
|
20
21
|
|
|
21
22
|
The same daemon-backed launch path is also available as:
|
|
@@ -44,8 +45,8 @@ guardian setup
|
|
|
44
45
|
guardian doctor
|
|
45
46
|
guardian readiness
|
|
46
47
|
guardian launch
|
|
47
|
-
guardian status
|
|
48
48
|
guardian open
|
|
49
|
+
guardian status
|
|
49
50
|
guardian policy list
|
|
50
51
|
guardian marketplace list
|
|
51
52
|
guardian posture list
|
|
@@ -59,11 +60,11 @@ guardian desktop execute --input=/path/to/approved-action.json --yes
|
|
|
59
60
|
`guardian setup` is the one-command first-run path after `npm install -g` or
|
|
60
61
|
through `npx`. It creates or reuses the local profile, keeps local-first privacy
|
|
61
62
|
defaults, runs doctor/data checks, writes Guardian-owned MCP snippets under the
|
|
62
|
-
Guardian profile directory, starts or reuses the local daemon,
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
or write external AI tool config unless the user runs the explicit
|
|
66
|
-
commands.
|
|
63
|
+
Guardian profile directory, starts or reuses the local daemon, and returns
|
|
64
|
+
browser-extension setup guidance without printing the runtime token. It opens
|
|
65
|
+
the Control Tower only when `--open` is supplied. It does not install the native
|
|
66
|
+
host manifest or write external AI tool config unless the user runs the explicit
|
|
67
|
+
follow-up commands.
|
|
67
68
|
|
|
68
69
|
`guardian extension native-host install --extension-id=<id>` writes the
|
|
69
70
|
Guardian browser native messaging helper and manifest. On macOS/Linux it writes
|
|
@@ -75,15 +76,15 @@ launcher, and manifest under `GUARDIAN_HOME/native-host`, then prints exact HKCU
|
|
|
75
76
|
token-free proof that `guardian extension native-host status --json` can verify.
|
|
76
77
|
|
|
77
78
|
`guardian launch`, `guardian tower`, and `guardian control-tower` start or reuse
|
|
78
|
-
the local daemon and
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
`guardian
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
`guardian tower --
|
|
86
|
-
|
|
79
|
+
the local daemon and print the Control Tower URL. During the MVP, that daemon
|
|
80
|
+
exposes a lightweight metadata-only status page at the default URL. Re-running
|
|
81
|
+
`guardian launch`, `guardian tower`, `guardian control-tower`, or
|
|
82
|
+
`guardian start` first checks the requested authenticated loopback health
|
|
83
|
+
endpoint and reuses the existing daemon when it is already reachable. Use
|
|
84
|
+
`guardian daemon serve` when you want the foreground developer process instead.
|
|
85
|
+
Use `guardian launch --open`, `guardian tower --open`, or
|
|
86
|
+
`guardian control-tower --open` when you also want to open the URL in the
|
|
87
|
+
default browser.
|
|
87
88
|
|
|
88
89
|
`guardian open` launches the already configured local Control Tower URL in the
|
|
89
90
|
default browser without starting the daemon. It uses the installed
|
|
@@ -185,6 +186,31 @@ Guardian starts local-first:
|
|
|
185
186
|
- local app autopilot off
|
|
186
187
|
- metadata-only receipts by default
|
|
187
188
|
|
|
189
|
+
## Troubleshooting
|
|
190
|
+
|
|
191
|
+
Run `guardian doctor` first for most of these — it reports pass/warn/fail for
|
|
192
|
+
the local profile, runtime token, Node.js version, service supervision, and OS
|
|
193
|
+
key storage in one pass. `guardian status` reports live daemon health,
|
|
194
|
+
including a stale-daemon-version hint.
|
|
195
|
+
|
|
196
|
+
| Symptom | Likely cause | Fix |
|
|
197
|
+
| -------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
198
|
+
| `guardian doctor` reports the `node-runtime` check as `warn` | Node.js is older than the 20.20.0 floor this CLI requires | Upgrade to Node 20.20+ or Node 22 LTS. Node 22 is the runtime used for the Docker demo and CI clean-room install smoke; Node 20.20+ is the supported floor for everyone else. Re-run `guardian doctor` after upgrading. |
|
|
199
|
+
| `guardian launch`/`guardian start` fails with "another daemon or container ... rejected this profile's local runtime token" | Something else (often a stale Guardian daemon, or the Docker demo container) already holds port 4317 | Guardian already tries the next 7 ports automatically. If it still fails, stop the other process/container and retry, or run `guardian launch --port=4318` (or the port the error message suggests) directly. `guardian status` and `docker ps --filter publish=4317` help identify what's holding the port. |
|
|
200
|
+
| `guardian status` reports daemon status `unauthorized`, or any Guardian admin request returns `401 unauthorized` | The runtime token on disk (`GUARDIAN_HOME/runtime-token`) doesn't match the token the running daemon expects — usually a leftover daemon from before a `guardian install`/profile reset | Run `guardian stop`, then `guardian launch --port=4322` (or another free port), then `guardian status` to confirm it's reachable and authorized again. |
|
|
201
|
+
| `guardian status` shows a `daemonVersionMismatch` block (or, in text output, "Daemon version: ... (this CLI is ... — versions differ, ...)") | Usually the CLI was upgraded (`npm install -g @contextecf/guardian-cli@latest`) while a daemon started by the previous version was still running — the same applies in reverse after a downgrade | Run `guardian stop && guardian launch` to restart the daemon under the current version. This is informational only — Guardian never auto-restarts a running daemon or auto-trusts a stale token on your behalf. |
|
|
202
|
+
| `npm publish`/release automation fails with an OTP or auth prompt maintainers don't recognize | This is a release-maintainer concern, not an end-user CLI issue — it's about the npm account publishing `@contextecf/guardian-cli`, not the installed CLI | See `scripts/collect-guardian-npm-auth-preflight.mjs` (repo root) and the Release Owner Commands section below. Never paste an OTP or npm token into `guardian` CLI commands or Guardian issues/logs. |
|
|
203
|
+
| The browser extension shows "not paired" or can't reach the daemon | The extension doesn't have the local runtime token yet | Run `guardian daemon pair --json` to print a one-time pairing payload, then `guardian extension open-setup` to walk through connecting it. The token is only ever printed by this explicit command. |
|
|
204
|
+
| Native messaging fails, or the extension can't launch the native host | The native messaging manifest isn't installed for your browser (and on Windows, isn't registered in HKCU) | Run `guardian extension native-host install --extension-id=<id>`. On Windows, add `--write-registry --yes` to also perform the HKCU registration. Verify with `guardian extension native-host status --json`. |
|
|
205
|
+
| The daemon doesn't survive a reboot, or you want it to run without keeping a terminal open | Guardian isn't registered with your OS's service supervisor | Run `guardian service install` to register a `launchd` (macOS), `systemd` (Linux), or Windows Task Scheduler entry. `guardian doctor`'s `service-supervision` check confirms it's registered. |
|
|
206
|
+
| `guardian doctor`'s `os-key-storage` check reports `warn` or `fail` | No local-data encryption key has been stored via the OS credential vault yet | Run `guardian key-store install --yes` and supply the secret via stdin (never as a CLI argument). Check with `guardian key-store status`. |
|
|
207
|
+
|
|
208
|
+
None of the above changes what Guardian trusts by default: raw content
|
|
209
|
+
capture, cloud sync, and local app autopilot stay off until you explicitly
|
|
210
|
+
enable them, and a rejected or stale runtime token is never auto-accepted —
|
|
211
|
+
every fix above requires an explicit `guardian stop`/`guardian launch` or
|
|
212
|
+
install step.
|
|
213
|
+
|
|
188
214
|
## Package Boundary
|
|
189
215
|
|
|
190
216
|
The npm package publishes bundled CLI/runtime JavaScript, TypeScript
|
|
@@ -196,6 +222,47 @@ the monorepo. The native SQLite adapter remains a normal
|
|
|
196
222
|
Source files, source maps, and source-controlled release gates remain in the
|
|
197
223
|
private repository and should be validated before broad distribution.
|
|
198
224
|
|
|
225
|
+
## Release Owner Commands
|
|
226
|
+
|
|
227
|
+
Release owners can ask the installed CLI for the same operator flow used in the
|
|
228
|
+
repo:
|
|
229
|
+
|
|
230
|
+
```bash
|
|
231
|
+
guardian release
|
|
232
|
+
guardian release checklist --version=0.1.4
|
|
233
|
+
guardian release flow --version=0.1.4
|
|
234
|
+
guardian release command --version=0.1.4
|
|
235
|
+
guardian release command --version=0.1.4 --publish
|
|
236
|
+
guardian release verify --version=0.1.4
|
|
237
|
+
guardian release paste --version=0.1.4
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
`guardian release flow --version=<version>` prints the full release-owner order
|
|
241
|
+
in one screen: checklist, secret setup, dry-run dispatch, guarded publish
|
|
242
|
+
dispatch, post-publish verification, local smoke, and browser-store handoff.
|
|
243
|
+
|
|
244
|
+
`guardian release command --version=<version> --publish` prints the copy-ready
|
|
245
|
+
GitHub Actions dispatch command, including `dry_run=false` and the docker smoke
|
|
246
|
+
flag. It does not print npm tokens or run the workflow locally.
|
|
247
|
+
|
|
248
|
+
After npm publication, `guardian release paste --version=<version>` prints only
|
|
249
|
+
the local smoke commands:
|
|
250
|
+
|
|
251
|
+
```bash
|
|
252
|
+
npm view @contextecf/guardian-cli@0.1.4 version --registry=https://registry.npmjs.org/
|
|
253
|
+
npm install -g @contextecf/guardian-cli@0.1.4
|
|
254
|
+
guardian --version
|
|
255
|
+
guardian stop
|
|
256
|
+
guardian setup
|
|
257
|
+
guardian launch
|
|
258
|
+
guardian open
|
|
259
|
+
guardian status
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
That paste block proves public npm visibility and first-run usability for the
|
|
263
|
+
preview CLI lane only. It does not close signed-installer, browser-store,
|
|
264
|
+
high-risk desktop action, or autonomous local app production gates.
|
|
265
|
+
|
|
199
266
|
Release operators can run `npm run guardian:release:doctor` from the repo root
|
|
200
267
|
for the complete protected-release doctor before publishing. For a release
|
|
201
268
|
candidate artifact, set `GUARDIAN_RELEASE_CANDIDATE=/path/to/artifact.zip` and
|
|
@@ -216,3 +283,14 @@ When an installed profile contains `release/release-evidence.json`,
|
|
|
216
283
|
allowlist, source/source-map exclusions, unpublished workspace import boundary,
|
|
217
284
|
and checksum manifest. `guardian status --json` surfaces the same
|
|
218
285
|
metadata-only release-evidence state without printing runtime tokens.
|
|
286
|
+
|
|
287
|
+
Before deciding whether a release is warranted, run
|
|
288
|
+
`npm run guardian:release:change-summary -- --from=<previous-version-ref> --to=HEAD`
|
|
289
|
+
(repo root, monorepo checkout only — the published CLI has no git history to
|
|
290
|
+
read once installed). It reports the resolved `guardian-cli` version at each
|
|
291
|
+
ref, the Guardian-relevant files and commits between them, any
|
|
292
|
+
`release/evidence/` artifacts that changed, the current not-proven production
|
|
293
|
+
gates, and recommended next steps. It is metadata-only: it never runs
|
|
294
|
+
`npm publish` and never reads or prints npm tokens, OTP values, or `.npmrc`
|
|
295
|
+
contents. Add `--json` for machine-readable output or `--output <path>` to
|
|
296
|
+
write the report to a file.
|