@vigilbase/cli 0.2.0 → 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 (233) hide show
  1. package/CLOUDFLARE.md +2 -5
  2. package/COMMANDS.md +150 -112
  3. package/LOCAL.md +73 -83
  4. package/ONE.md +2 -4
  5. package/README.md +337 -171
  6. package/SECURITY.md +2 -2
  7. package/dist/auth/device-auth.d.ts +0 -1
  8. package/dist/auth/device-auth.js +6 -5
  9. package/dist/auth/index.d.ts +1 -2
  10. package/dist/auth/index.js +1 -2
  11. package/dist/auth/provider.d.ts +1 -1
  12. package/dist/auth/provider.js +16 -7
  13. package/dist/auth/refresh.d.ts +23 -4
  14. package/dist/auth/refresh.js +78 -22
  15. package/dist/auth/store.d.ts +78 -4
  16. package/dist/auth/store.js +385 -74
  17. package/dist/auth/token-metadata.d.ts +0 -1
  18. package/dist/auth/token-metadata.js +0 -1
  19. package/dist/auth/types.d.ts +0 -1
  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 +7 -8
  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 +69 -21
  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 +0 -1
  34. package/dist/commands/helpers.js +0 -1
  35. package/dist/commands/index.d.ts +0 -1
  36. package/dist/commands/index.js +0 -1
  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 +6 -1
  40. package/dist/commands/local.js +34 -11
  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 +52 -18
  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 +2 -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 +16 -3
  60. package/dist/lib/config.js +41 -14
  61. package/dist/lib/format.d.ts +2 -1
  62. package/dist/lib/format.js +19 -8
  63. package/dist/lib/help.d.ts +1 -2
  64. package/dist/lib/help.js +29 -18
  65. package/dist/lib/network.d.ts +10 -1
  66. package/dist/lib/network.js +31 -4
  67. package/dist/lib/one-client.d.ts +2 -1
  68. package/dist/lib/one-client.js +3 -1
  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 +0 -1
  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 +0 -1
  84. package/dist/lib/tui.js +0 -1
  85. package/dist/local/cloudflare-checkup/cf/allowlist.d.ts +0 -1
  86. package/dist/local/cloudflare-checkup/cf/allowlist.js +0 -1
  87. package/dist/local/cloudflare-checkup/cf/auth-lifecycle.d.ts +0 -1
  88. package/dist/local/cloudflare-checkup/cf/auth-lifecycle.js +0 -1
  89. package/dist/local/cloudflare-checkup/cf/child-env.d.ts +0 -1
  90. package/dist/local/cloudflare-checkup/cf/child-env.js +0 -1
  91. package/dist/local/cloudflare-checkup/cf/install.d.ts +0 -1
  92. package/dist/local/cloudflare-checkup/cf/install.js +0 -1
  93. package/dist/local/cloudflare-checkup/cf/locate.d.ts +0 -1
  94. package/dist/local/cloudflare-checkup/cf/locate.js +0 -1
  95. package/dist/local/cloudflare-checkup/cf/run-cf.d.ts +0 -1
  96. package/dist/local/cloudflare-checkup/cf/run-cf.js +0 -1
  97. package/dist/local/cloudflare-checkup/collector.d.ts +0 -1
  98. package/dist/local/cloudflare-checkup/collector.js +0 -1
  99. package/dist/local/cloudflare-checkup/contract.d.ts +14 -3
  100. package/dist/local/cloudflare-checkup/contract.js +9 -3
  101. package/dist/local/cloudflare-checkup/email-verification.d.ts +0 -1
  102. package/dist/local/cloudflare-checkup/email-verification.js +0 -1
  103. package/dist/local/cloudflare-checkup/errors.d.ts +2 -1
  104. package/dist/local/cloudflare-checkup/errors.js +6 -2
  105. package/dist/local/cloudflare-checkup/output.d.ts +0 -1
  106. package/dist/local/cloudflare-checkup/output.js +0 -1
  107. package/dist/local/cloudflare-checkup/prompts.d.ts +0 -1
  108. package/dist/local/cloudflare-checkup/prompts.js +0 -1
  109. package/dist/local/cloudflare-checkup/rate-budget.d.ts +0 -1
  110. package/dist/local/cloudflare-checkup/rate-budget.js +0 -1
  111. package/dist/local/cloudflare-checkup/snapshot-file.d.ts +0 -1
  112. package/dist/local/cloudflare-checkup/snapshot-file.js +0 -1
  113. package/dist/local/cloudflare-checkup/submit-client.d.ts +19 -5
  114. package/dist/local/cloudflare-checkup/submit-client.js +63 -17
  115. package/dist/local/cloudflare-checkup/terminal-ui.d.ts +0 -1
  116. package/dist/local/cloudflare-checkup/terminal-ui.js +0 -1
  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 +5 -9
  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/provider.d.ts.map +0 -1
  127. package/dist/auth/provider.js.map +0 -1
  128. package/dist/auth/refresh.d.ts.map +0 -1
  129. package/dist/auth/refresh.js.map +0 -1
  130. package/dist/auth/store.d.ts.map +0 -1
  131. package/dist/auth/store.js.map +0 -1
  132. package/dist/auth/token-metadata.d.ts.map +0 -1
  133. package/dist/auth/token-metadata.js.map +0 -1
  134. package/dist/auth/types.d.ts.map +0 -1
  135. package/dist/auth/types.js.map +0 -1
  136. package/dist/bin.d.ts.map +0 -1
  137. package/dist/bin.js.map +0 -1
  138. package/dist/cli.d.ts.map +0 -1
  139. package/dist/cli.js.map +0 -1
  140. package/dist/commands/account.d.ts.map +0 -1
  141. package/dist/commands/account.js.map +0 -1
  142. package/dist/commands/auth.d.ts.map +0 -1
  143. package/dist/commands/auth.js.map +0 -1
  144. package/dist/commands/billing.d.ts.map +0 -1
  145. package/dist/commands/billing.js.map +0 -1
  146. package/dist/commands/cloudflare.d.ts.map +0 -1
  147. package/dist/commands/cloudflare.js.map +0 -1
  148. package/dist/commands/helpers.d.ts.map +0 -1
  149. package/dist/commands/helpers.js.map +0 -1
  150. package/dist/commands/index.d.ts.map +0 -1
  151. package/dist/commands/index.js.map +0 -1
  152. package/dist/commands/legacy-validation.d.ts.map +0 -1
  153. package/dist/commands/legacy-validation.js.map +0 -1
  154. package/dist/commands/local.d.ts.map +0 -1
  155. package/dist/commands/local.js.map +0 -1
  156. package/dist/commands/one.d.ts.map +0 -1
  157. package/dist/commands/one.js.map +0 -1
  158. package/dist/commands/public-tools.d.ts.map +0 -1
  159. package/dist/commands/public-tools.js.map +0 -1
  160. package/dist/commands/runs.d.ts.map +0 -1
  161. package/dist/commands/runs.js.map +0 -1
  162. package/dist/commands/security.d.ts.map +0 -1
  163. package/dist/commands/security.js.map +0 -1
  164. package/dist/commands/watchdog.d.ts.map +0 -1
  165. package/dist/commands/watchdog.js.map +0 -1
  166. package/dist/index.d.ts.map +0 -1
  167. package/dist/index.js.map +0 -1
  168. package/dist/lib/banner.d.ts.map +0 -1
  169. package/dist/lib/banner.js.map +0 -1
  170. package/dist/lib/client.d.ts.map +0 -1
  171. package/dist/lib/client.js.map +0 -1
  172. package/dist/lib/cloudflare-client.d.ts.map +0 -1
  173. package/dist/lib/cloudflare-client.js.map +0 -1
  174. package/dist/lib/config.d.ts.map +0 -1
  175. package/dist/lib/config.js.map +0 -1
  176. package/dist/lib/format.d.ts.map +0 -1
  177. package/dist/lib/format.js.map +0 -1
  178. package/dist/lib/help.d.ts.map +0 -1
  179. package/dist/lib/help.js.map +0 -1
  180. package/dist/lib/network.d.ts.map +0 -1
  181. package/dist/lib/network.js.map +0 -1
  182. package/dist/lib/one-client.d.ts.map +0 -1
  183. package/dist/lib/one-client.js.map +0 -1
  184. package/dist/lib/one-operations.d.ts.map +0 -1
  185. package/dist/lib/one-operations.js.map +0 -1
  186. package/dist/lib/open-url.d.ts.map +0 -1
  187. package/dist/lib/open-url.js.map +0 -1
  188. package/dist/lib/progress.d.ts.map +0 -1
  189. package/dist/lib/progress.js.map +0 -1
  190. package/dist/lib/security-client.d.ts.map +0 -1
  191. package/dist/lib/security-client.js.map +0 -1
  192. package/dist/lib/skill-fetch.d.ts.map +0 -1
  193. package/dist/lib/skill-fetch.js.map +0 -1
  194. package/dist/lib/system-trust.d.ts.map +0 -1
  195. package/dist/lib/system-trust.js.map +0 -1
  196. package/dist/lib/tui.d.ts.map +0 -1
  197. package/dist/lib/tui.js.map +0 -1
  198. package/dist/local/cloudflare-checkup/cf/allowlist.d.ts.map +0 -1
  199. package/dist/local/cloudflare-checkup/cf/allowlist.js.map +0 -1
  200. package/dist/local/cloudflare-checkup/cf/auth-lifecycle.d.ts.map +0 -1
  201. package/dist/local/cloudflare-checkup/cf/auth-lifecycle.js.map +0 -1
  202. package/dist/local/cloudflare-checkup/cf/child-env.d.ts.map +0 -1
  203. package/dist/local/cloudflare-checkup/cf/child-env.js.map +0 -1
  204. package/dist/local/cloudflare-checkup/cf/install.d.ts.map +0 -1
  205. package/dist/local/cloudflare-checkup/cf/install.js.map +0 -1
  206. package/dist/local/cloudflare-checkup/cf/locate.d.ts.map +0 -1
  207. package/dist/local/cloudflare-checkup/cf/locate.js.map +0 -1
  208. package/dist/local/cloudflare-checkup/cf/run-cf.d.ts.map +0 -1
  209. package/dist/local/cloudflare-checkup/cf/run-cf.js.map +0 -1
  210. package/dist/local/cloudflare-checkup/collector.d.ts.map +0 -1
  211. package/dist/local/cloudflare-checkup/collector.js.map +0 -1
  212. package/dist/local/cloudflare-checkup/contract.d.ts.map +0 -1
  213. package/dist/local/cloudflare-checkup/contract.js.map +0 -1
  214. package/dist/local/cloudflare-checkup/email-verification.d.ts.map +0 -1
  215. package/dist/local/cloudflare-checkup/email-verification.js.map +0 -1
  216. package/dist/local/cloudflare-checkup/errors.d.ts.map +0 -1
  217. package/dist/local/cloudflare-checkup/errors.js.map +0 -1
  218. package/dist/local/cloudflare-checkup/output.d.ts.map +0 -1
  219. package/dist/local/cloudflare-checkup/output.js.map +0 -1
  220. package/dist/local/cloudflare-checkup/prompts.d.ts.map +0 -1
  221. package/dist/local/cloudflare-checkup/prompts.js.map +0 -1
  222. package/dist/local/cloudflare-checkup/rate-budget.d.ts.map +0 -1
  223. package/dist/local/cloudflare-checkup/rate-budget.js.map +0 -1
  224. package/dist/local/cloudflare-checkup/snapshot-file.d.ts.map +0 -1
  225. package/dist/local/cloudflare-checkup/snapshot-file.js.map +0 -1
  226. package/dist/local/cloudflare-checkup/submit-client.d.ts.map +0 -1
  227. package/dist/local/cloudflare-checkup/submit-client.js.map +0 -1
  228. package/dist/local/cloudflare-checkup/terminal-ui.d.ts.map +0 -1
  229. package/dist/local/cloudflare-checkup/terminal-ui.js.map +0 -1
  230. package/dist/types.d.ts.map +0 -1
  231. package/dist/types.js.map +0 -1
  232. package/dist/version.d.ts.map +0 -1
  233. package/dist/version.js.map +0 -1
