@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/CLOUDFLARE.md CHANGED
@@ -1,8 +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
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)).
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)).
6
6
 
7
7
  Customer provider access requires an `active` or `trialing` Cloudflare service
8
8
  entitlement for the selected account. Historical/inactive rows and legacy account
@@ -109,6 +109,3 @@ Checkup progress reads once and does not poll automatically. Run the command aga
109
109
 
110
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.
111
111
 
112
- ## Verification
113
-
114
- `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,76 +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
- | Local Cloudflare Checkup (cf on your machine) | [LOCAL.md](./LOCAL.md) |
16
- | 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) |
17
17
 
18
- The references identify supported operations, filters, response/pagination
19
- behavior, API endpoints, and access requirements. They describe the CLI's
20
- 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.
21
20
 
22
21
  ## Global options
23
22
 
24
23
  | Flag | Meaning |
25
24
  | --- | --- |
26
- | `--json`, `-j` | JSON on stdout; progress/browser instructions on stderr |
25
+ | `--json`, `-j` | JSON on stdout; progress and browser instructions on stderr |
27
26
  | `--help`, `-h` | Help for the named command; makes no API request |
28
- | `--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` |
29
28
  | `--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
+ | `--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` |
31
30
  | `--base-url <origin>` | Public origin; default `https://vigilbase.com` |
32
31
  | `--timeout <ms>` | Per-request timeout, integer 1–2147483647; default 60000 |
33
32
  | `--client-id <id>` | Device authorization client; default `vigilbase-cli` |
34
33
 
35
- Origins must be HTTP(S) URLs without credentials, paths, query strings, or
36
- fragments. One requires HTTPS, except HTTP loopback development. `--customer-id` is a command-specific One customer UUID; it does not
37
- change the session's permissions. API-backed reads may still return 403 when the
38
- signed-in role lacks access. Unknown flags, unsupported command-specific flags
39
- (including scope flags), and extra positional arguments fail before API access.
40
- `--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`.
41
41
 
42
42
  ## Authentication
43
43
 
44
- | 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 |
45
49
  | --- | --- | --- |
46
- | `login` | Device authorization; `--no-open` for remote terminals | One protected-resource discovery; legacy device endpoints or Identity device code + form token exchange |
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` |
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` |
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 |
51
- | `doctor` | Independently check public catalog and One session connectivity | GET `/api/agent/tools`, GET `/api/auth/get-session` |
52
-
53
- Tokens are saved atomically with owner-only file permissions and tied to their
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
56
- trust. Login polling handles pending approval, denial, expiry, and transient
57
- 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`.
58
72
 
59
73
  ## Public scanners and authenticated scans
60
74
 
61
75
  | Command | Options | API |
62
76
  | --- | --- | --- |
63
- | `list` (alias `tools`) | Lists the public catalog and authenticated scanner names | GET `/api/agent/tools` |
64
- | `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` |
65
79
  | `headers <url>` | Shortcut for `run security-headers`; same routing options | Same as `run` |
66
80
  | `email <domain>` | Shortcut for `run email-security`; same routing options | Same as `run` |
67
81
  | `describe <tool>` | `--no-skill` skips fetching skill Markdown | Catalog plus the tool's published skill URL |
68
- | `skill <tool>` | Prints the complete published skill; JSON includes URL/content | Catalog plus the tool's skill URL |
69
- | `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:
70
94
 
