@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.
- package/CLOUDFLARE.md +2 -5
- package/COMMANDS.md +150 -112
- package/LOCAL.md +73 -83
- package/ONE.md +2 -4
- package/README.md +337 -171
- package/SECURITY.md +2 -2
- package/dist/auth/device-auth.d.ts +0 -1
- package/dist/auth/device-auth.js +6 -5
- package/dist/auth/index.d.ts +1 -2
- package/dist/auth/index.js +1 -2
- package/dist/auth/provider.d.ts +1 -1
- package/dist/auth/provider.js +16 -7
- package/dist/auth/refresh.d.ts +23 -4
- package/dist/auth/refresh.js +78 -22
- package/dist/auth/store.d.ts +78 -4
- package/dist/auth/store.js +385 -74
- package/dist/auth/token-metadata.d.ts +0 -1
- package/dist/auth/token-metadata.js +0 -1
- package/dist/auth/types.d.ts +0 -1
- package/dist/auth/types.js +0 -1
- package/dist/bin.d.ts +0 -1
- package/dist/bin.js +0 -1
- package/dist/cli.d.ts +4 -2
- package/dist/cli.js +7 -8
- package/dist/commands/account.d.ts +0 -1
- package/dist/commands/account.js +0 -1
- package/dist/commands/auth.d.ts +0 -1
- package/dist/commands/auth.js +69 -21
- package/dist/commands/billing.d.ts +0 -1
- package/dist/commands/billing.js +0 -1
- package/dist/commands/cloudflare.d.ts +1 -2
- package/dist/commands/cloudflare.js +6 -6
- package/dist/commands/helpers.d.ts +0 -1
- package/dist/commands/helpers.js +0 -1
- package/dist/commands/index.d.ts +0 -1
- package/dist/commands/index.js +0 -1
- package/dist/commands/legacy-validation.d.ts +0 -1
- package/dist/commands/legacy-validation.js +0 -1
- package/dist/commands/local.d.ts +6 -1
- package/dist/commands/local.js +34 -11
- package/dist/commands/one.d.ts +0 -1
- package/dist/commands/one.js +6 -7
- package/dist/commands/public-tools.d.ts +0 -1
- package/dist/commands/public-tools.js +52 -18
- package/dist/commands/runs.d.ts +0 -1
- package/dist/commands/runs.js +0 -1
- package/dist/commands/security.d.ts +1 -2
- package/dist/commands/security.js +1 -2
- package/dist/commands/watchdog.d.ts +0 -1
- package/dist/commands/watchdog.js +0 -1
- package/dist/index.d.ts +2 -3
- package/dist/index.js +1 -2
- package/dist/lib/banner.d.ts +0 -1
- package/dist/lib/banner.js +0 -1
- package/dist/lib/client.d.ts +4 -2
- package/dist/lib/client.js +42 -18
- package/dist/lib/cloudflare-client.d.ts +0 -1
- package/dist/lib/cloudflare-client.js +0 -1
- package/dist/lib/config.d.ts +16 -3
- package/dist/lib/config.js +41 -14
- package/dist/lib/format.d.ts +2 -1
- package/dist/lib/format.js +19 -8
- package/dist/lib/help.d.ts +1 -2
- package/dist/lib/help.js +29 -18
- package/dist/lib/network.d.ts +10 -1
- package/dist/lib/network.js +31 -4
- package/dist/lib/one-client.d.ts +2 -1
- package/dist/lib/one-client.js +3 -1
- package/dist/lib/one-operations.d.ts +0 -1
- package/dist/lib/one-operations.js +0 -1
- package/dist/lib/open-url.d.ts +0 -1
- package/dist/lib/open-url.js +0 -1
- package/dist/lib/platform.d.ts +2 -0
- package/dist/lib/platform.js +4 -0
- package/dist/lib/progress.d.ts +0 -1
- package/dist/lib/progress.js +0 -1
- package/dist/lib/security-client.d.ts +0 -1
- package/dist/lib/security-client.js +0 -1
- package/dist/lib/skill-fetch.d.ts +0 -1
- package/dist/lib/skill-fetch.js +0 -1
- package/dist/lib/system-trust.d.ts +0 -1
- package/dist/lib/system-trust.js +0 -1
- package/dist/lib/tui.d.ts +0 -1
- package/dist/lib/tui.js +0 -1
- package/dist/local/cloudflare-checkup/cf/allowlist.d.ts +0 -1
- package/dist/local/cloudflare-checkup/cf/allowlist.js +0 -1
- package/dist/local/cloudflare-checkup/cf/auth-lifecycle.d.ts +0 -1
- package/dist/local/cloudflare-checkup/cf/auth-lifecycle.js +0 -1
- package/dist/local/cloudflare-checkup/cf/child-env.d.ts +0 -1
- package/dist/local/cloudflare-checkup/cf/child-env.js +0 -1
- package/dist/local/cloudflare-checkup/cf/install.d.ts +0 -1
- package/dist/local/cloudflare-checkup/cf/install.js +0 -1
- package/dist/local/cloudflare-checkup/cf/locate.d.ts +0 -1
- package/dist/local/cloudflare-checkup/cf/locate.js +0 -1
- package/dist/local/cloudflare-checkup/cf/run-cf.d.ts +0 -1
- package/dist/local/cloudflare-checkup/cf/run-cf.js +0 -1
- package/dist/local/cloudflare-checkup/collector.d.ts +0 -1
- package/dist/local/cloudflare-checkup/collector.js +0 -1
- package/dist/local/cloudflare-checkup/contract.d.ts +14 -3
- package/dist/local/cloudflare-checkup/contract.js +9 -3
- package/dist/local/cloudflare-checkup/email-verification.d.ts +0 -1
- package/dist/local/cloudflare-checkup/email-verification.js +0 -1
- package/dist/local/cloudflare-checkup/errors.d.ts +2 -1
- package/dist/local/cloudflare-checkup/errors.js +6 -2
- package/dist/local/cloudflare-checkup/output.d.ts +0 -1
- package/dist/local/cloudflare-checkup/output.js +0 -1
- package/dist/local/cloudflare-checkup/prompts.d.ts +0 -1
- package/dist/local/cloudflare-checkup/prompts.js +0 -1
- package/dist/local/cloudflare-checkup/rate-budget.d.ts +0 -1
- package/dist/local/cloudflare-checkup/rate-budget.js +0 -1
- package/dist/local/cloudflare-checkup/snapshot-file.d.ts +0 -1
- package/dist/local/cloudflare-checkup/snapshot-file.js +0 -1
- package/dist/local/cloudflare-checkup/submit-client.d.ts +19 -5
- package/dist/local/cloudflare-checkup/submit-client.js +63 -17
- package/dist/local/cloudflare-checkup/terminal-ui.d.ts +0 -1
- package/dist/local/cloudflare-checkup/terminal-ui.js +0 -1
- package/dist/types.d.ts +25 -3
- package/dist/types.js +16 -1
- package/dist/version.d.ts +0 -1
- package/dist/version.js +0 -1
- package/package.json +5 -9
- package/dist/auth/device-auth.d.ts.map +0 -1
- package/dist/auth/device-auth.js.map +0 -1
- package/dist/auth/index.d.ts.map +0 -1
- package/dist/auth/index.js.map +0 -1
- package/dist/auth/provider.d.ts.map +0 -1
- package/dist/auth/provider.js.map +0 -1
- package/dist/auth/refresh.d.ts.map +0 -1
- package/dist/auth/refresh.js.map +0 -1
- package/dist/auth/store.d.ts.map +0 -1
- package/dist/auth/store.js.map +0 -1
- package/dist/auth/token-metadata.d.ts.map +0 -1
- package/dist/auth/token-metadata.js.map +0 -1
- package/dist/auth/types.d.ts.map +0 -1
- package/dist/auth/types.js.map +0 -1
- package/dist/bin.d.ts.map +0 -1
- package/dist/bin.js.map +0 -1
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/commands/account.d.ts.map +0 -1
- package/dist/commands/account.js.map +0 -1
- package/dist/commands/auth.d.ts.map +0 -1
- package/dist/commands/auth.js.map +0 -1
- package/dist/commands/billing.d.ts.map +0 -1
- package/dist/commands/billing.js.map +0 -1
- package/dist/commands/cloudflare.d.ts.map +0 -1
- package/dist/commands/cloudflare.js.map +0 -1
- package/dist/commands/helpers.d.ts.map +0 -1
- package/dist/commands/helpers.js.map +0 -1
- package/dist/commands/index.d.ts.map +0 -1
- package/dist/commands/index.js.map +0 -1
- package/dist/commands/legacy-validation.d.ts.map +0 -1
- package/dist/commands/legacy-validation.js.map +0 -1
- package/dist/commands/local.d.ts.map +0 -1
- package/dist/commands/local.js.map +0 -1
- package/dist/commands/one.d.ts.map +0 -1
- package/dist/commands/one.js.map +0 -1
- package/dist/commands/public-tools.d.ts.map +0 -1
- package/dist/commands/public-tools.js.map +0 -1
- package/dist/commands/runs.d.ts.map +0 -1
- package/dist/commands/runs.js.map +0 -1
- package/dist/commands/security.d.ts.map +0 -1
- package/dist/commands/security.js.map +0 -1
- package/dist/commands/watchdog.d.ts.map +0 -1
- package/dist/commands/watchdog.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/lib/banner.d.ts.map +0 -1
- package/dist/lib/banner.js.map +0 -1
- package/dist/lib/client.d.ts.map +0 -1
- package/dist/lib/client.js.map +0 -1
- package/dist/lib/cloudflare-client.d.ts.map +0 -1
- package/dist/lib/cloudflare-client.js.map +0 -1
- package/dist/lib/config.d.ts.map +0 -1
- package/dist/lib/config.js.map +0 -1
- package/dist/lib/format.d.ts.map +0 -1
- package/dist/lib/format.js.map +0 -1
- package/dist/lib/help.d.ts.map +0 -1
- package/dist/lib/help.js.map +0 -1
- package/dist/lib/network.d.ts.map +0 -1
- package/dist/lib/network.js.map +0 -1
- package/dist/lib/one-client.d.ts.map +0 -1
- package/dist/lib/one-client.js.map +0 -1
- package/dist/lib/one-operations.d.ts.map +0 -1
- package/dist/lib/one-operations.js.map +0 -1
- package/dist/lib/open-url.d.ts.map +0 -1
- package/dist/lib/open-url.js.map +0 -1
- package/dist/lib/progress.d.ts.map +0 -1
- package/dist/lib/progress.js.map +0 -1
- package/dist/lib/security-client.d.ts.map +0 -1
- package/dist/lib/security-client.js.map +0 -1
- package/dist/lib/skill-fetch.d.ts.map +0 -1
- package/dist/lib/skill-fetch.js.map +0 -1
- package/dist/lib/system-trust.d.ts.map +0 -1
- package/dist/lib/system-trust.js.map +0 -1
- package/dist/lib/tui.d.ts.map +0 -1
- package/dist/lib/tui.js.map +0 -1
- package/dist/local/cloudflare-checkup/cf/allowlist.d.ts.map +0 -1
- package/dist/local/cloudflare-checkup/cf/allowlist.js.map +0 -1
- package/dist/local/cloudflare-checkup/cf/auth-lifecycle.d.ts.map +0 -1
- package/dist/local/cloudflare-checkup/cf/auth-lifecycle.js.map +0 -1
- package/dist/local/cloudflare-checkup/cf/child-env.d.ts.map +0 -1
- package/dist/local/cloudflare-checkup/cf/child-env.js.map +0 -1
- package/dist/local/cloudflare-checkup/cf/install.d.ts.map +0 -1
- package/dist/local/cloudflare-checkup/cf/install.js.map +0 -1
- package/dist/local/cloudflare-checkup/cf/locate.d.ts.map +0 -1
- package/dist/local/cloudflare-checkup/cf/locate.js.map +0 -1
- package/dist/local/cloudflare-checkup/cf/run-cf.d.ts.map +0 -1
- package/dist/local/cloudflare-checkup/cf/run-cf.js.map +0 -1
- package/dist/local/cloudflare-checkup/collector.d.ts.map +0 -1
- package/dist/local/cloudflare-checkup/collector.js.map +0 -1
- package/dist/local/cloudflare-checkup/contract.d.ts.map +0 -1
- package/dist/local/cloudflare-checkup/contract.js.map +0 -1
- package/dist/local/cloudflare-checkup/email-verification.d.ts.map +0 -1
- package/dist/local/cloudflare-checkup/email-verification.js.map +0 -1
- package/dist/local/cloudflare-checkup/errors.d.ts.map +0 -1
- package/dist/local/cloudflare-checkup/errors.js.map +0 -1
- package/dist/local/cloudflare-checkup/output.d.ts.map +0 -1
- package/dist/local/cloudflare-checkup/output.js.map +0 -1
- package/dist/local/cloudflare-checkup/prompts.d.ts.map +0 -1
- package/dist/local/cloudflare-checkup/prompts.js.map +0 -1
- package/dist/local/cloudflare-checkup/rate-budget.d.ts.map +0 -1
- package/dist/local/cloudflare-checkup/rate-budget.js.map +0 -1
- package/dist/local/cloudflare-checkup/snapshot-file.d.ts.map +0 -1
- package/dist/local/cloudflare-checkup/snapshot-file.js.map +0 -1
- package/dist/local/cloudflare-checkup/submit-client.d.ts.map +0 -1
- package/dist/local/cloudflare-checkup/submit-client.js.map +0 -1
- package/dist/local/cloudflare-checkup/terminal-ui.d.ts.map +0 -1
- package/dist/local/cloudflare-checkup/terminal-ui.js.map +0 -1
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js.map +0 -1
- package/dist/version.d.ts.map +0 -1
- package/dist/version.js.map +0 -1
package/LOCAL.md
CHANGED
|
@@ -1,50 +1,66 @@
|
|
|
1
1
|
# Local Cloudflare Checkup reference
|
|
2
2
|
|
|
3
|
-
|
|
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
|
|
8
|
-
|
|
9
|
-
results page opens in your
|
|
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](
|
|
13
|
-
your machine and needs no Vigilbase
|
|
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 (
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
56
|
+
6. Lets you choose the account (one account is used as is; several get a
|
|
41
57
|
list to choose from).
|
|
42
|
-
|
|
43
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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),
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
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
|
|
168
|
-
|
|
169
|
-
|
|
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
|
-
`
|
|
280
|
-
|
|
281
|
-
|
|
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,
|
|
403
|
-
|
|
404
|
-
(accepted for 24 hours) and prints
|
|
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
|
|
547
|
-
|
|
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:
|
|
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` |
|
|
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` |
|
|
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.
|
|
680
|
-
|
|
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
|
|
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
|
|
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.
|