package/LOCAL.md CHANGED
@@ -1,50 +1,66 @@
1
1
  # Local Cloudflare Checkup reference
2
2
 
3
- The local mode of <https://vigilbase.com/tools/cloudflare-checkup?mode=local>
4
- collects your Cloudflare configuration **on your own machine** with
3
+ `vigilbase cloudflare-checkup` runs the Vigilbase Cloudflare Checkup in local
4
+ mode: it collects your Cloudflare configuration **on your own machine** with
5
5
  Cloudflare's own CLI, `cf`, writes a minimised snapshot you can inspect, and
6
6
  uploads exactly that file to vigilbase.com after you confirm. vigilbase.com
7
- evaluates it with the same scanner as the browser token mode. Results are
8
- labelled **self-reported**; they go to your verified work email, and the
9
- results page opens in your browser.
7
+ evaluates it with the same scanner as the checkup in your browser, which uses a
8
+ read-only Cloudflare API token instead. Results are labelled **self-reported**;
9
+ they go to your verified work email, and the results page opens in your
10
+ browser.
11
+
12
+ Local mode is available while vigilbase.com has it switched on. The CLI checks
13
+ before it asks for your email; when local mode is off it stops with
14
+ `Local checkups aren't available right now.` and points you to the checkup in
15
+ your browser at <https://vigilbase.com/tools/cloudflare-checkup>.
10
16
 
