@vigilbase/cli 0.1.2 → 0.1.4
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 +112 -0
- package/COMMANDS.md +147 -0
- package/ONE.md +99 -0
- package/README.md +188 -54
- package/SECURITY.md +134 -0
- package/dist/auth/device-auth.d.ts +1 -1
- package/dist/auth/device-auth.d.ts.map +1 -1
- package/dist/auth/device-auth.js +68 -72
- package/dist/auth/device-auth.js.map +1 -1
- package/dist/auth/store.d.ts +4 -6
- package/dist/auth/store.d.ts.map +1 -1
- package/dist/auth/store.js +136 -54
- package/dist/auth/store.js.map +1 -1
- package/dist/auth/types.d.ts +2 -1
- package/dist/auth/types.d.ts.map +1 -1
- package/dist/bin.js +2 -0
- package/dist/bin.js.map +1 -1
- package/dist/cli.d.ts +1 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +89 -8
- package/dist/cli.js.map +1 -1
- package/dist/commands/account.d.ts.map +1 -1
- package/dist/commands/account.js +25 -9
- package/dist/commands/account.js.map +1 -1
- package/dist/commands/auth.d.ts +1 -0
- package/dist/commands/auth.d.ts.map +1 -1
- package/dist/commands/auth.js +49 -10
- package/dist/commands/auth.js.map +1 -1
- package/dist/commands/billing.d.ts.map +1 -1
- package/dist/commands/billing.js +5 -1
- package/dist/commands/billing.js.map +1 -1
- package/dist/commands/cloudflare.d.ts +1 -0
- package/dist/commands/cloudflare.d.ts.map +1 -1
- package/dist/commands/cloudflare.js +328 -40
- package/dist/commands/cloudflare.js.map +1 -1
- package/dist/commands/helpers.d.ts +35 -0
- package/dist/commands/helpers.d.ts.map +1 -1
- package/dist/commands/helpers.js +12 -0
- package/dist/commands/helpers.js.map +1 -1
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/commands/index.js +7 -0
- package/dist/commands/index.js.map +1 -1
- package/dist/commands/legacy-validation.d.ts +21 -0
- package/dist/commands/legacy-validation.d.ts.map +1 -0
- package/dist/commands/legacy-validation.js +20 -0
- package/dist/commands/legacy-validation.js.map +1 -0
- package/dist/commands/one.d.ts +6 -0
- package/dist/commands/one.d.ts.map +1 -0
- package/dist/commands/one.js +200 -0
- package/dist/commands/one.js.map +1 -0
- package/dist/commands/public-tools.d.ts.map +1 -1
- package/dist/commands/public-tools.js +68 -11
- package/dist/commands/public-tools.js.map +1 -1
- package/dist/commands/runs.d.ts.map +1 -1
- package/dist/commands/runs.js +19 -12
- package/dist/commands/runs.js.map +1 -1
- package/dist/commands/security.d.ts +6 -0
- package/dist/commands/security.d.ts.map +1 -0
- package/dist/commands/security.js +391 -0
- package/dist/commands/security.js.map +1 -0
- package/dist/commands/watchdog.d.ts.map +1 -1
- package/dist/commands/watchdog.js +15 -12
- package/dist/commands/watchdog.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/client.d.ts +3 -0
- package/dist/lib/client.d.ts.map +1 -1
- package/dist/lib/client.js +35 -62
- package/dist/lib/client.js.map +1 -1
- package/dist/lib/cloudflare-client.d.ts +40 -0
- package/dist/lib/cloudflare-client.d.ts.map +1 -0
- package/dist/lib/cloudflare-client.js +81 -0
- package/dist/lib/cloudflare-client.js.map +1 -0
- package/dist/lib/config.d.ts +2 -0
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +37 -12
- package/dist/lib/config.js.map +1 -1
- package/dist/lib/format.d.ts +2 -0
- package/dist/lib/format.d.ts.map +1 -1
- package/dist/lib/format.js +23 -8
- package/dist/lib/format.js.map +1 -1
- package/dist/lib/help.d.ts +2 -2
- package/dist/lib/help.d.ts.map +1 -1
- package/dist/lib/help.js +45 -12
- package/dist/lib/help.js.map +1 -1
- package/dist/lib/network.d.ts +17 -0
- package/dist/lib/network.d.ts.map +1 -0
- package/dist/lib/network.js +108 -0
- package/dist/lib/network.js.map +1 -0
- package/dist/lib/one-client.d.ts +10 -1
- package/dist/lib/one-client.d.ts.map +1 -1
- package/dist/lib/one-client.js +52 -50
- package/dist/lib/one-client.js.map +1 -1
- package/dist/lib/one-operations.d.ts +11 -0
- package/dist/lib/one-operations.d.ts.map +1 -0
- package/dist/lib/one-operations.js +67 -0
- package/dist/lib/one-operations.js.map +1 -0
- package/dist/lib/open-url.d.ts +2 -0
- package/dist/lib/open-url.d.ts.map +1 -1
- package/dist/lib/open-url.js +23 -22
- package/dist/lib/open-url.js.map +1 -1
- package/dist/lib/progress.d.ts +1 -1
- package/dist/lib/progress.d.ts.map +1 -1
- package/dist/lib/progress.js +3 -1
- package/dist/lib/progress.js.map +1 -1
- package/dist/lib/security-client.d.ts +279 -0
- package/dist/lib/security-client.d.ts.map +1 -0
- package/dist/lib/security-client.js +111 -0
- package/dist/lib/security-client.js.map +1 -0
- package/dist/lib/skill-fetch.d.ts +7 -0
- package/dist/lib/skill-fetch.d.ts.map +1 -0
- package/dist/lib/skill-fetch.js +102 -0
- package/dist/lib/skill-fetch.js.map +1 -0
- package/dist/lib/system-trust.d.ts +8 -0
- package/dist/lib/system-trust.d.ts.map +1 -0
- package/dist/lib/system-trust.js +11 -0
- package/dist/lib/system-trust.js.map +1 -0
- package/package.json +12 -2
package/CLOUDFLARE.md
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# Cloudflare CLI reference
|
|
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.
|
|
4
|
+
|
|
5
|
+
Customer provider access requires an `active` or `trialing` Cloudflare service
|
|
6
|
+
entitlement for the selected account. Historical/inactive rows and legacy account
|
|
7
|
+
pointers cannot grant live access. Historical restrictions on the same customer
|
|
8
|
+
and account still tighten zone allowlists. Internal administrative access remains
|
|
9
|
+
subject to its existing permission checks.
|
|
10
|
+
|
|
11
|
+
All commands support `--json`, `--one-url <origin>`, `--timeout <milliseconds>`, and `--help`. JSON mode preserves API response envelopes except inventory filtering and account/zone detail extraction described below. Terminal mode displays IDs for follow-up commands and removes terminal control characters from provider data.
|
|
12
|
+
|
|
13
|
+
## Selecting a customer, account, or zone
|
|
14
|
+
|
|
15
|
+
Customer IDs are UUIDs. Cloudflare account and zone IDs are 32 hexadecimal characters. Find these with:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
vigilbase cf accounts
|
|
19
|
+
vigilbase cf zones
|
|
20
|
+
vigilbase cf workspace --json
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
`--customer-id` explicitly selects a customer; it never grants access to that customer. Customer users can usually omit it when their organization identifies the customer. Internal users should select it for customer-specific operations. Analytics always requires it. Live zone detail requires it; zone detail without it uses the stored workspace inventory.
|
|
24
|
+
|
|
25
|
+
An account or zone positional ID can instead be supplied using `--account-id` or `--zone-id` for commands that take that kind of ID. Supplying both requires identical values. Account-resource commands reject `--zone-id`; DNS, WAF, and speed-settings reject `--account-id` because those APIs scope by zone. `--days` is accepted only for analytics.
|
|
26
|
+
|
|
27
|
+
## Command grammar
|
|
28
|
+
|
|
29
|
+
In this table, `C` means `[--customer-id <uuid>]`, `A` means `[--account-id <hex-id>]`, and `Z` means `[--zone-id <hex-id>]`. Every command also accepts the common options above.
|
|
30
|
+
|
|
31
|
+
| Command | Selection | Result |
|
|
32
|
+
| --- | --- | --- |
|
|
33
|
+
| `cf` / `cf zones` | C A Z | Stored zone inventory; exact account and zone filters |
|
|
34
|
+
| `cf zone` | C A Z | Historical alias for inventory when no zone ID is given |
|
|
35
|
+
| `cf zone <zone-id>` | C A | Zone detail; live when C is supplied, otherwise stored inventory |
|
|
36
|
+
| `cf accounts` | C A | Accessible account inventory including customer and service IDs |
|
|
37
|
+
| `cf account <account-id>` | C | One stored account summary |
|
|
38
|
+
| `cf workspace [section]` | C A Z | Workspace bootstrap or section data |
|
|
39
|
+
| `cf dns <zone-id>` | C | DNS record IDs, types, names, contents, TTL and proxy state |
|
|
40
|
+
| `cf waf <zone-id>` | C | Rules, expressions, analytics availability and suggestions |
|
|
41
|
+
| `cf speed-settings <zone-id>` | C | Current performance settings; internal access required |
|
|
42
|
+
| `cf audit-logs <account-id>` | C | Most recent provider audit events, up to 100 |
|
|
43
|
+
| `cf zero-trust <account-id>` | C | Users, Access applications, tunnels and authentication analytics |
|
|
44
|
+
| `cf developer-platform <account-id>` | C | Workers, Workers analytics and Pages projects |
|
|
45
|
+
| `cf magic-transit <account-id>` | C | Prefixes, routes and traffic analytics |
|
|
46
|
+
| `cf analytics --customer-id <uuid>` | A or Z, `[--days <1..30>]` | Usage and traffic analytics; default 7 days |
|
|
47
|
+
| `cf checkup [status]` | C A | Setup state and latest completed checkup |
|
|
48
|
+
| `cf checkup start` | C A | Starts a persisted account security checkup |
|
|
49
|
+
| `cf checkup progress <run-uuid>` | None | Persisted progress events, percentage and status |
|
|
50
|
+
| `cf checkup result <run-uuid>` | None | Run details and stored result |
|
|
51
|
+
|
|
52
|
+
`checkups` aliases `checkup`; `list` and `show` alias checkup `status`; `run` aliases checkup `start`. Progress/result commands use the run UUID's server-enforced access scope and reject customer/account filters.
|
|
53
|
+
|
|
54
|
+
Workspace sections are `overview`, `reports`, `zones`, `rule-analyzer`, `accounts`, `checkups`, and `settings`. Omitting the section returns customer/service metadata, accessible accounts, selected account/zone and navigation. Available sections depend on server permissions. `settings` is workspace selection/configuration context, not a claim about live zone security settings.
|
|
55
|
+
|
|
56
|
+
Workspace account/zone arguments select context; a workspace section can still include other accessible inventory. Use `cf zones --account-id ... --zone-id ...` for exact inventory filtering. `cf account` refuses ambiguous account links across customers until `--customer-id` is supplied; it prefers active/trialing service rows among historical duplicates for the same customer. Account and inventory zone detail return `{ "success": true, "data": <selected item> }`.
|
|
57
|
+
|
|
58
|
+
## Examples
|
|
59
|
+
|
|
60
|
+
Replace example IDs with IDs from your account inventory:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
vigilbase cf account bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
|
|
64
|
+
vigilbase cf zone aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa --customer-id cb156546-b6ba-42a9-bdd0-4a09cb156546
|
|
65
|
+
vigilbase cf dns aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa --json
|
|
66
|
+
vigilbase cf waf aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
|
67
|
+
vigilbase cf zero-trust bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb --json
|
|
68
|
+
vigilbase cf developer-platform bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
|
|
69
|
+
vigilbase cf magic-transit bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
|
|
70
|
+
vigilbase cf audit-logs bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
|
|
71
|
+
vigilbase cf workspace reports --customer-id cb156546-b6ba-42a9-bdd0-4a09cb156546
|
|
72
|
+
vigilbase cf analytics --customer-id cb156546-b6ba-42a9-bdd0-4a09cb156546 --account-id bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb --days 14
|
|
73
|
+
vigilbase cf checkup start --account-id bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb --json
|
|
74
|
+
vigilbase cf checkup progress d047b25a-2410-42a0-94f3-a8d6a249ad2b
|
|
75
|
+
vigilbase cf checkup result d047b25a-2410-42a0-94f3-a8d6a249ad2b --json
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## API mapping and effects
|
|
79
|
+
|
|
80
|
+
Every path below is relative to the configured One origin. `customerId`, `accountId`, and `zoneId` query parameters are omitted when the corresponding optional selection is absent.
|
|
81
|
+
|
|
82
|
+
| Command | Method and endpoint | Effect |
|
|
83
|
+
| --- | --- | --- |
|
|
84
|
+
| Unfiltered `zones` | `GET /api/account/cloudflare/zones` | Read stored inventory |
|
|
85
|
+
| Filtered `zones`, inventory zone detail | `GET /api/services/cloudflare/workspace/zones?customerId=C&account=A&zone=Z` | Read scoped inventory; CLI applies exact filters |
|
|
86
|
+
| Live zone detail | `GET /api/customers/C/cloudflare/zones/Z` | Read provider zone |
|
|
87
|
+
| `accounts`, `account`, workspace bootstrap | `GET /api/services/cloudflare/workspace?customerId=C&account=A` | Read workspace |
|
|
88
|
+
| Workspace section | `GET /api/services/cloudflare/workspace/SECTION?customerId=C&account=A&zone=Z` | Read section |
|
|
89
|
+
| `dns`, `waf` | `GET /api/services/cloudflare/zones/Z/dns` or `/waf`, query `customerId=C` | Read provider records/rules |
|
|
90
|
+
| `speed-settings` | `GET /api/cloudflare/zones/Z/speed-settings?customerId=C` | Read provider settings; internal permission checks |
|
|
91
|
+
| `audit-logs`, `zero-trust`, `developer-platform`, `magic-transit` | `GET /api/cloudflare/accounts/A/RESOURCE?customerId=C` | Read provider account resource |
|
|
92
|
+
| `analytics` | `GET /api/services/cloudflare/analytics?days=N&customerId=C&accountId=A` or `zoneId=Z` | Read usage/provider analytics |
|
|
93
|
+
| Checkup status | `GET /api/services/cloudflare/checkups?customerId=C&accountId=A` | Read completed checkup/configuration |
|
|
94
|
+
| Checkup start | `POST /api/services/cloudflare/checkups/start`, JSON `{customerId?, accountId?}` | Starts scanner and persists a run; no DNS/WAF configuration edits |
|
|
95
|
+
| Checkup progress | `GET /api/services/cloudflare/checkups/progress?toolRunId=ID` | Read up to 500 persisted events per response |
|
|
96
|
+
| Checkup result | `GET /api/tool-runs/ID` | Read stored run; server may claim eligible run ownership for the organization |
|
|
97
|
+
|
|
98
|
+
Account audit logs require service-read permissions. Zero Trust, Developer Platform and Magic Transit require deployment-read permissions. Speed settings require internal access plus service/deployment read permissions. One verifies tenant/account/zone bindings for these reads; account-wide reads may be unavailable for grants restricted to individual zones.
|
|
99
|
+
|
|
100
|
+
## Data availability and failures
|
|
101
|
+
|
|
102
|
+
The API may return empty audit logs, WAF rules, speed settings or other account data when provider permissions, plan features or provider availability prevent collection. Empty lists do not establish absence of activity or protection. Audit logs use the endpoint's fixed latest-100 window; no CLI pagination or date filtering is offered for that route.
|
|
103
|
+
|
|
104
|
+
Analytics prefers scoped stored usage when available and otherwise uses provider analytics. Live zone analytics covers the most recent 23 hours regardless of `--days`; account analytics uses the requested period. Zero-valued results can represent unavailable data. JSON mode preserves the API's shape, including either `analytics` or `bandwidth`.
|
|
105
|
+
|
|
106
|
+
Checkup progress reads once and does not poll automatically. Run the command again to refresh. Status describes the latest completed run; use its returned run ID or the ID from `start` with `progress` to inspect an in-progress scan. `result` verifies that the selected run is a Cloudflare checkup and reports when no result is available yet.
|
|
107
|
+
|
|
108
|
+
Malformed IDs, conflicting selections, extra positional arguments and unsupported scope combinations fail before a network request. Authentication, permission, HTTP and explicit `success:false` API failures return a nonzero exit status. Provider configuration writes, token management, cache purge, account deletion and DNS edits are not exposed by this command group.
|
|
109
|
+
|
|
110
|
+
## Verification
|
|
111
|
+
|
|
112
|
+
`pnpm --filter @vigilbase/cli test` runs command contract tests, including tenant filters, exact paths, bearer authentication, rejected input, permission failures and terminal text handling. Cloudflare fixtures in `scripts/fixtures/cloudflare.mjs` cover every command and workspace section for the compiled CLI end-to-end harness. These fixtures execute against a local HTTP server; the checkup-start case never contacts production.
|
package/COMMANDS.md
ADDED
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
# Vigilbase CLI command reference
|
|
2
|
+
|
|
3
|
+
The CLI uses public scanner APIs on `vigilbase.com` and authenticated APIs on
|
|
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.
|
|
7
|
+
|
|
8
|
+
## References
|
|
9
|
+
|
|
10
|
+
| Area | Complete command and API reference |
|
|
11
|
+
| --- | --- |
|
|
12
|
+
| Cloudflare | [CLOUDFLARE.md](./CLOUDFLARE.md) |
|
|
13
|
+
| Security | [SECURITY.md](./SECURITY.md) |
|
|
14
|
+
| Customers, organizations, monitoring, support | [ONE.md](./ONE.md) |
|
|
15
|
+
| Authentication, setup, network troubleshooting | [README.md](./README.md) |
|
|
16
|
+
|
|
17
|
+
The references identify supported operations, filters, response/pagination
|
|
18
|
+
behavior, API endpoints, and access requirements. They describe the CLI's
|
|
19
|
+
supported API surface, not every internal endpoint in the monorepo.
|
|
20
|
+
|
|
21
|
+
## Global options
|
|
22
|
+
|
|
23
|
+
| Flag | Meaning |
|
|
24
|
+
| --- | --- |
|
|
25
|
+
| `--json`, `-j` | JSON on stdout; progress/browser instructions on stderr |
|
|
26
|
+
| `--help`, `-h` | Help for the named command; makes no API request |
|
|
27
|
+
| `--version`, `-V` | Package version |
|
|
28
|
+
| `--one-url <origin>` | One origin; default `https://one.vigilbase.com` |
|
|
29
|
+
| `--base-url <origin>` | Public origin; default `https://vigilbase.com` |
|
|
30
|
+
| `--timeout <ms>` | Per-request timeout, integer 1–2147483647; default 60000 |
|
|
31
|
+
| `--client-id <id>` | Device authorization client; default `vigilbase-cli` |
|
|
32
|
+
|
|
33
|
+
Origins must be HTTP(S) URLs without credentials, paths, query strings, or
|
|
34
|
+
fragments. One requires HTTPS, except HTTP loopback development. `--customer-id` is a command-specific One customer UUID; it does not
|
|
35
|
+
change the session's permissions. API-backed reads may still return 403 when the
|
|
36
|
+
signed-in role lacks access. Unknown flags, unsupported command-specific flags
|
|
37
|
+
(including scope flags), and extra positional arguments fail before API access.
|
|
38
|
+
`--style` applies only to `badge`.
|
|
39
|
+
|
|
40
|
+
## Authentication
|
|
41
|
+
|
|
42
|
+
| Command | Options and behavior | One API |
|
|
43
|
+
| --- | --- | --- |
|
|
44
|
+
| `login` | Device authorization; `--no-open` for remote terminals | POST `/api/auth/device/code`, POST `/api/auth/device/token` |
|
|
45
|
+
| `login --token-stdin` | Validate and save a token piped from a secret manager; input is bounded and never echoed | GET `/api/auth/get-session` |
|
|
46
|
+
| `login --token <bearer>` | Legacy input; discouraged because arguments can appear in process lists/history. `VIGILBASE_ONE_TOKEN` is also supported; neither combines with `--token-stdin` | GET `/api/auth/get-session` |
|
|
47
|
+
| `whoami` | Verify the saved session; signed-out is a successful status query | GET `/api/auth/get-session` when a usable token exists |
|
|
48
|
+
| `logout` | Remove local credentials; does not revoke the server session | Local only |
|
|
49
|
+
| `doctor` | Independently check public catalog and One session connectivity | GET `/api/agent/tools`, GET `/api/auth/get-session` |
|
|
50
|
+
|
|
51
|
+
Tokens are saved atomically with owner-only file permissions and tied to their
|
|
52
|
+
issuing One origin. See README for config directory overrides and certificate
|
|
53
|
+
trust. Login polling handles pending approval, denial, expiry, and transient
|
|
54
|
+
transport failures. Access tokens are never included in successful CLI output.
|
|
55
|
+
|
|
56
|
+
## Public scanners and authenticated scans
|
|
57
|
+
|
|
58
|
+
| Command | Options | API |
|
|
59
|
+
| --- | --- | --- |
|
|
60
|
+
| `list` (alias `tools`) | Lists the public catalog and authenticated scanner names | GET `/api/agent/tools` |
|
|
61
|
+
| `run <tool> <target>` | `--via public\|one`; `--public` forces the public API | POST `/api/agent/tools/<tool>/execute` or One POST `/api/tools/<tool>/execute` |
|
|
62
|
+
| `headers <url>` | Shortcut for `run security-headers`; same routing options | Same as `run` |
|
|
63
|
+
| `email <domain>` | Shortcut for `run email-security`; same routing options | Same as `run` |
|
|
64
|
+
| `describe <tool>` | `--no-skill` skips fetching skill Markdown | Catalog plus the tool's published skill URL |
|
|
65
|
+
| `skill <tool>` | Prints the complete published skill; JSON includes URL/content | Catalog plus the tool's skill URL |
|
|
66
|
+
| `badge <domain>` | `--style default\|compact\|mini` | Generates a public badge URL locally |
|
|
67
|
+
|
|
68
|
+
Public tools: `security-headers`, `email-security`. Login-required tools:
|
|
69
|
+
`website-security`, `react2shell`, `fortibleed-check`. Public scans stay on the
|
|
70
|
+
public API unless explicitly routed to One. A saved login alone does not change
|
|
71
|
+
that choice. `--public` and `--via one` cannot be combined.
|
|
72
|
+
|
|
73
|
+
## Account and billing
|
|
74
|
+
|
|
75
|
+
| Command | Aliases/options | One API |
|
|
76
|
+
| --- | --- | --- |
|
|
77
|
+
| `account` | `show`, `me`, `overview` | GET `/api/account` |
|
|
78
|
+
| `account services` | `service` | GET `/api/account/services` |
|
|
79
|
+
| `account org` | `organization`, `members` | GET `/api/account/organization` |
|
|
80
|
+
| `account endpoints` | `endpoint` | GET `/api/account/endpoints` |
|
|
81
|
+
| `account sessions` | `session` | GET `/api/account/sessions` |
|
|
82
|
+
| `account invites` | `invitations`; optional `list` or `ls` | GET `/api/auth/orgs/invitations` |
|
|
83
|
+
| `account invites create` | `add` alias; `--email <email>`, `--role <role>` (default member), required `--confirm` | POST `/api/auth/orgs/invite` |
|
|
84
|
+
| `account billing` | Delegates to billing commands | Same as billing |
|
|
85
|
+
| `billing` | `summary`, `show`, `status` | GET `/api/account/billing` |
|
|
86
|
+
| `billing portal` | `open`; `--no-open` prints the portal URL without opening a browser | POST `/api/billing/portal` |
|
|
87
|
+
|
|
88
|
+
Invitation creation sends an invitation; billing portal creation starts a Stripe
|
|
89
|
+
portal session. These are explicit actions. Billing data comes from One's Stripe
|
|
90
|
+
integration; the CLI does not persist invoices or payment information locally.
|
|
91
|
+
|
|
92
|
+
Invitations validate the email and role locally and generate a fresh UUID
|
|
93
|
+
`operationId` for each invocation. Accepted roles: `admin`, `member`, `readonly`,
|
|
94
|
+
`partner_owner`, `partner_sales`, `partner_operations`, `partner_finance`,
|
|
95
|
+
`partner_readonly`, `billing_only`, and `sales_only`. The API still checks whether
|
|
96
|
+
the caller may assign the chosen role. `--confirm` is required.
|
|
97
|
+
Portal URLs are validated against the HTTPS Stripe billing host before JSON
|
|
98
|
+
output, printing, or opening; Windows requires manual opening.
|
|
99
|
+
|
|
100
|
+
## Run history and account Watchdog
|
|
101
|
+
|
|
102
|
+
| Command | Options/aliases | One API |
|
|
103
|
+
| --- | --- | --- |
|
|
104
|
+
| `runs` | `list`, `ls`; `--tool <name>`, `--limit <n>` (1–200, default 50) | GET `/api/tool-runs` |
|
|
105
|
+
| `runs get <id>` | `show <id>` or `runs <UUID>` | GET `/api/tool-runs/<id>` |
|
|
106
|
+
| `runhistory` | Alias of the entire `runs` group | Same as runs |
|
|
107
|
+
| `watchdog` | `list`, `targets`, `status` | GET `/api/account/watchdog/targets` |
|
|
108
|
+
| `watchdog scans` | `scan`; `--target-id <UUID>`, `--limit <n>` (1–100, default 20) | GET `/api/account/watchdog/scans` |
|
|
109
|
+
|
|
110
|
+
Customer-specific Watchdog and monitoring views are documented in ONE.md.
|
|
111
|
+
|
|
112
|
+
## Output, effects, and testing
|
|
113
|
+
|
|
114
|
+
Exit codes: **0** success, **1** validation/API/network failure, **2** HTTP 429
|
|
115
|
+
rate limiting. A completed scan whose result is unsuccessful also exits 1.
|
|
116
|
+
`whoami` being signed out is not an API failure. A healthy `doctor` does not
|
|
117
|
+
require login. API error JSON retains status, code, and retry delay when available.
|
|
118
|
+
|
|
119
|
+
New security/customer operations preserve JSON response envelopes and pagination
|
|
120
|
+
fields. Cloudflare inventory commands may apply the explicitly requested account
|
|
121
|
+
or zone filter locally as well as sending it to One; zone detail returns the
|
|
122
|
+
selected object. See each reference for details. Text output is for people; use
|
|
123
|
+
JSON for automation and evidence export.
|
|
124
|
+
|
|
125
|
+
Provider credentials, signed delegation claims, internal bearer tokens, and
|
|
126
|
+
organization-authority overrides are never CLI inputs. New commands use named
|
|
127
|
+
One routes. Webhooks, cron/admin repair endpoints, interactive OAuth handoffs,
|
|
128
|
+
streaming/binary downloads, and endpoints that auto-provision on GET are outside
|
|
129
|
+
this expansion. Remediation effects requiring durable approval/receipt workflows
|
|
130
|
+
remain in their existing supported One/Vigil flows.
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
pnpm --filter @vigilbase/cli check
|
|
134
|
+
# Includes typecheck, unit tests, production build, login lifecycle smoke,
|
|
135
|
+
# and every fixture-listed command over HTTP in both JSON and text modes.
|
|
136
|
+
|
|
137
|
+
VIGILBASE_BASE_URL=https://vigilbase.com \
|
|
138
|
+
VIGILBASE_SMOKE_ARTIFACTS="$PWD/.context/cli-live-smoke" \
|
|
139
|
+
pnpm --filter @vigilbase/cli smoke:e2e
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
The command suite uses temporary local HTTP fixtures and credentials; all writes
|
|
143
|
+
stay local. It checks exact methods/paths/filters/bodies, bearer handling, output,
|
|
144
|
+
permission failures, rate limits, malformed responses, and documentation presence.
|
|
145
|
+
The live smoke separately checks public services and actual public scans. Real
|
|
146
|
+
customer-data access additionally requires a valid One session and suitable role;
|
|
147
|
+
local fixtures do not prove production provider configuration or data health.
|
package/ONE.md
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# Vigilbase One CLI reference
|
|
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.
|
|
4
|
+
|
|
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
|
+
|
|
7
|
+
```sh
|
|
8
|
+
vigilbase customers list --json
|
|
9
|
+
vigilbase customers summary CUSTOMER_UUID
|
|
10
|
+
vigilbase customers services CUSTOMER_UUID
|
|
11
|
+
vigilbase monitoring status CUSTOMER_UUID --light
|
|
12
|
+
vigilbase monitoring history CUSTOMER_UUID --range 7d --region ams
|
|
13
|
+
vigilbase orgs members
|
|
14
|
+
vigilbase support tickets --all --limit 100
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Replace uppercase placeholders with IDs from the corresponding list. Customer, report, Vigil investigation, and monitoring target IDs must be UUIDs. Organization IDs may contain letters, digits, underscores, and hyphens (maximum 256 characters).
|
|
18
|
+
|
|
19
|
+
## Customers
|
|
20
|
+
|
|
21
|
+
For partner-linked customers, invoice and subscription reads are restricted to
|
|
22
|
+
subscription IDs on that customer's own or linked revenue-active contracts.
|
|
23
|
+
Sibling customers never receive the partner's account-wide Stripe list. Missing
|
|
24
|
+
contract scope fails closed; no allowed subscriptions returns an empty list.
|
|
25
|
+
|
|
26
|
+
`vigilbase customers` defaults to `list`; `ls` is an alias for `list`. Pass customer IDs positionally for this group, rather than `--customer-id`. The table's `C` prefix means `/api/customers/{customer-id}`.
|
|
27
|
+
|
|
28
|
+
| Command after `vigilbase customers` | Flags | One GET endpoint |
|
|
29
|
+
| --- | --- | --- |
|
|
30
|
+
| `list` | None | `/api/customers` |
|
|
31
|
+
| `show <customer-id>` | None | `C` |
|
|
32
|
+
| `summary <customer-id>` | None | `C/summary` |
|
|
33
|
+
| `services <customer-id>` | None | `C/service-records` |
|
|
34
|
+
| `endpoints <customer-id>` | None | `C/endpoints` |
|
|
35
|
+
| `contacts <customer-id>` | None | `C/contacts` |
|
|
36
|
+
| `organization <customer-id>` | None | `C/organization` |
|
|
37
|
+
| `watchdog-targets <customer-id>` | None | `C/watchdog/targets` |
|
|
38
|
+
| `watchdog-scans <customer-id>` | `--limit 1..100`, `--offset 0..1000000`, `--target-id UUID` | `C/watchdog/scans?limit=&offset=&target_id=` |
|
|
39
|
+
| `reports <customer-id>` | `--limit 1..100` | `C/recon/reports?limit=` |
|
|
40
|
+
| `report <customer-id> <report-id>` | None | `C/recon/reports/{report-id}` |
|
|
41
|
+
| `investigations <customer-id>` | `--limit 1..100`, `--cursor TEXT`, `--before ISO`, `--issue-id TEXT` | `C/vigil/investigations?limit=&cursor=&before=&issueId=` |
|
|
42
|
+
| `investigation <customer-id> <investigation-id>` | `--revision 1..2147483647` | `C/vigil/investigations/{investigation-id}?revision=` |
|
|
43
|
+
| `contracts <customer-id>` | `--status draft\|pending\|active\|expired\|terminated` | `C/contracts?status=` |
|
|
44
|
+
| `billing <customer-id>` | None | `C/billing` |
|
|
45
|
+
| `invoices <customer-id>` | `--limit 1..100`, `--status draft\|open\|paid\|uncollectible\|void` | `C/stripe/invoices?limit=&status=` |
|
|
46
|
+
| `subscriptions <customer-id>` | None | `C/stripe/subscriptions` |
|
|
47
|
+
| `projects <customer-id>` | None | `C/projects` |
|
|
48
|
+
|
|
49
|
+
Unspecified query parameters are omitted. API defaults: Watchdog scans limit 20/offset 0, Recon reports limit 12, investigations limit 50, invoices limit 50. For Watchdog scans, advance `--offset` using the response's `total`. For investigations, pass `data.nextCursor` back to `--cursor` (maximum 512 characters); `--before` must be an ISO timestamp with timezone and `--issue-id` is at most 256 characters. `--before` and `--cursor` are mutually exclusive. The API validates opaque cursors. Omitting `--revision` loads the latest investigation revision. Invoice responses preserve `has_more`, but this One endpoint has no cursor option; the CLI cannot fetch subsequent invoice pages beyond the requested limit.
|
|
50
|
+
|
|
51
|
+
Customer discovery follows the API's internal, customer, and partner visibility. Detail/summary/contact/organization/Recon reads require customer read access; endpoints/services require service read access. Watchdog routes require monitoring/tool permissions as enforced by the API. Contracts and billing reads require their respective permissions. Linked project reads are restricted to internal operators with service read access. Vigil investigation reads require internal Vigil investigation permission and the Vigil UI feature to be enabled; disabled deployments return 404. Stripe resources are fetched by One from Stripe and are not persisted by the CLI.
|
|
52
|
+
|
|
53
|
+
The service command uses the dashboard's `/service-records` API. `/customers/{id}/services` and `/customers/search` require a separate Vigil machine credential and are intentionally not exposed. The customer bootstrap `/customers/me` endpoint can provision a customer, so use existing `vigilbase account` to inspect the current customer's context. Generating Watchdog AI insights, re-running investigations, syncing providers, creating reports, and other effectful APIs are not invoked by these read commands.
|
|
54
|
+
|
|
55
|
+
## Organizations
|
|
56
|
+
|
|
57
|
+
`vigilbase orgs` defaults to `list`; `ls` is an alias.
|
|
58
|
+
|
|
59
|
+
| Command after `vigilbase orgs` | One GET endpoint | Access |
|
|
60
|
+
| --- | --- | --- |
|
|
61
|
+
| `list` | `/api/user/organizations` | Current user's organization memberships |
|
|
62
|
+
| `show <organization-id>` | `/api/organizations/{id}` | Internal `read:admin` |
|
|
63
|
+
| `members` | `/api/auth/orgs/members` | Current organization; organization permission checks |
|
|
64
|
+
| `members <organization-id>` | `/api/organizations/{id}/members` | Internal `read:admin` |
|
|
65
|
+
| `roles` | `/api/auth/orgs/permission-roles` | Current organization management access |
|
|
66
|
+
|
|
67
|
+
No operation-specific flags. `roles` returns assignable role templates and permission groups; it does not list each member's roles (use `members`). These commands do not change the active organization attached to the login session. Selecting an organization ID requires the explicit internal API permission above.
|
|
68
|
+
|
|
69
|
+
## Monitoring
|
|
70
|
+
|
|
71
|
+
`vigilbase monitoring` defaults to `health`. All endpoints require `read:monitoring`; customer routes and metric IDs also undergo tenant access checks.
|
|
72
|
+
|
|
73
|
+
| Command after `vigilbase monitoring` | Flags | One GET endpoint |
|
|
74
|
+
| --- | --- | --- |
|
|
75
|
+
| `health` | None | `/api/monitoring/health` |
|
|
76
|
+
| `probes` | None | `/api/monitoring/probes` |
|
|
77
|
+
| `probe-health` | None | `/api/monitoring/probes/health` |
|
|
78
|
+
| `metrics <target-id>...` | None; 1..50 UUID arguments | `/api/monitoring/metrics?target_ids=UUID,UUID` |
|
|
79
|
+
| `targets <customer-id>` | None | `/api/customers/{id}/monitoring/targets` |
|
|
80
|
+
| `status <customer-id>` | `--light` | `/api/customers/{id}/monitoring/status?light=true` |
|
|
81
|
+
| `history <customer-id>` | `--range 24h\|7d\|30d`, `--region CODE`, `--target-id UUID` | `/api/customers/{id}/monitoring/history?range=®ion=&target_id=` |
|
|
82
|
+
|
|
83
|
+
`probes` exposes the internal fleet inventory and requires internal operator access. `probe-health` reports observed health with database fallback. Duplicate metrics target IDs are removed; all requested targets must pass One's access checks. `--light` skips latency and SSL provider reads in status. History defaults to `7d`. Supported regions: `ams nyc lon sgp iad sfo fra dub tok syd cpt gru dxb ewr lhr jnb atl blr bom cdg del dfw hnl icn itm lax mad man mel mex mia mxp nrt ord sao scl sea sjc sto tlv waw yto`.
|
|
84
|
+
|
|
85
|
+
A successful health response may describe an unconfigured backend or unknown probes. Inspect `configured`, `connected`, `status`, `metrics_error`, `has_data`, and `partial`; exit zero means the API request succeeded, not that infrastructure is healthy. Provider-unavailable HTTP errors remain failures with nonzero exit status.
|
|
86
|
+
|
|
87
|
+
## Support
|
|
88
|
+
|
|
89
|
+
```sh
|
|
90
|
+
vigilbase support tickets [--all] [--limit 1..100] [--json]
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
`vigilbase support` also defaults to `tickets`. Maps to GET `/api/support/tickets?includeAll=true&limit=N`; omitted flags omit their query parameters. Requires `support:access`. The API identifies the current organization and its Pylon account. Open tickets are returned by default; `--all` includes closed tickets. Limit defaults to 50. An unlinked account returns an empty list with the API's explanation. `hasMore` is preserved, but this API exposes no cursor pagination. The API may rate-limit requests or return 503 when Pylon is unavailable.
|
|
94
|
+
|
|
95
|
+
## Related commands and validation
|
|
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.
|
package/README.md
CHANGED
|
@@ -1,89 +1,223 @@
|
|
|
1
1
|
# @vigilbase/cli
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Vigilbase public scanners and Vigilbase One customer, security, Cloudflare,
|
|
4
|
+
monitoring, organization, and support operations from the terminal.
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
## Install and sign in
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
vigilbase run security-headers https://vigilbase.com
|
|
10
|
-
vigilbase login
|
|
11
|
-
vigilbase account --json
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
## Install
|
|
8
|
+
Node 20+ is required. Node 22.19+ or Node 24.5+ enables automatic system
|
|
9
|
+
certificate trust.
|
|
15
10
|
|
|
16
11
|
```bash
|
|
17
12
|
npm install -g @vigilbase/cli
|
|
18
|
-
# or
|
|
19
|
-
pnpm add -g @vigilbase/cli
|
|
20
|
-
|
|
13
|
+
# or: pnpm add -g @vigilbase/cli
|
|
21
14
|
vigilbase help
|
|
22
|
-
vigilbase
|
|
15
|
+
vigilbase login
|
|
16
|
+
vigilbase whoami
|
|
23
17
|
```
|
|
24
18
|
|
|
25
|
-
Without
|
|
19
|
+
Without global installation: `npx @vigilbase/cli help`. From this monorepo:
|
|
20
|
+
`pnpm vigilbase help`; build with `pnpm build:cli` and link with
|
|
21
|
+
`pnpm link:vigilbase`.
|
|
26
22
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
```
|
|
23
|
+
Local link/unlink scripts only recognize symlinks resolving to this checkout's
|
|
24
|
+
`dist/bin.js`. Regular binaries, foreign installations, and dangling links are
|
|
25
|
+
preserved; resolve a conflicting installation yourself before linking.
|
|
31
26
|
|
|
32
|
-
##
|
|
27
|
+
## Complete command documentation
|
|
33
28
|
|
|
34
|
-
|
|
|
29
|
+
| Reference | Coverage |
|
|
35
30
|
| --- | --- |
|
|
36
|
-
|
|
|
37
|
-
|
|
|
38
|
-
|
|
|
39
|
-
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
31
|
+
| [COMMANDS.md](./COMMANDS.md) | Core commands, aliases, global flags, API mappings, authentication, output, testing |
|
|
32
|
+
| [CLOUDFLARE.md](./CLOUDFLARE.md) | Accounts, zones, DNS, WAF, analytics, Zero Trust, Workers/Pages, audit, checkups |
|
|
33
|
+
| [SECURITY.md](./SECURITY.md) | Incidents, logs, intelligence, analytics, assets, connections, policies, notifications, reports |
|
|
34
|
+
| [ONE.md](./ONE.md) | Customer records/billing/reports/investigations, organizations, monitoring, support |
|
|
35
|
+
|
|
36
|
+
These references ship with the npm package. Built-in help is available through
|
|
37
|
+
`vigilbase <command> --help` or `vigilbase help <command>`.
|
|
43
38
|
|
|
44
|
-
|
|
39
|
+
## Examples
|
|
45
40
|
|
|
46
|
-
|
|
41
|
+
Public tools require no login:
|
|
47
42
|
|
|
48
43
|
```bash
|
|
49
|
-
vigilbase
|
|
50
|
-
vigilbase
|
|
51
|
-
vigilbase
|
|
52
|
-
vigilbase
|
|
44
|
+
vigilbase list
|
|
45
|
+
vigilbase headers https://vigilbase.com
|
|
46
|
+
vigilbase email vigilbase.com --json
|
|
47
|
+
vigilbase describe security-headers
|
|
48
|
+
vigilbase badge vigilbase.com --style compact
|
|
53
49
|
```
|
|
54
50
|
|
|
55
|
-
|
|
51
|
+
Public scanners are `security-headers` and `email-security`. Authenticated
|
|
52
|
+
scanners are `website-security`, `react2shell`, and `fortibleed-check`:
|
|
56
53
|
|
|
57
54
|
```bash
|
|
55
|
+
vigilbase run website-security example.com --json
|
|
58
56
|
vigilbase account
|
|
59
|
-
vigilbase
|
|
60
|
-
vigilbase
|
|
61
|
-
vigilbase
|
|
62
|
-
vigilbase
|
|
63
|
-
vigilbase
|
|
64
|
-
vigilbase account invites create --email user@example.com --confirm
|
|
65
|
-
vigilbase billing summary
|
|
66
|
-
vigilbase billing portal
|
|
57
|
+
vigilbase customers list --json
|
|
58
|
+
vigilbase customers summary <customer-uuid>
|
|
59
|
+
vigilbase orgs list
|
|
60
|
+
vigilbase monitoring health
|
|
61
|
+
vigilbase support tickets
|
|
67
62
|
vigilbase runs list
|
|
68
|
-
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Cloudflare IDs come from the accessible inventory:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
vigilbase cf accounts
|
|
69
69
|
vigilbase cf zones
|
|
70
|
-
vigilbase cf
|
|
71
|
-
vigilbase
|
|
70
|
+
vigilbase cf dns <zone-id>
|
|
71
|
+
vigilbase cf waf <zone-id> --json
|
|
72
|
+
vigilbase cf zero-trust <account-id>
|
|
73
|
+
vigilbase cf developer-platform <account-id>
|
|
74
|
+
vigilbase cf analytics --customer-id <customer-uuid> --zone-id <zone-id> --days 7
|
|
75
|
+
vigilbase cf checkup progress <run-uuid>
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Security uses the same tenant and permission boundary as One's dashboard:
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
vigilbase security
|
|
82
|
+
vigilbase security incidents --severity high --json
|
|
83
|
+
vigilbase security incidents show <incident-uuid>
|
|
84
|
+
vigilbase security logs --search 'failed login' --limit 50
|
|
85
|
+
vigilbase security assets
|
|
86
|
+
vigilbase security intel ip 203.0.113.8
|
|
87
|
+
vigilbase security analytics security-analysis --hours 24
|
|
88
|
+
vigilbase security zero-trust device-health --hours 24
|
|
89
|
+
vigilbase security notifications
|
|
90
|
+
vigilbase security audit --limit 50
|
|
72
91
|
```
|
|
73
92
|
|
|
74
|
-
|
|
93
|
+
Customer users inherit their organization scope. Internal operators must add
|
|
94
|
+
`--customer-id <customer-uuid>` for security views. Cloudflare analytics requires
|
|
95
|
+
that customer ID as well. Other customer-specific groups use positional customer
|
|
96
|
+
UUIDs. Flags select records; One still decides whether the session can access them.
|
|
75
97
|
|
|
76
|
-
|
|
98
|
+
After reviewing an incident, a status update is available explicitly:
|
|
77
99
|
|
|
78
100
|
```bash
|
|
79
|
-
vigilbase
|
|
80
|
-
|
|
81
|
-
vigilbase account --json
|
|
82
|
-
vigilbase runs list --json
|
|
101
|
+
vigilbase security incidents update <incident-uuid> acknowledged \
|
|
102
|
+
--note 'Investigating with the customer' --confirm
|
|
83
103
|
```
|
|
84
104
|
|
|
105
|
+
Other status updates are `mitigating`, `resolved`, and `false_positive`.
|
|
106
|
+
`--confirm` acknowledges the caller's intent; it does not grant permission or
|
|
107
|
+
approve provider remediation. API mutations are not automatically retried.
|
|
108
|
+
See command references for the other explicit effects (invitation creation,
|
|
109
|
+
billing portal sessions, scans, and checkup starts).
|
|
110
|
+
|
|
111
|
+
## Automation and output
|
|
112
|
+
|
|
113
|
+
Every command supports `-j` / `--json`. JSON goes to stdout; progress and browser
|
|
114
|
+
instructions go to stderr. Progress animations are disabled for JSON, CI, and
|
|
115
|
+
non-TTY output. Preserve JSON pagination fields when fetching subsequent pages;
|
|
116
|
+
list commands do not silently fetch every page. New text views display complete
|
|
117
|
+
identifiers. All human-readable output removes terminal control sequences and
|
|
118
|
+
bidirectional overrides, including identities, tool results, skills, and errors.
|
|
119
|
+
JSON preserves successful response data with control characters escaped. Default
|
|
120
|
+
errors omit server response bodies and messages, retaining safe status, error
|
|
121
|
+
code, and retry metadata.
|
|
122
|
+
|
|
85
123
|
| Exit code | Meaning |
|
|
86
124
|
| --- | --- |
|
|
87
|
-
| `0` | Success |
|
|
88
|
-
| `1` |
|
|
125
|
+
| `0` | Success (including a signed-out `whoami`) |
|
|
126
|
+
| `1` | Validation, API, network, or unsuccessful scan result |
|
|
89
127
|
| `2` | Rate limited (`HTTP 429`) |
|
|
128
|
+
|
|
129
|
+
Commands use named One APIs and existing server authorization. They do not accept
|
|
130
|
+
Cloudflare/provider secrets, delegated identity claims, or an arbitrary upstream
|
|
131
|
+
URL. Billing records are fetched on demand and not persisted by the CLI.
|
|
132
|
+
|
|
133
|
+
## Login and configuration
|
|
134
|
+
|
|
135
|
+
`login` opens a browser and waits for device approval. On remote terminals, run
|
|
136
|
+
`vigilbase login --no-open`, then open the displayed URL in a signed-in browser.
|
|
137
|
+
For an existing One session token, pipe it from your secret manager into
|
|
138
|
+
`vigilbase login --token-stdin`. Input must contain one token and is never echoed.
|
|
139
|
+
The older `--token <bearer>` and `VIGILBASE_ONE_TOKEN` inputs remain supported;
|
|
140
|
+
command arguments may be visible in process listings or shell history. Do not
|
|
141
|
+
combine either with `--token-stdin`. Login validates the token before saving it.
|
|
142
|
+
|
|
143
|
+
The credential directory must be an absolute path, owned by the current user,
|
|
144
|
+
and mode `0700`; `credentials.json` must be an owned regular file with mode
|
|
145
|
+
`0600`. Symlinks, hard links, and unsafe parent directories are rejected. Existing
|
|
146
|
+
files with broader permissions require `chmod 700 <config-directory>` and
|
|
147
|
+
`chmod 600 <config-directory>/credentials.json`. Only the access token and session
|
|
148
|
+
metadata are saved; unused refresh tokens are never persisted.
|
|
149
|
+
|
|
150
|
+
Credentials are stored atomically in `~/.config/vigilbase/credentials.json` with
|
|
151
|
+
owner-only file permissions. `XDG_CONFIG_HOME` or `VIGILBASE_CONFIG_DIR` can change
|
|
152
|
+
the location. Tokens are restricted to their issuing One origin. Legacy credential
|
|
153
|
+
files remain valid for production only; re-login for a custom One origin.
|
|
154
|
+
`whoami` validates the live session. `logout` removes the local credential file.
|
|
155
|
+
|
|
156
|
+
| Option | Environment variable | Default |
|
|
157
|
+
| --- | --- | --- |
|
|
158
|
+
| `--base-url <origin>` | `VIGILBASE_BASE_URL` | `https://vigilbase.com` |
|
|
159
|
+
| `--one-url <origin>` | `VIGILBASE_ONE_URL` | `https://one.vigilbase.com` |
|
|
160
|
+
| `--client-id <id>` | `VIGILBASE_CLIENT_ID` | `vigilbase-cli` |
|
|
161
|
+
| `--timeout <ms>` | — | `60000` per request |
|
|
162
|
+
|
|
163
|
+
Origins must be HTTP(S) URLs without paths, credentials, or queries. Authenticated
|
|
164
|
+
One origins require HTTPS. HTTP is allowed only for loopback development
|
|
165
|
+
(`localhost`, `127.0.0.0/8`, or `::1`). This applies to device authorization,
|
|
166
|
+
explicit tokens, and saved sessions. API redirects are refused.
|
|
167
|
+
`VIGILBASE_API_URL` and `VIGILBASE_PUBLIC_URL` are legacy public-origin aliases,
|
|
168
|
+
used after `VIGILBASE_BASE_URL` when no explicit flag is supplied.
|
|
169
|
+
`VIGILBASE_CLI_NO_OPEN=1` disables automatic browser opening.
|
|
170
|
+
|
|
171
|
+
Billing portal URLs must use HTTPS on `billing.stripe.com`. Windows prints URLs
|
|
172
|
+
for manual opening; URL data never passes through `cmd /c start`. Device login
|
|
173
|
+
always uses the configured One origin's `/device` page.
|
|
174
|
+
|
|
175
|
+
Catalog skill downloads are restricted to HTTPS
|
|
176
|
+
`vigilbase.com/agent-skills/<name>.md` (also `www.vigilbase.com`). Custom API
|
|
177
|
+
origins cannot expand this allowlist. DNS results must all be public; the TLS
|
|
178
|
+
connection is pinned to a checked address. Redirects are refused. Skill documents
|
|
179
|
+
are limited to 256 KiB; API response bodies are limited to 8 MiB, with timeouts
|
|
180
|
+
covering body reads.
|
|
181
|
+
|
|
182
|
+
## Troubleshooting
|
|
183
|
+
|
|
184
|
+
`vigilbase doctor --json` independently checks the public catalog and One session
|
|
185
|
+
endpoint. A signed-out One response counts as reachable; failed checks identify
|
|
186
|
+
the endpoint and cause a nonzero exit. DNS, TLS, connection, and timeout failures
|
|
187
|
+
include actionable diagnostics.
|
|
188
|
+
|
|
189
|
+
The executable automatically adds OS-trusted certificates on Node 22.19+ and
|
|
190
|
+
Node 24.5+ while preserving bundled roots and `NODE_EXTRA_CA_CERTS`. This supports
|
|
191
|
+
private CAs trusted in macOS Keychain or the system trust store. See
|
|
192
|
+
[Node's TLS documentation](https://nodejs.org/docs/latest-v22.x/api/tls.html#tlssetdefaultcacertificatescerts).
|
|
193
|
+
|
|
194
|
+
For an older installed CLI reporting `fetch failed` / `SELF_SIGNED_CERT_IN_CHAIN`,
|
|
195
|
+
a recent Node 22 runtime supports this workaround:
|
|
196
|
+
|
|
197
|
+
```bash
|
|
198
|
+
NODE_OPTIONS="${NODE_OPTIONS:+$NODE_OPTIONS }--use-system-ca" vigilbase login
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
For a private CA outside the system store, configure
|
|
202
|
+
`NODE_EXTRA_CA_CERTS=/path/to/trusted-ca.pem` before launch. Certificate validation
|
|
203
|
+
remains enabled. Use `--timeout` for slower queries; some security analytics APIs
|
|
204
|
+
have a longer server budget than the default CLI timeout.
|
|
205
|
+
|
|
206
|
+
## Development and verification
|
|
207
|
+
|
|
208
|
+
```bash
|
|
209
|
+
pnpm --filter @vigilbase/cli check
|
|
210
|
+
pnpm --filter @vigilbase/cli smoke:commands
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
`check` runs typecheck, unit tests, production build, the device-login lifecycle
|
|
214
|
+
suite, the compiled-command HTTP suite, and security subprocess regressions. Fixtures cover every supported
|
|
215
|
+
operation in both JSON and text, with exact methods, paths, query filters, bearer
|
|
216
|
+
headers, bodies, error exits, and included documentation. Fixtures use temporary
|
|
217
|
+
credentials and a loopback server; simulated mutations never touch production.
|
|
218
|
+
|
|
219
|
+
The separate `smoke:e2e` script runs real public scanners. Configure
|
|
220
|
+
`VIGILBASE_BASE_URL` and `VIGILBASE_SMOKE_ARTIFACTS` as shown in COMMANDS.md.
|
|
221
|
+
Authenticated production verification requires a valid One session and appropriate
|
|
222
|
+
permissions. A passing local fixture does not establish provider availability or
|
|
223
|
+
production customer-data health.
|