71
- Public tools: `security-headers`, `email-security`. Login-required tools:
72
- `website-security`, `react2shell`, `fortibleed-check`. Public scans stay on the
73
- public API unless explicitly routed to One. A saved login alone does not change
74
- that choice. `--public` and `--via one` cannot be combined.
95
+ ```
96
+ Error: This tool needs a Vigilbase One sign-in: run `vigilbase login`.
97
+ ```
98
+
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>).`
75
117
 
76
118
  ## Account and billing
77
119
 
@@ -84,21 +126,20 @@ that choice. `--public` and `--via one` cannot be combined.
84
126
  | `account sessions` | `session` | GET `/api/account/sessions` |
85
127
  | `account invites` | `invitations`; optional `list` or `ls` | GET `/api/auth/orgs/invitations` |
86
128
  | `account invites create` | `add` alias; `--email <email>`, `--role <role>` (default member), required `--confirm` | POST `/api/auth/orgs/invite` |
87
- | `account billing` | Delegates to billing commands | Same as billing |
129
+ | `account billing` | Same as the billing commands | Same as billing |
88
130
  | `billing` | `summary`, `show`, `status` | GET `/api/account/billing` |
89
131
  | `billing portal` | `open`; `--no-open` prints the portal URL without opening a browser | POST `/api/billing/portal` |
90
132
 
91
- Invitation creation sends an invitation; billing portal creation starts a Stripe
92
- portal session. These are explicit actions. Billing data comes from One's Stripe
93
- 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.
94
136
 
95
- Invitations validate the email and role locally and generate a fresh UUID
96
- `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`,
97
139
  `partner_owner`, `partner_sales`, `partner_operations`, `partner_finance`,
98
- `partner_readonly`, `billing_only`, and `sales_only`. The API still checks whether
99
- the caller may assign the chosen role. `--confirm` is required.
100
- Portal URLs are validated against the HTTPS Stripe billing host before JSON
101
- 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.
102
143
 
103
144
  ## Run history and account Watchdog
104
145
 
@@ -106,79 +147,76 @@ output, printing, or opening; Windows requires manual opening.
106
147
  | --- | --- | --- |
107
148
  | `runs` | `list`, `ls`; `--tool <name>`, `--limit <n>` (1–200, default 50) | GET `/api/tool-runs` |
108
149
  | `runs get <id>` | `show <id>` or `runs <UUID>` | GET `/api/tool-runs/<id>` |
109
- | `runhistory` | Alias of the entire `runs` group | Same as runs |
150
+ | `runhistory` | Alias of the whole `runs` group | Same as runs |
110
151
  | `watchdog` | `list`, `targets`, `status` | GET `/api/account/watchdog/targets` |
111
152
  | `watchdog scans` | `scan`; `--target-id <UUID>`, `--limit <n>` (1–100, default 20) | GET `/api/account/watchdog/scans` |
112
153
 
113
- Customer-specific Watchdog and monitoring views are documented in ONE.md.
154
+ Customer-specific Watchdog and monitoring views are in ONE.md.
155
+
156
+ ## Local Cloudflare Checkup (no sign-in)
114
157
 
115
- ## Local Cloudflare Checkup (no login)
158
+ All vigilbase.com paths below are under
159
+ `https://vigilbase.com/api/v1/tools/cloudflare-checkup/local-session`.
116
160
 
117
161
  | Command | Options | Requests |
118
162
  | --- | --- | --- |
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) |
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) |
120
164
  | `cloudflare-checkup login` | `--profile`, `--no-open`, `--dry-run`, `--cf-bin` | Runs `cf auth create <profile> --scopes …` interactively |
121
165
  | `cloudflare-checkup doctor` | `--cf-auth`, `--profile`, `--cf-bin` | Offline cf mapping check, one `cf auth whoami` |
122
166
  | `cloudflare-checkup accounts` | `--cf-auth`, `--profile`, `--cf-bin` | `cf accounts list` (all pages) |
123
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 |
124
168
  | `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` |
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` |
126
170
  | `cloudflare-checkup logout` | `--profile`, `--cf-bin` | Runs `cf auth delete <profile>` interactively, then removes the cf Vigilbase installed |
127
171
 
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
-
140
- ## Output, effects, and testing
141
-
142
- Exit codes: **0** success, **1** validation/API/network failure, **2** HTTP 429
143
- rate limiting. A completed scan whose result is unsuccessful also exits 1.
144
- `whoami` being signed out is not an API failure. A healthy `doctor` does not
145
- require login. API error JSON retains status, code, and retry delay when available.
146
-
147
- New security/customer operations preserve JSON response envelopes and pagination
148
- fields. Cloudflare inventory commands may apply the explicitly requested account
149
- or zone filter locally as well as sending it to One; zone detail returns the
150
- selected object. See each reference for details. Text output is for people; use
151
- JSON for automation and evidence export.
152
-
153
- Provider credentials, signed delegation claims, internal bearer tokens, and
154
- organization-authority overrides are never CLI inputs. New commands use named
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,
163
- streaming/binary downloads, and endpoints that auto-provision on GET are outside
164
- this expansion. Remediation effects requiring durable approval/receipt workflows
165
- remain in their existing supported One/Vigil flows.
166
-
167
- ```bash
168
- pnpm --filter @vigilbase/cli check
169
- # Includes typecheck, unit tests, production build, login lifecycle smoke,
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).
173
-
174
- VIGILBASE_BASE_URL=https://vigilbase.com \
175
- VIGILBASE_SMOKE_ARTIFACTS="$PWD/.context/cli-live-smoke" \
176
- pnpm --filter @vigilbase/cli smoke:e2e
177
- ```
178
-
179
- The command suite uses temporary local HTTP fixtures and credentials; all writes
180
- stay local. It checks exact methods/paths/filters/bodies, bearer handling, output,
181
- permission failures, rate limits, malformed responses, and documentation presence.
182
- The live smoke separately checks public services and actual public scans. Real
183
- customer-data access additionally requires a valid One session and suitable role;
184
- local fixtures do not prove production provider configuration or data health.
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.