11
17
  `vigilbase cf checkup` runs on Vigilbase One's servers with stored credentials
12
- (see [CLOUDFLARE.md](./CLOUDFLARE.md)); `vigilbase cloudflare-checkup` runs on
13
- your machine and needs no Vigilbase login.
18
+ (see [CLOUDFLARE.md](https://app.unpkg.com/@vigilbase/cli@0.2.1/files/CLOUDFLARE.md));
19
+ `vigilbase cloudflare-checkup` runs on your machine and needs no Vigilbase
20
+ login.
14
21
 
15
22
  ## Quick start: one command
16
23
 
17
- Run this in a terminal (the checkup page shows the same command):
24
+ Run this in a terminal (while local mode is on, the checkup page at
25
+ <https://vigilbase.com/tools/cloudflare-checkup> shows the same command):
18
26
 
19
27
  ```bash
20
28
  npx @vigilbase/cli cloudflare-checkup
21
29
  ```
22
30
 
31
+ If it answers `Unknown command "cloudflare-checkup"`, an older global install
32
+ of the CLI (0.1.x) is running instead: `npx` prefers an installed global
33
+ `@vigilbase/cli`. Run `npx @vigilbase/cli@latest cloudflare-checkup` once, or
34
+ update the global install with `npm install -g @vigilbase/cli@latest`.
35
+
23
36
  The command does everything, in this order, and stops at the first problem
24
37
  before any slower step:
25
38
 
26
39
  1. Checks Node.js (22.18 or newer; macOS, Linux or Windows x64).
27
- 2. Asks for your work email (`Work email for your results:`), and
40
+ 2. Asks vigilbase.com whether local checkups are available and accept this CLI
41
+ version (nothing about you is sent). If not, it stops here, before asking
42
+ for your email.
43
+ 3. Asks for your work email (`Work email for your results:`), and
28
44
  vigilbase.com emails you a 6-digit code. You enter it at
29
45
  `Code from the email:` (`123456`, `123 456` and `123-456` all work), and
30
46
  the CLI prints `✓ Verified j***@acme.com`.
31
- 3. Finds Cloudflare's `cf`. If none is usable (including a newer cf that
47
+ 4. Finds Cloudflare's `cf`. If none is usable (including a newer cf that
32
48
  renamed a command the checkup needs), it offers to install the tested
33
49
  release for Vigilbase (asks first; `--yes` answers for you). Your own cf is
34
50
  left alone.
35
- 4. Signs in to Cloudflare with a **read-only** cf login (your browser opens) if
51
+ 5. Signs in to Cloudflare with a **read-only** cf login (your browser opens) if
36
52
  the cf profile `vigilbase-checkup` is missing or expired. With
37
53
  `CLOUDFLARE_API_TOKEN` set in the shell, cf uses that token instead and the
38
54
  browser sign-in is not offered: unset the variable, or add
39
55
  `--cf-auth profile`, to sign in with your browser.
40
- 5. Lets you choose the account (one account is used as is; several get a
56
+ 6. Lets you choose the account (one account is used as is; several get a
41
57
  list to choose from).
42
- 6. Collects with read-only cf commands, at most 900 requests per 5 minutes.
43
- 7. Saves the snapshot to `~/.config/vigilbase/checkups/…` (mode 0600) and
58
+ 7. Collects with read-only cf commands, at most 900 requests per 5 minutes.
59
+ 8. Saves the snapshot to `~/.config/vigilbase/checkups/…` (mode 0600) and
44
60
  shows what it contains.
45
- 8. Asks `Results go to j***@acme.com. Upload 182 KB to https://vigilbase.com? [y/N]`
61
+ 9. Asks `Results go to j***@acme.com. Upload 182 KB to https://vigilbase.com? [y/N]`
46
62
  and uploads exactly that file only after an explicit `y`.
47
- 9. Prints the results link and opens it in your browser.
63
+ 10. Prints the results link and opens it in your browser.
48
64
 
49
65
  In a terminal, the steps show as an interactive timeline (see
50
66
  [Terminal UI and plain output](#terminal-ui-and-plain-output)):
@@ -137,12 +153,13 @@ and `vigilbase local cloudflare-checkup run` are the same command.
137
153
  | `--json` | One JSON object on stdout; status lines and prompts go to stderr. |
138
154
 
139
155
  Before anything slow, the command checks every flag (no I/O, and `--email`
140
- only for its shape), then Node, then that its questions can be answered: on a
141
- terminal, or with `--yes` without one (`--confirm` answers only the upload
142
- question, not installing cf), so no code is emailed for a run that could not
143
- install cf or confirm the upload. It verifies your email before cf runs, and
144
- checks that the snapshot location is writable before collecting, so a long
145
- collection is never wasted.
156
+ only for its shape), that its questions can be answered (on a terminal, or
157
+ with `--yes` without one; `--confirm` answers only the upload question, not
158
+ installing cf), then Node, then that `--out` is writable, then that
159
+ vigilbase.com has local checkups on and accepts this CLI. So no code is emailed
160
+ for a run that could not install cf, confirm the upload or be accepted. It
161
+ verifies your email before cf runs, and checks that the snapshot location is
162
+ writable before collecting, so a long collection is never wasted.
146
163
 
147
164
  Two problems can show only once cf runs, after the email was verified: without
148
165
  a terminal, a missing cf login (`CF_AUTH_REQUIRED`) and several accounts
@@ -164,9 +181,10 @@ never answered from stdin: use `--account-id` and `--yes`.
164
181
 
165
182
  In a terminal, the one command and `submit` show their steps as a timeline on
166
183
  stderr (◆ the current step, ◇ a finished one, │ notes, ▲ a warning, ■ the error
167
- that stopped the run, └ the result). Spinners run while vigilbase.com sends or
168
- checks the code, while the session is checked, while cf is found, checked and
169
- installed, and while the upload is scored; a progress bar runs while
184
+ that stopped the run, └ the result). Spinners run while the CLI checks that
185
+ local checkups are available, while vigilbase.com sends or checks the code,
186
+ while the session is checked, while cf is found, checked and installed, and
187
+ while the upload is scored; a progress bar runs while
170
188
  collecting (zones done, cf reads done of the estimate, and the time left, from
171
189
  the request budget and the pace so far). Everything is redrawn in place and fits
172
190
  the terminal width, also after a resize.
@@ -225,6 +243,17 @@ between the items of a summary line, in every step, spinner and message.
225
243
  The CLI verifies your email itself; there is no browser step and no bot check
226
244
  on this path.
227
245
 
246
+ - **Availability first.** Before asking for your email, the one command and
247
+ `submit` send `GET …/local-session/availability`, with no email, no
248
+ credentials and no body. If local checkups are switched off, the command
249
+ stops with `LOCAL_MODE_DISABLED`: `Local checkups aren't available right now.`
250
+ and the hint
251
+ `Run the Cloudflare Checkup in your browser instead: https://vigilbase.com/tools/cloudflare-checkup`.
252
+ Nothing is emailed and cf is not touched. If vigilbase.com needs a newer CLI
253
+ or doesn't accept this snapshot format, it stops with `CLI_UPGRADE_REQUIRED`.
254
+ If vigilbase.com doesn't answer the check (for example a network error or a
255
+ timeout, after 10 seconds or `--timeout`), the command goes on, and the same
256
+ checks happen when the checkup starts.
228
257
  - **What vigilbase.com receives.** Your email address goes to vigilbase.com
229
258
  (`POST …/local-session/request`) so it can send you the code, together with
230
259
  the email language (`en`, `pt-PT` or `ar`, from `LC_ALL`, `LC_MESSAGES` or
@@ -276,9 +305,10 @@ removed from npm's environment when the CLI installs cf.)
276
305
  stores, inspects or uploads it.
277
306
  - **The only Vigilbase requests** go to
278
307
  `https://vigilbase.com/api/v1/tools/cloudflare-checkup/local-session`:
279
- `POST …/request` and `POST …/verify` (the email verification, JSON bodies,
280
- no credential), then `GET` of the session and `POST …/snapshot`, authorised
281
- by the session code the verification returned. The upload is the exact bytes
308
+ `GET …/availability` (no body, no credential), `POST …/request` and
309
+ `POST …/verify` (the email verification, JSON bodies, no credential), then
310
+ `GET` of the session and `POST …/snapshot`, authorised by the session code
311
+ the verification returned. The upload is the exact bytes
282
312
  of the file you can inspect; the CLI re-reads and re-hashes it and checks the
283
313
  server's echoed SHA-256.
284
314
  - **Installing cf** contacts only the npm registry your npm is configured for,
@@ -379,7 +409,8 @@ The snapshot is kept whatever happens to the upload: when it cannot go ahead
379
409
  (`SESSION_*`, `VERIFICATION_*`, `SUBMIT_FAILED`, `VIGILBASE_*`,
380
410
  `LOCAL_MODE_DISABLED`), the command prints, next to the error,
381
411
  `npx @vigilbase/cli cloudflare-checkup submit <saved file>` to upload it
382
- later without collecting again (it verifies your email again).
412
+ later without collecting again (it verifies your email again). When the run
413
+ used a loopback `--base-url`, that command ends with the same `--base-url`.
383
414
 
384
415
  ## Advanced commands
385
416
 
@@ -399,9 +430,10 @@ All are `vigilbase cloudflare-checkup <command>` or
399
430
  the one command. `collect --dry-run` prints every cf command with
400
431
  `<ZONE_ID>`/`<RULESET_ID>` placeholders, the child-environment variable names
401
432
  (never values), the not-collected list and the request formula; it makes no
402
- Cloudflare and no Vigilbase requests. `submit` checks the file, verifies your
403
- email like the one command, then uploads a snapshot collected earlier
404
- (accepted for 24 hours) and prints the results link.
433
+ Cloudflare and no Vigilbase requests. `submit` checks the file, checks that
434
+ vigilbase.com has local checkups on, verifies your email like the one command,
435
+ then uploads a snapshot collected earlier (accepted for 24 hours) and prints
436
+ the results link.
405
437
 
406
438
  `logout` runs `cf auth delete <profile>` through the cf it finds (an
407
439
  interactive passthrough, so cf's own message is shown; cf 1.0.0-beta.13 takes
@@ -543,8 +575,8 @@ before every expiry in a long run.
543
575
 
544
576
  ## Scopes
545
577
 
546
- The sign-in (and `login`) requests these read scopes (names verified against cf 1.0.0-beta.13;
547
- whether they suffice for every read is confirmed before launch):
578
+ The sign-in (and `login`) requests these read scopes (names verified against
579
+ cf 1.0.0-beta.13):
548
580
 
549
581
  `account:read account-settings.read memberships.read user:read user-details.read
550
582
  zone:read zone.read zone-settings.read dns.read dns_records:read
@@ -639,11 +671,11 @@ are never echoed.
639
671
  | `CF_ERROR` | Run the same command again in a few minutes. |
640
672
  | `ACCOUNT_SELECTION_REQUIRED` | Run the same command again in a terminal to choose, or add `--account-id <ACCOUNT_ID>` (listed in the error). |
641
673
  | `ACCOUNT_NOT_VISIBLE` | Check that your Cloudflare user can read the account and its zones. |
642
- | `ACCOUNT_TOO_LARGE` | Over 100 zones: use the browser token mode. |
674
+ | `ACCOUNT_TOO_LARGE` | Over 100 zones: run the checkup in your browser instead, https://vigilbase.com/tools/cloudflare-checkup. |
643
675
  | `ACCOUNT_MISMATCH` | The checkup is bound to another account; run the same command again without `--account-id`. |
644
676
  | `OUTPUT_EXISTS` | Choose another `--out`, or pass `--overwrite`. |
645
677
  | `SNAPSHOT_INVALID` / `SNAPSHOT_SECRET_LIKE_VALUE` | Run the same command again (remove the credential-like text from the rule or name first). |
646
- | `SNAPSHOT_TOO_LARGE` | Use the browser token mode. |
678
+ | `SNAPSHOT_TOO_LARGE` | Run the checkup in your browser instead, https://vigilbase.com/tools/cloudflare-checkup. |
647
679
  | `SNAPSHOT_STALE` | Snapshots are accepted for 24 hours; run the same command again. |
648
680
  | `EMAIL_INVALID` | Use your work email (personal and disposable addresses are refused), then run the same command again. |
649
681
  | `EMAIL_CODE_INVALID` | Five codes were wrong or not 6 digits; run the same command again for a new code. |
@@ -653,8 +685,8 @@ are never echoed.
653
685
  | `SESSION_BUSY` | A snapshot for this checkup is still being processed; wait for the results email, or run the same command again. |
654
686
  | `SUBMIT_ORIGIN_UNTRUSTED` | Upload only to https://vigilbase.com (or loopback for testing). |
655
687
  | `CONFIRMATION_REQUIRED` | Run the command in a terminal, or add `--yes` (and, without `--email`, pipe the address and the code to stdin). |
656
- | `CLI_UPGRADE_REQUIRED` | Run `npx @vigilbase/cli@latest cloudflare-checkup`, or `npm install --global @vigilbase/cli@latest`. |
657
- | `LOCAL_MODE_DISABLED` | Use the browser token mode, or try later. |
688
+ | `CLI_UPGRADE_REQUIRED` | vigilbase.com needs a newer CLI (checked before your email is asked for). Run `npx @vigilbase/cli@latest cloudflare-checkup`, or `npm install --global @vigilbase/cli@latest`. |
689
+ | `LOCAL_MODE_DISABLED` | Local checkups aren't available right now. Run the Cloudflare Checkup in your browser instead: https://vigilbase.com/tools/cloudflare-checkup. |
658
690
  | `VIGILBASE_RATE_LIMITED` | Wait as long as the error says (`retryAfterSec` in JSON), then run the same command again. |
659
691
  | `VIGILBASE_CHALLENGED` | vigilbase.com challenged the request; try another network or contact help@vigilbase.com. |
660
692
  | `SUBMIT_FAILED` | Run the same command again later. |
@@ -676,9 +708,9 @@ Windows x64 is supported as beta without CI coverage: cf runs via
676
708
  `process.execPath` with the entry beside `cf.cmd` (npm's global layout), never
677
709
  through `cmd.exe`; and the managed install uses the `npm-cli.js` beside
678
710
  `node.exe`. The results page is not opened on Windows (the link is printed).
679
- Windows on ARM is not supported. pnpm and
680
- Volta global installs are found automatically; otherwise pass `--cf-bin` as
681
- above.
711
+ Windows on ARM is not supported. The checkup needs no Vigilbase sign-in, so it
712
+ works on Windows even though `vigilbase login` doesn't yet. pnpm and Volta
713
+ global installs are found automatically; otherwise pass `--cf-bin` as above.
682
714
 
683
715
  ## Cleanup
684
716
 
@@ -687,45 +719,3 @@ npx @vigilbase/cli cloudflare-checkup logout # cf auth delete vigilbase-checku
687
719
  rm ~/.config/vigilbase/checkups/cloudflare-checkup-*.json # the snapshots are yours; delete them when done
688
720
  ```
689
721
 
690
- ## Test it locally (contributors)
691
-
692
- From a checkout of the monorepo, one command runs the whole flow on your
693
- machine: vigilbase.com (`next dev`, local mode on), an in-memory fake of One's
694
- tool-runs API, and this CLI built from source.
695
-
696
- ```bash
697
- pnpm dev:checkup-local # your own cf: sign in to your Cloudflare account (read-only)
698
- pnpm dev:checkup-local --fake-cf # a fake cf with two accounts: no Cloudflare account needed
699
- pnpm dev:checkup-local --help # every option
700
- ```
701
-
702
- It needs Node 22.18+ (it finds Homebrew's or nvm's Node 22 when the shell has
703
- another version) and an Infisical login for the dev environment
704
- (`infisical login`). It builds the CLI when `packages/cli/dist` is older than
705
- `src`, starts com on port 3011 (or the next free one) with the Infisical dev
706
- values overridden for local mode, and runs the CLI against
707
- `http://localhost:<port>`. Server output goes to a log, never the terminal.
708
-
709
- - **Email** is never sent. Each message lands in a local inbox
710
- (`$TMPDIR/vigilbase-checkup-local/inbox/`) and verification emails open in
711
- your browser like a real inbox. `latest-email.json` beside it holds the
712
- newest email, code included, for scripts.
713
- - **Results** open from the CLI as usual. vigilbase.com keeps running after the
714
- CLI finishes so the results page works: press Enter to stop, or `r` to run
715
- the CLI again without restarting the server.
716
- - **Options**: `--page` also opens the checkup page in local mode; `--no-open`
717
- opens nothing (no inbox tabs, no results page); `--port <n>` picks the port;
718
- `--one-budgets` applies One's creation budgets (one run per address every
719
- 8 minutes, as in production). Options after `--` go to the CLI, for example
720
- `pnpm dev:checkup-local -- --email you@company.com` or `-- submit <file>`.
721
- - **Logs**: `com.log` and `fake-one.log` in the same directory. The next run
722
- overwrites them and the inbox; set `VIGILBASE_CHECKUP_LOCAL_DIR` to use
723
- another directory.
724
- - **CLI config** is a persistent `~/.config/vigilbase-checkup-local/` (`cli/`
725
- with your cf, `fake-cf/` with the fake), separate from `~/.config/vigilbase`:
726
- the managed cf install happens once, and dev checkups never mix with real
727
- ones. The read-only cf profile itself is cf's, shared with real runs. Clean
728
- up with `pnpm dev:checkup-local -- logout` (deletes that profile and the
729
- managed cf) and `rm -rf ~/.config/vigilbase-checkup-local`.
730
-
731
- Ctrl-C stops everything: no server keeps running after the command exits.
package/ONE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Vigilbase One CLI reference
2
2
 
3
- Log in with `vigilbase login`. These command groups use the configured One origin (`--one-url`, `VIGILBASE_ONE_URL`, default `https://one.vigilbase.com`) and the saved device-login credential. Every operation in this reference sends GET. Customer, organization, role, and integration access remains enforced by One; selecting an ID never grants access.
3
+ Log in with `vigilbase login` (signing in isn't supported on Windows yet). These command groups use the configured One origin (`--one-url`, `VIGILBASE_ONE_URL`, default `https://one.vigilbase.com`) and your saved sign-in. Every operation in this reference sends GET. Customer, organization, role, and integration access remains enforced by One; selecting an ID never grants access.
4
4
 
5
5
  Use `--json` to retain the complete API response and pagination metadata. Plain/pretty output shows all fields as an indented tree, including null/unknown metrics, degraded status, totals, and cursors. `--timeout <milliseconds>` controls request timeouts. No command automatically follows pagination. Only documented flags are accepted; unrelated flags fail before authentication or network requests.
6
6
 
@@ -94,6 +94,4 @@ vigilbase support tickets [--all] [--limit 1..100] [--json]
94
94
 
95
95
  ## Related commands and validation
96
96
 
97
- See [README.md](README.md) for login, account, billing, public scanners, run history, Watchdog, Cloudflare (`cf`/`cloudflare`), and security command references. The read operations above do not replace the existing explicitly confirmed write commands.
98
-
99
- The test suite validates argument rejection, auth failures, tenant ID encoding, API errors, response rendering, and read transport. `pnpm --filter @vigilbase/cli smoke:commands` builds the actual binary and exercises each named operation against independently authored local HTTP fixtures in `scripts/fixtures/one.mjs`. This verifies the binary, argument parser, credential store, HTTP request, and JSON/text output without writing production data. These fixtures do not assert deployed provider availability or that a particular production user has permissions.
97
+ See [README.md](https://app.unpkg.com/@vigilbase/cli@0.2.1/files/README.md) for sign-in and configuration, [COMMANDS.md](https://app.unpkg.com/@vigilbase/cli@0.2.1/files/COMMANDS.md) for account, billing, public scanners, run history and Watchdog, [CLOUDFLARE.md](https://app.unpkg.com/@vigilbase/cli@0.2.1/files/CLOUDFLARE.md) for `cf`/`cloudflare`, and [SECURITY.md](https://app.unpkg.com/@vigilbase/cli@0.2.1/files/SECURITY.md) for security commands. The read operations above do not replace the existing explicitly confirmed write commands.