@vigilbase/cli 0.1.4 → 0.2.1

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.
Files changed (191) hide show
  1. package/CLOUDFLARE.md +3 -4
  2. package/COMMANDS.md +158 -83
  3. package/LOCAL.md +721 -0
  4. package/ONE.md +2 -4
  5. package/README.md +341 -123
  6. package/SECURITY.md +2 -2
  7. package/dist/auth/device-auth.d.ts +0 -1
  8. package/dist/auth/device-auth.js +13 -8
  9. package/dist/auth/index.d.ts +4 -2
  10. package/dist/auth/index.js +3 -2
  11. package/dist/auth/provider.d.ts +18 -0
  12. package/dist/auth/provider.js +71 -0
  13. package/dist/auth/refresh.d.ts +29 -0
  14. package/dist/auth/refresh.js +199 -0
  15. package/dist/auth/store.d.ts +103 -4
  16. package/dist/auth/store.js +400 -74
  17. package/dist/auth/token-metadata.d.ts +9 -0
  18. package/dist/auth/token-metadata.js +21 -0
  19. package/dist/auth/types.d.ts +8 -2
  20. package/dist/auth/types.js +0 -1
  21. package/dist/bin.d.ts +0 -1
  22. package/dist/bin.js +0 -1
  23. package/dist/cli.d.ts +4 -2
  24. package/dist/cli.js +45 -15
  25. package/dist/commands/account.d.ts +0 -1
  26. package/dist/commands/account.js +0 -1
  27. package/dist/commands/auth.d.ts +0 -1
  28. package/dist/commands/auth.js +82 -22
  29. package/dist/commands/billing.d.ts +0 -1
  30. package/dist/commands/billing.js +0 -1
  31. package/dist/commands/cloudflare.d.ts +1 -2
  32. package/dist/commands/cloudflare.js +6 -6
  33. package/dist/commands/helpers.d.ts +15 -1
  34. package/dist/commands/helpers.js +2 -3
  35. package/dist/commands/index.d.ts +3 -2
  36. package/dist/commands/index.js +6 -2
  37. package/dist/commands/legacy-validation.d.ts +0 -1
  38. package/dist/commands/legacy-validation.js +0 -1
  39. package/dist/commands/local.d.ts +35 -0
  40. package/dist/commands/local.js +1543 -0
  41. package/dist/commands/one.d.ts +0 -1
  42. package/dist/commands/one.js +6 -7
  43. package/dist/commands/public-tools.d.ts +0 -1
  44. package/dist/commands/public-tools.js +55 -17
  45. package/dist/commands/runs.d.ts +0 -1
  46. package/dist/commands/runs.js +0 -1
  47. package/dist/commands/security.d.ts +1 -2
  48. package/dist/commands/security.js +1 -2
  49. package/dist/commands/watchdog.d.ts +0 -1
  50. package/dist/commands/watchdog.js +0 -1
  51. package/dist/index.d.ts +3 -3
  52. package/dist/index.js +1 -2
  53. package/dist/lib/banner.d.ts +0 -1
  54. package/dist/lib/banner.js +0 -1
  55. package/dist/lib/client.d.ts +4 -2
  56. package/dist/lib/client.js +42 -18
  57. package/dist/lib/cloudflare-client.d.ts +0 -1
  58. package/dist/lib/cloudflare-client.js +0 -1
  59. package/dist/lib/config.d.ts +31 -3
  60. package/dist/lib/config.js +72 -13
  61. package/dist/lib/format.d.ts +2 -1
  62. package/dist/lib/format.js +27 -7
  63. package/dist/lib/help.d.ts +1 -2
  64. package/dist/lib/help.js +37 -17
  65. package/dist/lib/network.d.ts +10 -1
  66. package/dist/lib/network.js +33 -5
  67. package/dist/lib/one-client.d.ts +5 -3
  68. package/dist/lib/one-client.js +49 -3
  69. package/dist/lib/one-operations.d.ts +0 -1
  70. package/dist/lib/one-operations.js +0 -1
  71. package/dist/lib/open-url.d.ts +0 -1
  72. package/dist/lib/open-url.js +0 -1
  73. package/dist/lib/platform.d.ts +2 -0
  74. package/dist/lib/platform.js +4 -0
  75. package/dist/lib/progress.d.ts +0 -1
  76. package/dist/lib/progress.js +0 -1
  77. package/dist/lib/security-client.d.ts +1 -2
  78. package/dist/lib/security-client.js +0 -1
  79. package/dist/lib/skill-fetch.d.ts +0 -1
  80. package/dist/lib/skill-fetch.js +0 -1
  81. package/dist/lib/system-trust.d.ts +0 -1
  82. package/dist/lib/system-trust.js +0 -1
  83. package/dist/lib/tui.d.ts +308 -0
  84. package/dist/lib/tui.js +846 -0
  85. package/dist/local/cloudflare-checkup/cf/allowlist.d.ts +94 -0
  86. package/dist/local/cloudflare-checkup/cf/allowlist.js +183 -0
  87. package/dist/local/cloudflare-checkup/cf/auth-lifecycle.d.ts +112 -0
  88. package/dist/local/cloudflare-checkup/cf/auth-lifecycle.js +312 -0
  89. package/dist/local/cloudflare-checkup/cf/child-env.d.ts +31 -0
  90. package/dist/local/cloudflare-checkup/cf/child-env.js +80 -0
  91. package/dist/local/cloudflare-checkup/cf/install.d.ts +105 -0
  92. package/dist/local/cloudflare-checkup/cf/install.js +308 -0
  93. package/dist/local/cloudflare-checkup/cf/locate.d.ts +43 -0
  94. package/dist/local/cloudflare-checkup/cf/locate.js +227 -0
  95. package/dist/local/cloudflare-checkup/cf/run-cf.d.ts +88 -0
  96. package/dist/local/cloudflare-checkup/cf/run-cf.js +274 -0
  97. package/dist/local/cloudflare-checkup/collector.d.ts +47 -0
  98. package/dist/local/cloudflare-checkup/collector.js +295 -0
  99. package/dist/local/cloudflare-checkup/contract.d.ts +2804 -0
  100. package/dist/local/cloudflare-checkup/contract.js +1620 -0
  101. package/dist/local/cloudflare-checkup/email-verification.d.ts +124 -0
  102. package/dist/local/cloudflare-checkup/email-verification.js +211 -0
  103. package/dist/local/cloudflare-checkup/errors.d.ts +29 -0
  104. package/dist/local/cloudflare-checkup/errors.js +103 -0
  105. package/dist/local/cloudflare-checkup/output.d.ts +23 -0
  106. package/dist/local/cloudflare-checkup/output.js +88 -0
  107. package/dist/local/cloudflare-checkup/prompts.d.ts +40 -0
  108. package/dist/local/cloudflare-checkup/prompts.js +139 -0
  109. package/dist/local/cloudflare-checkup/rate-budget.d.ts +41 -0
  110. package/dist/local/cloudflare-checkup/rate-budget.js +79 -0
  111. package/dist/local/cloudflare-checkup/snapshot-file.d.ts +52 -0
  112. package/dist/local/cloudflare-checkup/snapshot-file.js +185 -0
  113. package/dist/local/cloudflare-checkup/submit-client.d.ts +112 -0
  114. package/dist/local/cloudflare-checkup/submit-client.js +395 -0
  115. package/dist/local/cloudflare-checkup/terminal-ui.d.ts +170 -0
  116. package/dist/local/cloudflare-checkup/terminal-ui.js +403 -0
  117. package/dist/types.d.ts +25 -3
  118. package/dist/types.js +16 -1
  119. package/dist/version.d.ts +0 -1
  120. package/dist/version.js +0 -1
  121. package/package.json +12 -12
  122. package/dist/auth/device-auth.d.ts.map +0 -1
  123. package/dist/auth/device-auth.js.map +0 -1
  124. package/dist/auth/index.d.ts.map +0 -1
  125. package/dist/auth/index.js.map +0 -1
  126. package/dist/auth/store.d.ts.map +0 -1
  127. package/dist/auth/store.js.map +0 -1
  128. package/dist/auth/types.d.ts.map +0 -1
  129. package/dist/auth/types.js.map +0 -1
  130. package/dist/bin.d.ts.map +0 -1
  131. package/dist/bin.js.map +0 -1
  132. package/dist/cli.d.ts.map +0 -1
  133. package/dist/cli.js.map +0 -1
  134. package/dist/commands/account.d.ts.map +0 -1
  135. package/dist/commands/account.js.map +0 -1
  136. package/dist/commands/auth.d.ts.map +0 -1
  137. package/dist/commands/auth.js.map +0 -1
  138. package/dist/commands/billing.d.ts.map +0 -1
  139. package/dist/commands/billing.js.map +0 -1
  140. package/dist/commands/cloudflare.d.ts.map +0 -1
  141. package/dist/commands/cloudflare.js.map +0 -1
  142. package/dist/commands/helpers.d.ts.map +0 -1
  143. package/dist/commands/helpers.js.map +0 -1
  144. package/dist/commands/index.d.ts.map +0 -1
  145. package/dist/commands/index.js.map +0 -1
  146. package/dist/commands/legacy-validation.d.ts.map +0 -1
  147. package/dist/commands/legacy-validation.js.map +0 -1
  148. package/dist/commands/one.d.ts.map +0 -1
  149. package/dist/commands/one.js.map +0 -1
  150. package/dist/commands/public-tools.d.ts.map +0 -1
  151. package/dist/commands/public-tools.js.map +0 -1
  152. package/dist/commands/runs.d.ts.map +0 -1
  153. package/dist/commands/runs.js.map +0 -1
  154. package/dist/commands/security.d.ts.map +0 -1
  155. package/dist/commands/security.js.map +0 -1
  156. package/dist/commands/watchdog.d.ts.map +0 -1
  157. package/dist/commands/watchdog.js.map +0 -1
  158. package/dist/index.d.ts.map +0 -1
  159. package/dist/index.js.map +0 -1
  160. package/dist/lib/banner.d.ts.map +0 -1
  161. package/dist/lib/banner.js.map +0 -1
  162. package/dist/lib/client.d.ts.map +0 -1
  163. package/dist/lib/client.js.map +0 -1
  164. package/dist/lib/cloudflare-client.d.ts.map +0 -1
  165. package/dist/lib/cloudflare-client.js.map +0 -1
  166. package/dist/lib/config.d.ts.map +0 -1
  167. package/dist/lib/config.js.map +0 -1
  168. package/dist/lib/format.d.ts.map +0 -1
  169. package/dist/lib/format.js.map +0 -1
  170. package/dist/lib/help.d.ts.map +0 -1
  171. package/dist/lib/help.js.map +0 -1
  172. package/dist/lib/network.d.ts.map +0 -1
  173. package/dist/lib/network.js.map +0 -1
  174. package/dist/lib/one-client.d.ts.map +0 -1
  175. package/dist/lib/one-client.js.map +0 -1
  176. package/dist/lib/one-operations.d.ts.map +0 -1
  177. package/dist/lib/one-operations.js.map +0 -1
  178. package/dist/lib/open-url.d.ts.map +0 -1
  179. package/dist/lib/open-url.js.map +0 -1
  180. package/dist/lib/progress.d.ts.map +0 -1
  181. package/dist/lib/progress.js.map +0 -1
  182. package/dist/lib/security-client.d.ts.map +0 -1
  183. package/dist/lib/security-client.js.map +0 -1
  184. package/dist/lib/skill-fetch.d.ts.map +0 -1
  185. package/dist/lib/skill-fetch.js.map +0 -1
  186. package/dist/lib/system-trust.d.ts.map +0 -1
  187. package/dist/lib/system-trust.js.map +0 -1
  188. package/dist/types.d.ts.map +0 -1
  189. package/dist/types.js.map +0 -1
  190. package/dist/version.d.ts.map +0 -1
  191. package/dist/version.js.map +0 -1
