@vigilbase/cli 0.1.3 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CLOUDFLARE.md +2 -0
- package/COMMANDS.md +43 -6
- package/LOCAL.md +731 -0
- package/README.md +58 -6
- package/dist/auth/device-auth.d.ts.map +1 -1
- package/dist/auth/device-auth.js +7 -3
- package/dist/auth/device-auth.js.map +1 -1
- package/dist/auth/index.d.ts +3 -0
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/auth/index.js +2 -0
- package/dist/auth/index.js.map +1 -1
- package/dist/auth/provider.d.ts +18 -0
- package/dist/auth/provider.d.ts.map +1 -0
- package/dist/auth/provider.js +62 -0
- package/dist/auth/provider.js.map +1 -0
- package/dist/auth/refresh.d.ts +10 -0
- package/dist/auth/refresh.d.ts.map +1 -0
- package/dist/auth/refresh.js +143 -0
- package/dist/auth/refresh.js.map +1 -0
- package/dist/auth/store.d.ts +27 -2
- package/dist/auth/store.d.ts.map +1 -1
- package/dist/auth/store.js +23 -8
- package/dist/auth/store.js.map +1 -1
- package/dist/auth/token-metadata.d.ts +10 -0
- package/dist/auth/token-metadata.d.ts.map +1 -0
- package/dist/auth/token-metadata.js +22 -0
- package/dist/auth/token-metadata.js.map +1 -0
- package/dist/auth/types.d.ts +8 -1
- package/dist/auth/types.d.ts.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +40 -9
- package/dist/cli.js.map +1 -1
- package/dist/commands/auth.d.ts.map +1 -1
- package/dist/commands/auth.js +20 -8
- package/dist/commands/auth.js.map +1 -1
- package/dist/commands/helpers.d.ts +15 -0
- package/dist/commands/helpers.d.ts.map +1 -1
- package/dist/commands/helpers.js +2 -2
- package/dist/commands/helpers.js.map +1 -1
- package/dist/commands/index.d.ts +3 -1
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/commands/index.js +6 -1
- package/dist/commands/index.js.map +1 -1
- package/dist/commands/local.d.ts +30 -0
- package/dist/commands/local.d.ts.map +1 -0
- package/dist/commands/local.js +1520 -0
- package/dist/commands/local.js.map +1 -0
- package/dist/commands/public-tools.d.ts.map +1 -1
- package/dist/commands/public-tools.js +8 -4
- package/dist/commands/public-tools.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/config.d.ts +16 -1
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +36 -4
- package/dist/lib/config.js.map +1 -1
- package/dist/lib/format.d.ts.map +1 -1
- package/dist/lib/format.js +9 -0
- package/dist/lib/format.js.map +1 -1
- package/dist/lib/help.d.ts +1 -1
- package/dist/lib/help.d.ts.map +1 -1
- package/dist/lib/help.js +9 -0
- package/dist/lib/help.js.map +1 -1
- package/dist/lib/network.d.ts.map +1 -1
- package/dist/lib/network.js +2 -1
- package/dist/lib/network.js.map +1 -1
- package/dist/lib/one-client.d.ts +3 -2
- package/dist/lib/one-client.d.ts.map +1 -1
- package/dist/lib/one-client.js +46 -2
- package/dist/lib/one-client.js.map +1 -1
- package/dist/lib/security-client.d.ts +1 -1
- package/dist/lib/tui.d.ts +309 -0
- package/dist/lib/tui.d.ts.map +1 -0
- package/dist/lib/tui.js +847 -0
- package/dist/lib/tui.js.map +1 -0
- package/dist/local/cloudflare-checkup/cf/allowlist.d.ts +95 -0
- package/dist/local/cloudflare-checkup/cf/allowlist.d.ts.map +1 -0
- package/dist/local/cloudflare-checkup/cf/allowlist.js +184 -0
- package/dist/local/cloudflare-checkup/cf/allowlist.js.map +1 -0
- package/dist/local/cloudflare-checkup/cf/auth-lifecycle.d.ts +113 -0
- package/dist/local/cloudflare-checkup/cf/auth-lifecycle.d.ts.map +1 -0
- package/dist/local/cloudflare-checkup/cf/auth-lifecycle.js +313 -0
- package/dist/local/cloudflare-checkup/cf/auth-lifecycle.js.map +1 -0
- package/dist/local/cloudflare-checkup/cf/child-env.d.ts +32 -0
- package/dist/local/cloudflare-checkup/cf/child-env.d.ts.map +1 -0
- package/dist/local/cloudflare-checkup/cf/child-env.js +81 -0
- package/dist/local/cloudflare-checkup/cf/child-env.js.map +1 -0
- package/dist/local/cloudflare-checkup/cf/install.d.ts +106 -0
- package/dist/local/cloudflare-checkup/cf/install.d.ts.map +1 -0
- package/dist/local/cloudflare-checkup/cf/install.js +309 -0
- package/dist/local/cloudflare-checkup/cf/install.js.map +1 -0
- package/dist/local/cloudflare-checkup/cf/locate.d.ts +44 -0
- package/dist/local/cloudflare-checkup/cf/locate.d.ts.map +1 -0
- package/dist/local/cloudflare-checkup/cf/locate.js +228 -0
- package/dist/local/cloudflare-checkup/cf/locate.js.map +1 -0
- package/dist/local/cloudflare-checkup/cf/run-cf.d.ts +89 -0
- package/dist/local/cloudflare-checkup/cf/run-cf.d.ts.map +1 -0
- package/dist/local/cloudflare-checkup/cf/run-cf.js +275 -0
- package/dist/local/cloudflare-checkup/cf/run-cf.js.map +1 -0
- package/dist/local/cloudflare-checkup/collector.d.ts +48 -0
- package/dist/local/cloudflare-checkup/collector.d.ts.map +1 -0
- package/dist/local/cloudflare-checkup/collector.js +296 -0
- package/dist/local/cloudflare-checkup/collector.js.map +1 -0
- package/dist/local/cloudflare-checkup/contract.d.ts +2793 -0
- package/dist/local/cloudflare-checkup/contract.d.ts.map +1 -0
- package/dist/local/cloudflare-checkup/contract.js +1614 -0
- package/dist/local/cloudflare-checkup/contract.js.map +1 -0
- package/dist/local/cloudflare-checkup/email-verification.d.ts +125 -0
- package/dist/local/cloudflare-checkup/email-verification.d.ts.map +1 -0
- package/dist/local/cloudflare-checkup/email-verification.js +212 -0
- package/dist/local/cloudflare-checkup/email-verification.js.map +1 -0
- package/dist/local/cloudflare-checkup/errors.d.ts +28 -0
- package/dist/local/cloudflare-checkup/errors.d.ts.map +1 -0
- package/dist/local/cloudflare-checkup/errors.js +99 -0
- package/dist/local/cloudflare-checkup/errors.js.map +1 -0
- package/dist/local/cloudflare-checkup/output.d.ts +24 -0
- package/dist/local/cloudflare-checkup/output.d.ts.map +1 -0
- package/dist/local/cloudflare-checkup/output.js +89 -0
- package/dist/local/cloudflare-checkup/output.js.map +1 -0
- package/dist/local/cloudflare-checkup/prompts.d.ts +41 -0
- package/dist/local/cloudflare-checkup/prompts.d.ts.map +1 -0
- package/dist/local/cloudflare-checkup/prompts.js +140 -0
- package/dist/local/cloudflare-checkup/prompts.js.map +1 -0
- package/dist/local/cloudflare-checkup/rate-budget.d.ts +42 -0
- package/dist/local/cloudflare-checkup/rate-budget.d.ts.map +1 -0
- package/dist/local/cloudflare-checkup/rate-budget.js +80 -0
- package/dist/local/cloudflare-checkup/rate-budget.js.map +1 -0
- package/dist/local/cloudflare-checkup/snapshot-file.d.ts +53 -0
- package/dist/local/cloudflare-checkup/snapshot-file.d.ts.map +1 -0
- package/dist/local/cloudflare-checkup/snapshot-file.js +186 -0
- package/dist/local/cloudflare-checkup/snapshot-file.js.map +1 -0
- package/dist/local/cloudflare-checkup/submit-client.d.ts +98 -0
- package/dist/local/cloudflare-checkup/submit-client.d.ts.map +1 -0
- package/dist/local/cloudflare-checkup/submit-client.js +349 -0
- package/dist/local/cloudflare-checkup/submit-client.js.map +1 -0
- package/dist/local/cloudflare-checkup/terminal-ui.d.ts +171 -0
- package/dist/local/cloudflare-checkup/terminal-ui.d.ts.map +1 -0
- package/dist/local/cloudflare-checkup/terminal-ui.js +404 -0
- package/dist/local/cloudflare-checkup/terminal-ui.js.map +1 -0
- package/package.json +8 -4
package/CLOUDFLARE.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
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.
|
|
4
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` (also shown at https://vigilbase.com/tools/cloudflare-checkup?mode=local), verifies your work email with a code, installs cf if needed, signs in read-only, collects and uploads after you confirm (see [LOCAL.md](./LOCAL.md)).
|
|
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
|
|
7
9
|
pointers cannot grant live access. Historical restrictions on the same customer
|
package/COMMANDS.md
CHANGED
|
@@ -12,6 +12,7 @@ The CLI uses public scanner APIs on `vigilbase.com` and authenticated APIs on
|
|
|
12
12
|
| Cloudflare | [CLOUDFLARE.md](./CLOUDFLARE.md) |
|
|
13
13
|
| Security | [SECURITY.md](./SECURITY.md) |
|
|
14
14
|
| Customers, organizations, monitoring, support | [ONE.md](./ONE.md) |
|
|
15
|
+
| Local Cloudflare Checkup (cf on your machine) | [LOCAL.md](./LOCAL.md) |
|
|
15
16
|
| Authentication, setup, network troubleshooting | [README.md](./README.md) |
|
|
16
17
|
|
|
17
18
|
The references identify supported operations, filters, response/pagination
|
|
@@ -26,6 +27,7 @@ supported API surface, not every internal endpoint in the monorepo.
|
|
|
26
27
|
| `--help`, `-h` | Help for the named command; makes no API request |
|
|
27
28
|
| `--version`, `-V` | Package version |
|
|
28
29
|
| `--one-url <origin>` | One origin; default `https://one.vigilbase.com` |
|
|
30
|
+
| `--auth-url <origin>` | Explicit registered issuer or loopback development issuer; One discovery chooses the active provider |
|
|
29
31
|
| `--base-url <origin>` | Public origin; default `https://vigilbase.com` |
|
|
30
32
|
| `--timeout <ms>` | Per-request timeout, integer 1–2147483647; default 60000 |
|
|
31
33
|
| `--client-id <id>` | Device authorization client; default `vigilbase-cli` |
|
|
@@ -41,15 +43,16 @@ signed-in role lacks access. Unknown flags, unsupported command-specific flags
|
|
|
41
43
|
|
|
42
44
|
| Command | Options and behavior | One API |
|
|
43
45
|
| --- | --- | --- |
|
|
44
|
-
| `login` | Device authorization; `--no-open` for remote terminals |
|
|
46
|
+
| `login` | Device authorization; `--no-open` for remote terminals | One protected-resource discovery; legacy device endpoints or Identity device code + form token exchange |
|
|
45
47
|
| `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
48
|
| `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 |
|
|
48
|
-
| `logout` |
|
|
49
|
+
| `whoami` | Verify the saved session; signed-out is a successful status query | Legacy session or Identity userinfo when a usable grant exists |
|
|
50
|
+
| `logout` | Revoke Identity refresh grant, then remove local credentials; legacy logout stays local | Identity revocation, when using v2 credentials |
|
|
49
51
|
| `doctor` | Independently check public catalog and One session connectivity | GET `/api/agent/tools`, GET `/api/auth/get-session` |
|
|
50
52
|
|
|
51
53
|
Tokens are saved atomically with owner-only file permissions and tied to their
|
|
52
|
-
issuing One origin
|
|
54
|
+
issuing One origin and, for Identity grants, issuer/client/resource. Rotating
|
|
55
|
+
refresh tokens are coordinated across CLI processes. See README for config directory overrides and certificate
|
|
53
56
|
trust. Login polling handles pending approval, denial, expiry, and transient
|
|
54
57
|
transport failures. Access tokens are never included in successful CLI output.
|
|
55
58
|
|
|
@@ -109,6 +112,31 @@ output, printing, or opening; Windows requires manual opening.
|
|
|
109
112
|
|
|
110
113
|
Customer-specific Watchdog and monitoring views are documented in ONE.md.
|
|
111
114
|
|
|
115
|
+
## Local Cloudflare Checkup (no login)
|
|
116
|
+
|
|
117
|
+
| Command | Options | Requests |
|
|
118
|
+
| --- | --- | --- |
|
|
119
|
+
| `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` | POST `/api/v1/tools/cloudflare-checkup/local-session/request` and `…/verify` (email verification), GET `…/local-session` (before cf runs and again before the upload), allowlisted read-only cf commands, POST `…/local-session/snapshot` after an explicit confirmation; npm only to install the pinned cf when none is usable (asks first) |
|
|
120
|
+
| `cloudflare-checkup login` | `--profile`, `--no-open`, `--dry-run`, `--cf-bin` | Runs `cf auth create <profile> --scopes …` interactively |
|
|
121
|
+
| `cloudflare-checkup doctor` | `--cf-auth`, `--profile`, `--cf-bin` | Offline cf mapping check, one `cf auth whoami` |
|
|
122
|
+
| `cloudflare-checkup accounts` | `--cf-auth`, `--profile`, `--cf-bin` | `cf accounts list` (all pages) |
|
|
123
|
+
| `cloudflare-checkup collect` | `--out` (required), `--account-id`, `--overwrite`, `--dry-run`, `--max-requests-per-5min`, cf options | Allowlisted read-only cf commands; writes the snapshot |
|
|
124
|
+
| `cloudflare-checkup inspect <file>` | — | None |
|
|
125
|
+
| `cloudflare-checkup submit <file>` | `--email`, `--yes`/`--confirm`, `--no-open`, `--base-url`, `--timeout` | POST `…/local-session/request` and `…/verify`, GET `…/local-session`, POST `…/local-session/snapshot` |
|
|
126
|
+
| `cloudflare-checkup logout` | `--profile`, `--cf-bin` | Runs `cf auth delete <profile>` interactively, then removes the cf Vigilbase installed |
|
|
127
|
+
|
|
128
|
+
Each subcommand also works as `local cloudflare-checkup <subcommand>`. The one
|
|
129
|
+
command and `submit` verify your work email first: the CLI asks for it (or
|
|
130
|
+
takes `--email`), vigilbase.com emails a 6-digit code, and the CLI asks for the
|
|
131
|
+
code (without a terminal, both are read from stdin, one line each; add
|
|
132
|
+
`--yes`). In a terminal both show an interactive timeline on stderr (inputs,
|
|
133
|
+
arrow-key questions, spinners, a collection progress bar); pipes, CI,
|
|
134
|
+
`TERM=dumb` and `--json` keep the plain lines and prompts. Ctrl-C exits 130. The address, the code and the session code are never echoed, logged,
|
|
135
|
+
stored or passed to cf or npm. cf output and stderr are never echoed; failures
|
|
136
|
+
carry a stable `code` and `hint` that point at running the same command again.
|
|
137
|
+
See [LOCAL.md](./LOCAL.md) for the email verification, the managed cf install,
|
|
138
|
+
the allowlist, environment policy, uploaded data and error codes.
|
|
139
|
+
|
|
112
140
|
## Output, effects, and testing
|
|
113
141
|
|
|
114
142
|
Exit codes: **0** success, **1** validation/API/network failure, **2** HTTP 429
|
|
@@ -124,7 +152,14 @@ JSON for automation and evidence export.
|
|
|
124
152
|
|
|
125
153
|
Provider credentials, signed delegation claims, internal bearer tokens, and
|
|
126
154
|
organization-authority overrides are never CLI inputs. New commands use named
|
|
127
|
-
One routes.
|
|
155
|
+
One routes. Exceptions: local provider reads and the two named vigilbase.com
|
|
156
|
+
local-session routes. `vigilbase cloudflare-checkup` runs Cloudflare's own
|
|
157
|
+
`cf` CLI on your machine with a fixed allowlist of read-only commands; cf owns
|
|
158
|
+
your Cloudflare login, and the Vigilbase CLI never reads, prints, stores or
|
|
159
|
+
uploads it. Its only Vigilbase requests are `GET /api/v1/tools/cloudflare-checkup/local-session`
|
|
160
|
+
and, after you confirm, `POST /api/v1/tools/cloudflare-checkup/local-session/snapshot`
|
|
161
|
+
with the exact snapshot file, authorised by the code the page minted for your
|
|
162
|
+
verified email (see [LOCAL.md](./LOCAL.md)). Webhooks, cron/admin repair endpoints, interactive OAuth handoffs,
|
|
128
163
|
streaming/binary downloads, and endpoints that auto-provision on GET are outside
|
|
129
164
|
this expansion. Remediation effects requiring durable approval/receipt workflows
|
|
130
165
|
remain in their existing supported One/Vigil flows.
|
|
@@ -132,7 +167,9 @@ remain in their existing supported One/Vigil flows.
|
|
|
132
167
|
```bash
|
|
133
168
|
pnpm --filter @vigilbase/cli check
|
|
134
169
|
# Includes typecheck, unit tests, production build, login lifecycle smoke,
|
|
135
|
-
#
|
|
170
|
+
# every fixture-listed command over HTTP in both JSON and text modes, and the
|
|
171
|
+
# local checkup smoke (fake cf on a restricted PATH, a fake npm for the managed
|
|
172
|
+
# cf install, loopback local-session routes).
|
|
136
173
|
|
|
137
174
|
VIGILBASE_BASE_URL=https://vigilbase.com \
|
|
138
175
|
VIGILBASE_SMOKE_ARTIFACTS="$PWD/.context/cli-live-smoke" \
|