package/CLOUDFLARE.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # Cloudflare CLI reference
2
2
 
3
- `vigilbase cf` and `vigilbase cloudflare` use the authenticated Vigilbase One API. Run `vigilbase login` first. Your organization, permissions, customer links, and allowed zones determine access. The CLI never requires a Cloudflare API key.
3
+ `vigilbase cf` and `vigilbase cloudflare` use the authenticated Vigilbase One API. Run `vigilbase login` first (signing in isn't supported on Windows yet). Your organization, permissions, customer links, and allowed zones determine access. The CLI never requires a Cloudflare API key.
4
+
5
+ `cf checkup` runs on One's servers. `cloudflare-checkup` (also `local cloudflare-checkup`) runs on your machine with Cloudflare's own `cf` CLI and needs no Vigilbase login: one command, `npx @vigilbase/cli cloudflare-checkup`, verifies your work email with a code, installs cf if needed, signs in read-only, collects and uploads after you confirm. It works while vigilbase.com has local checkups switched on; otherwise it says so before asking for your email and points you to the checkup in your browser at https://vigilbase.com/tools/cloudflare-checkup (see [LOCAL.md](https://app.unpkg.com/@vigilbase/cli@0.2.1/files/LOCAL.md)).
4
6
 
5
7
  Customer provider access requires an `active` or `trialing` Cloudflare service
6
8
  entitlement for the selected account. Historical/inactive rows and legacy account
@@ -107,6 +109,3 @@ Checkup progress reads once and does not poll automatically. Run the command aga
107
109
 
108
110
  Malformed IDs, conflicting selections, extra positional arguments and unsupported scope combinations fail before a network request. Authentication, permission, HTTP and explicit `success:false` API failures return a nonzero exit status. Provider configuration writes, token management, cache purge, account deletion and DNS edits are not exposed by this command group.
109
111
 
110
- ## Verification
111
-
112
- `pnpm --filter @vigilbase/cli test` runs command contract tests, including tenant filters, exact paths, bearer authentication, rejected input, permission failures and terminal text handling. Cloudflare fixtures in `scripts/fixtures/cloudflare.mjs` cover every command and workspace section for the compiled CLI end-to-end harness. These fixtures execute against a local HTTP server; the checkup-start case never contacts production.
package/COMMANDS.md CHANGED
@@ -2,73 +2,118 @@
2
2
 
3
3
  The CLI uses public scanner APIs on `vigilbase.com` and authenticated APIs on
4
4
  `one.vigilbase.com`. Use `vigilbase <command> --help` or
5
- `vigilbase help <command>` for built-in help. Examples below omit optional
6
- `--json`, which every command supports.
5
+ `vigilbase help <command>` for built-in help. Examples below omit `--json`,
6
+ which every command supports.
7
7
 
8
8
  ## References
9
9
 
10
10
  | Area | Complete command and API reference |
11
11
  | --- | --- |
12
- | Cloudflare | [CLOUDFLARE.md](./CLOUDFLARE.md) |
13
- | Security | [SECURITY.md](./SECURITY.md) |
14
- | Customers, organizations, monitoring, support | [ONE.md](./ONE.md) |
15
- | Authentication, setup, network troubleshooting | [README.md](./README.md) |
12
+ | Cloudflare | [CLOUDFLARE.md](https://app.unpkg.com/@vigilbase/cli@0.2.1/files/CLOUDFLARE.md) |
13
+ | Security | [SECURITY.md](https://app.unpkg.com/@vigilbase/cli@0.2.1/files/SECURITY.md) |
14
+ | Customers, organizations, monitoring, support | [ONE.md](https://app.unpkg.com/@vigilbase/cli@0.2.1/files/ONE.md) |
15
+ | Local Cloudflare Checkup (cf on your machine) | [LOCAL.md](https://app.unpkg.com/@vigilbase/cli@0.2.1/files/LOCAL.md) |
16
+ | Sign-in, credentials, configuration, troubleshooting | [README.md](https://app.unpkg.com/@vigilbase/cli@0.2.1/files/README.md) |
16
17
 
17
- The references identify supported operations, filters, response/pagination
18
- behavior, API endpoints, and access requirements. They describe the CLI's
19
- supported API surface, not every internal endpoint in the monorepo.
18
+ The references list the supported operations, filters, response and pagination
19
+ behaviour, API endpoints and access requirements of the CLI.
20
20
 
21
21
  ## Global options
22
22
 
23
23
  | Flag | Meaning |
24
24
  | --- | --- |
25
- | `--json`, `-j` | JSON on stdout; progress/browser instructions on stderr |
25
+ | `--json`, `-j` | JSON on stdout; progress and browser instructions on stderr |
26
26
  | `--help`, `-h` | Help for the named command; makes no API request |
27
- | `--version`, `-V` | Package version |
27
+ | `--version`, `-V` | The installed version: the banner in a terminal, only the version number when stdout is a pipe or a file, `{"name":"@vigilbase/cli","version":"…"}` with `--json` |
28
28
  | `--one-url <origin>` | One origin; default `https://one.vigilbase.com` |
29
+ | `--auth-url <origin>` | The Identity issuer to trust; default `https://auth.vigilbase.com`. Staging (`https://identity-staging.vigilbase.com`) or a loopback issuer is trusted only when set here or in `VIGILBASE_AUTH_URL` |
29
30
  | `--base-url <origin>` | Public origin; default `https://vigilbase.com` |
30
31
  | `--timeout <ms>` | Per-request timeout, integer 1–2147483647; default 60000 |
31
32
  | `--client-id <id>` | Device authorization client; default `vigilbase-cli` |
32
33
 
33
- Origins must be HTTP(S) URLs without credentials, paths, query strings, or
34
- fragments. One requires HTTPS, except HTTP loopback development. `--customer-id` is a command-specific One customer UUID; it does not
35
- change the session's permissions. API-backed reads may still return 403 when the
36
- signed-in role lacks access. Unknown flags, unsupported command-specific flags
37
- (including scope flags), and extra positional arguments fail before API access.
38
- `--style` applies only to `badge`.
34
+ Origins must be HTTP(S) URLs without credentials, paths, query strings or
35
+ fragments. One requires HTTPS, except HTTP for loopback development.
36
+ `--customer-id` is a command-specific One customer UUID; it does not change the
37
+ session's permissions. API reads may still return 403 when the signed-in role
38
+ lacks access. Unknown flags, flags a command doesn't take (including scope
39
+ flags) and extra arguments fail before any API request. `--style` applies only
40
+ to `badge`.
39
41
 
40
42
  ## Authentication
41
43
 
42
- | Command | Options and behavior | One API |
44
+ Paths on One are relative to `--one-url`; Identity endpoints come from the
45
+ issuer's `/.well-known/openid-configuration` (for production,
46
+ `https://auth.vigilbase.com/api/auth/…`).
47
+
48
+ | Command | Options and behaviour | Requests |
43
49
  | --- | --- | --- |
44
- | `login` | Device authorization; `--no-open` for remote terminals | POST `/api/auth/device/code`, POST `/api/auth/device/token` |
45
- | `login --token-stdin` | Validate and save a token piped from a secret manager; input is bounded and never echoed | GET `/api/auth/get-session` |
46
- | `login --token <bearer>` | Legacy input; discouraged because arguments can appear in process lists/history. `VIGILBASE_ONE_TOKEN` is also supported; neither combines with `--token-stdin` | GET `/api/auth/get-session` |
47
- | `whoami` | Verify the saved session; signed-out is a successful status query | GET `/api/auth/get-session` when a usable token exists |
48
- | `logout` | Remove local credentials; does not revoke the server session | Local only |
49
- | `doctor` | Independently check public catalog and One session connectivity | GET `/api/agent/tools`, GET `/api/auth/get-session` |
50
-
51
- Tokens are saved atomically with owner-only file permissions and tied to their
52
- issuing One origin. See README for config directory overrides and certificate
53
- trust. Login polling handles pending approval, denial, expiry, and transient
54
- transport failures. Access tokens are never included in successful CLI output.
50
+ | `login` | Device sign-in; `--no-open` for remote terminals. Signing in again with Identity first revokes and removes the sign-in it replaces (before the new device code), unless that one's last refresh had an uncertain result | One `GET /.well-known/oauth-protected-resource`. Identity: discovery, `POST /api/auth/device/code`, polling the token endpoint, then userinfo; you approve at `https://auth.vigilbase.com/device`. Legacy: One `POST /api/auth/device/code`, `POST /api/auth/device/token`, `GET /api/auth/get-session`; you approve at One's `/device` |
51
+ | `login --token-stdin` | Check and save a token piped from a secret manager; the input is bounded and never echoed. A saved Identity sign-in is revoked and removed before the token is saved | One `GET /api/auth/get-session`; Identity revocation when a sign-in is saved |
52
+ | `login --token <bearer>` | Older input, discouraged because arguments can appear in process lists and history. `VIGILBASE_ONE_TOKEN` also works; neither combines with `--token-stdin` | Same as `--token-stdin` |
53
+ | `whoami` | Shows the saved session; signed out is a successful answer. Notes a CLI 0.2.0 `credentials.json` that is being ignored | Identity: discovery and userinfo (a refresh first if due). Legacy: One `GET /api/auth/get-session` |
54
+ | `logout` | Revokes every saved Identity sign-in, signs a legacy session out, then deletes the credential files. A sign-in Identity has already ended counts as revoked; any other failed Identity revocation keeps every file | Identity: discovery, then `POST /api/auth/oauth2/revoke` per saved sign-in. Legacy: One `POST /api/auth/sign-out` (best effort) |
55
+ | `doctor` | Checks the public API, your session and your saved sign-in independently; exits 1 if any check fails | `GET {base-url}/api/agent/tools`. Signed out or legacy: One `GET /api/auth/get-session`. Identity: `GET {issuer}/.well-known/openid-configuration`, then the userinfo endpoint it names (One is not contacted); a refresh at the token endpoint first if the access token expires within 60 seconds |
56
+
57
+ Credentials are saved atomically with owner-only permissions in
58
+ `identity-credentials.json` (Identity) or `credentials.json` (legacy One
59
+ sessions, shared with CLI 0.1.x), and are tied to the One origin and, for
60
+ Identity, the issuer, client and One resource they were issued for. Rotating
61
+ refresh tokens are coordinated across CLI processes by `credentials.json.lock`.
62
+ Login polling handles pending approval, denial, expiry and short network
63
+ failures. Access tokens never appear in CLI output. Signing in isn't supported
64
+ on Windows yet. The README covers the files, CLI 0.1.x/0.2.0 compatibility,
65
+ logout, directory checks and the config directory.
66
+
67
+ `doctor` JSON has `checks.publicApi`, `checks.one` and `checks.signIn`, each
68
+ `{ok, url?, error?, status?, code?}`. `checks.one.url` is the endpoint it
69
+ checked: One's `get-session`, the discovered userinfo endpoint, or the
70
+ issuer's discovery URL when discovery itself failed. `checks.signIn` has no
71
+ `url`.
55
72
 
56
73
  ## Public scanners and authenticated scans
57
74
 
58
75
  | Command | Options | API |
59
76
  | --- | --- | --- |
60
- | `list` (alias `tools`) | Lists the public catalog and authenticated scanner names | GET `/api/agent/tools` |
61
- | `run <tool> <target>` | `--via public\|one`; `--public` forces the public API | POST `/api/agent/tools/<tool>/execute` or One POST `/api/tools/<tool>/execute` |
77
+ | `list` (alias `tools`) | Lists the public catalog and the One-only scanners | GET `/api/agent/tools` |
78
+ | `run <tool> <target>` | `--via public\|one`; `--public` forces the public API | POST `/api/agent/tools/<tool>/execute` (anonymous) or One POST `/api/tools/<tool>/execute` |
62
79
  | `headers <url>` | Shortcut for `run security-headers`; same routing options | Same as `run` |
63
80
  | `email <domain>` | Shortcut for `run email-security`; same routing options | Same as `run` |
64
81
  | `describe <tool>` | `--no-skill` skips fetching skill Markdown | Catalog plus the tool's published skill URL |
65
- | `skill <tool>` | Prints the complete published skill; JSON includes URL/content | Catalog plus the tool's skill URL |
66
- | `badge <domain>` | `--style default\|compact\|mini` | Generates a public badge URL locally |
82
+ | `skill <tool>` | Prints the complete published skill; JSON includes URL and content | Catalog plus the tool's skill URL |
83
+ | `badge <domain>` | `--style default\|compact\|mini` | None; builds the public badge URL locally |
84
+
85
+ Public tools: `security-headers`, `email-security`. One-only tools:
86
+ `website-security`, `react2shell`, `fortibleed-check`. Public scans use the
87
+ public API unless you add `--via one`; being signed in doesn't change that.
88
+ `--public` and `--via one` cannot be combined.
89
+
90
+ The public route is anonymous and never reads your saved sign-in, the
91
+ credentials lock or Identity, so sign-in problems cannot make it fail. Runs
92
+ that go through One (`--via one` and the One-only tools) need a sign-in.
93
+ Without one they stop with this error:
94
+
95
+ ```
96
+ Error: This tool needs a Vigilbase One sign-in: run `vigilbase login`.
97
+ ```
67
98
 
68
- Public tools: `security-headers`, `email-security`. Login-required tools:
69
- `website-security`, `react2shell`, `fortibleed-check`. Public scans stay on the
70
- public API unless explicitly routed to One. A saved login alone does not change
71
- that choice. `--public` and `--via one` cannot be combined.
99
+ Other sign-in errors keep their own message, with that sentence as the hint
100
+ unless the message already says to run `vigilbase login`.
101
+
102
+ `list` reads your saved sign-in from disk only (no refresh, no network, no wait
103
+ for the lock). In JSON, `authenticated` says whether it looks usable and
104
+ `oneExecutableTools` follows it. If it can't be used, `list` still prints the
105
+ catalog, shows you as signed out and prints one stderr line per run:
106
+ ``Couldn't use your saved sign-in (<reason>); running anonymously. Run `vigilbase login` to fix.``
107
+ For an unsafe config path or credentials file, which `login` would refuse too,
108
+ the line ends with the fix instead, for example
109
+ ``Couldn't use your saved sign-in (/tmp is a symbolic link); running anonymously. Set VIGILBASE_CONFIG_DIR to a private directory without symbolic links in its path.``
110
+ `list` and `doctor` ignore a config path that fails the checks when no
111
+ credentials file is there.
112
+
113
+ When a public scan fails and vigilbase.com explains why with a known error
114
+ code, the CLI prints `Error: <message> (<code>)` (JSON: `error`, `code`,
115
+ `status`), with the message cleaned to one line of at most 300 characters.
116
+ Otherwise it prints `Request failed (HTTP <status>).`
72
117
 
73
118
  ## Account and billing
74
119
 
@@ -81,21 +126,20 @@ that choice. `--public` and `--via one` cannot be combined.
81
126
  | `account sessions` | `session` | GET `/api/account/sessions` |
82
127
  | `account invites` | `invitations`; optional `list` or `ls` | GET `/api/auth/orgs/invitations` |
83
128
  | `account invites create` | `add` alias; `--email <email>`, `--role <role>` (default member), required `--confirm` | POST `/api/auth/orgs/invite` |
84
- | `account billing` | Delegates to billing commands | Same as billing |
129
+ | `account billing` | Same as the billing commands | Same as billing |
85
130
  | `billing` | `summary`, `show`, `status` | GET `/api/account/billing` |
86
131
  | `billing portal` | `open`; `--no-open` prints the portal URL without opening a browser | POST `/api/billing/portal` |
87
132
 
88
- Invitation creation sends an invitation; billing portal creation starts a Stripe
89
- portal session. These are explicit actions. Billing data comes from One's Stripe
90
- integration; the CLI does not persist invoices or payment information locally.
133
+ Creating an invitation sends it; `billing portal` starts a Stripe portal
134
+ session. Both are explicit actions. Billing data comes from One's Stripe
135
+ integration; the CLI does not store invoices or payment information.
91
136
 
92
- Invitations validate the email and role locally and generate a fresh UUID
93
- `operationId` for each invocation. Accepted roles: `admin`, `member`, `readonly`,
137
+ Invitations check the email and role locally and send a fresh UUID
138
+ `operationId` each time. Accepted roles: `admin`, `member`, `readonly`,
94
139
  `partner_owner`, `partner_sales`, `partner_operations`, `partner_finance`,
95
- `partner_readonly`, `billing_only`, and `sales_only`. The API still checks whether
96
- the caller may assign the chosen role. `--confirm` is required.
97
- Portal URLs are validated against the HTTPS Stripe billing host before JSON
98
- output, printing, or opening; Windows requires manual opening.
140
+ `partner_readonly`, `billing_only` and `sales_only`. One still checks whether
141
+ you may assign the role. `--confirm` is required. Portal URLs must be HTTPS on
142
+ Stripe's billing host before they are printed, opened or put in JSON.
99
143
 
100
144
  ## Run history and account Watchdog
101
145
 
@@ -103,45 +147,76 @@ output, printing, or opening; Windows requires manual opening.
103
147
  | --- | --- | --- |
104
148
  | `runs` | `list`, `ls`; `--tool <name>`, `--limit <n>` (1–200, default 50) | GET `/api/tool-runs` |
105
149
  | `runs get <id>` | `show <id>` or `runs <UUID>` | GET `/api/tool-runs/<id>` |
106
- | `runhistory` | Alias of the entire `runs` group | Same as runs |
150
+ | `runhistory` | Alias of the whole `runs` group | Same as runs |
107
151
  | `watchdog` | `list`, `targets`, `status` | GET `/api/account/watchdog/targets` |
108
152
  | `watchdog scans` | `scan`; `--target-id <UUID>`, `--limit <n>` (1–100, default 20) | GET `/api/account/watchdog/scans` |
109
153
 
110
- Customer-specific Watchdog and monitoring views are documented in ONE.md.
154
+ Customer-specific Watchdog and monitoring views are in ONE.md.
111
155
 
112
- ## Output, effects, and testing
156
+ ## Local Cloudflare Checkup (no sign-in)
113
157
 
114
- Exit codes: **0** success, **1** validation/API/network failure, **2** HTTP 429
115
- rate limiting. A completed scan whose result is unsuccessful also exits 1.
116
- `whoami` being signed out is not an API failure. A healthy `doctor` does not
117
- require login. API error JSON retains status, code, and retry delay when available.
158
+ All vigilbase.com paths below are under
159
+ `https://vigilbase.com/api/v1/tools/cloudflare-checkup/local-session`.
118
160
 
119
- New security/customer operations preserve JSON response envelopes and pagination
120
- fields. Cloudflare inventory commands may apply the explicitly requested account
121
- or zone filter locally as well as sending it to One; zone detail returns the
122
- selected object. See each reference for details. Text output is for people; use
123
- JSON for automation and evidence export.
124
-
125
- Provider credentials, signed delegation claims, internal bearer tokens, and
126
- organization-authority overrides are never CLI inputs. New commands use named
127
- One routes. Webhooks, cron/admin repair endpoints, interactive OAuth handoffs,
128
- streaming/binary downloads, and endpoints that auto-provision on GET are outside
129
- this expansion. Remediation effects requiring durable approval/receipt workflows
130
- remain in their existing supported One/Vigil flows.
131
-
132
- ```bash
133
- pnpm --filter @vigilbase/cli check
134
- # Includes typecheck, unit tests, production build, login lifecycle smoke,
135
- # and every fixture-listed command over HTTP in both JSON and text modes.
136
-
137
- VIGILBASE_BASE_URL=https://vigilbase.com \
138
- VIGILBASE_SMOKE_ARTIFACTS="$PWD/.context/cli-live-smoke" \
139
- pnpm --filter @vigilbase/cli smoke:e2e
140
- ```
141
-
142
- The command suite uses temporary local HTTP fixtures and credentials; all writes
143
- stay local. It checks exact methods/paths/filters/bodies, bearer handling, output,
144
- permission failures, rate limits, malformed responses, and documentation presence.
145
- The live smoke separately checks public services and actual public scans. Real
146
- customer-data access additionally requires a valid One session and suitable role;
147
- local fixtures do not prove production provider configuration or data health.
161
+ | Command | Options | Requests |
162
+ | --- | --- | --- |
163
+ | `cloudflare-checkup` (≡ `local cloudflare-checkup [run]`) | `--email`, `--account-id`, `--out`, `--overwrite`, `--yes`, `--confirm`, `--no-open`, `--cf-auth auto\|profile\|env\|default` (default `auto`), `--profile`, `--cf-bin`, `--max-requests-per-5min`, `--base-url` (vigilbase.com or loopback), `--timeout` | In order: GET `…/availability` (before the email is asked for), POST `…/request` and `…/verify` (email verification), GET `…/local-session` (before cf runs), allowlisted read-only cf commands, GET `…/local-session` again and POST `…/local-session/snapshot` after you confirm. npm only to install the pinned cf when none is usable (asks first) |
164
+ | `cloudflare-checkup login` | `--profile`, `--no-open`, `--dry-run`, `--cf-bin` | Runs `cf auth create <profile> --scopes …` interactively |
165
+ | `cloudflare-checkup doctor` | `--cf-auth`, `--profile`, `--cf-bin` | Offline cf mapping check, one `cf auth whoami` |
166
+ | `cloudflare-checkup accounts` | `--cf-auth`, `--profile`, `--cf-bin` | `cf accounts list` (all pages) |
167
+ | `cloudflare-checkup collect` | `--out` (required), `--account-id`, `--overwrite`, `--dry-run`, `--max-requests-per-5min`, cf options | Allowlisted read-only cf commands; writes the snapshot |
168
+ | `cloudflare-checkup inspect <file>` | — | None |
169
+ | `cloudflare-checkup submit <file>` | `--email`, `--yes`/`--confirm`, `--no-open`, `--base-url`, `--timeout` | After checking the file: GET `…/availability`, POST `…/request` and `…/verify`, GET `…/local-session`, POST `…/local-session/snapshot` |
170
+ | `cloudflare-checkup logout` | `--profile`, `--cf-bin` | Runs `cf auth delete <profile>` interactively, then removes the cf Vigilbase installed |
171
+
172
+ Each subcommand also works as `local cloudflare-checkup <subcommand>`.
173
+
174
+ The one command and `submit` first ask vigilbase.com whether local checkups are
175
+ available (no email, no credentials). When they are switched off, the command
176
+ stops before asking for your email with
177
+ `Local checkups aren't available right now.` and the hint
178
+ `Run the Cloudflare Checkup in your browser instead: https://vigilbase.com/tools/cloudflare-checkup`
179
+ (`LOCAL_MODE_DISABLED`). When vigilbase.com needs a newer CLI, it stops with
180
+ `CLI_UPGRADE_REQUIRED`, also before any email. If vigilbase.com doesn't answer
181
+ the check, the command goes on.
182
+
183
+ Then they verify your work email: the CLI asks for it (or takes `--email`),
184
+ vigilbase.com emails a 6-digit code, and the CLI asks for the code (without a
185
+ terminal, both are read from stdin, one line each; add `--yes`). In a terminal
186
+ both show an interactive timeline on stderr (inputs, arrow-key questions,
187
+ spinners, a collection progress bar); pipes, CI, `TERM=dumb` and `--json` keep
188
+ plain lines and prompts. Ctrl-C exits 130. The address, the code and the
189
+ session code are never echoed, logged, stored or passed to cf or npm. cf output
190
+ and stderr are never echoed; failures carry a stable `code` and a `hint` that
191
+ usually says to run the same command again. See LOCAL.md for the email
192
+ verification, the managed cf install, the allowlist, the environment policy,
193
+ the uploaded data and the error codes.
194
+
195
+ ## Output and effects
196
+
197
+ Exit codes: **0** success, **1** validation, API, network or sign-in failure,
198
+ **2** HTTP 429 rate limiting. A completed scan whose result is unsuccessful
199
+ also exits 1. A signed-out `whoami` is not a failure, and a healthy `doctor`
200
+ does not need a sign-in. API error JSON keeps the status, code and retry delay
201
+ when available.
202
+
203
+ Security and customer operations keep JSON response envelopes and pagination
204
+ fields. Cloudflare inventory commands may apply the account or zone filter you
205
+ asked for locally as well as sending it to One; zone detail returns the
206
+ selected object. Text output is for people; use JSON for automation and
207
+ evidence export.
208
+
209
+ Provider credentials, signed delegation claims, internal bearer tokens and
210
+ organization overrides are never CLI inputs. Commands use named One routes,
211
+ with two exceptions. Local provider reads: `vigilbase cloudflare-checkup` runs
212
+ Cloudflare's own `cf` CLI on your machine with a fixed allowlist of read-only
213
+ commands; cf owns your Cloudflare login, and the Vigilbase CLI never reads,
214
+ prints, stores or uploads it. And the vigilbase.com local-session routes, which
215
+ are the checkup's only Vigilbase requests: GET `…/availability`, POST
216
+ `…/request` and POST `…/verify` without a credential, then GET `…/local-session`
217
+ and, after you confirm, POST `…/local-session/snapshot` with the exact snapshot
218
+ file, both authorized by the session code the email verification returned (see
219
+ LOCAL.md). Webhooks, cron and admin repair endpoints, interactive OAuth
220
+ handoffs, streaming or binary downloads, and endpoints that create records on
221
+ GET are not exposed. Remediation that needs durable approval and receipts stays
222
+ in its existing One and Vigil flows.