UNPKG

@vigilbase/cli

Version:

Vigilbase CLI — security scanners, agent tools, and Vigilbase One from the terminal.

110 lines (80 loc) • 11.7 kB
# Vigilbase One CLI reference Log in with `vigilbase login` (signing in isn't supported on Windows yet). Every operation in this reference sends GET with your saved sign-in. Customer, organization, role, and integration access remains enforced by One; selecting an ID never grants access. Most commands call One's v1 API, the operation named in the tables below, on `https://api.vigilbase.com/one/v1` (`--one-api-url`, `VIGILBASE_ONE_API_URL`; for a One other than production the default is `<one-url>/one/v1`). The rest, marked "legacy", call One itself (`--one-url`, `VIGILBASE_ONE_URL`, default `https://one.vigilbase.com`) because they have no v1 operation yet. Both use the same token: One accepts a token for either One resource on every path. v1 answers are checked against the operation's declared schema; an answer that doesn't match fails with `Invalid One API response for <operation> (HTTP <status>).` A v1 error is RFC 9457 problem+json: the CLI prints its `detail` and `code`, then `Request ID: req_…` (`requestId` in JSON), which identifies the request for support. **Pagination.** v1 lists answer `{ items, nextCursor? }`; no `nextCursor` means the last page. `--limit 1..1000` reads pages until it has that many items, and `nextCursor` then continues exactly after the last one. `--cursor <cursor>` reads one page starting at a `nextCursor`. Without either, the lists that answered every row before v1 (customers `list`, `services`, `endpoints`, `contacts`, `watchdog-targets`, `contracts`, `subscriptions`, monitoring `targets`) read every page, and the others (`watchdog-scans`, `reports`, `invoices`, support `tickets`) read one page of the API's default size, 50. Use `--json` to retain the complete response. Plain/pretty output shows all fields as an indented tree, including null/unknown metrics, degraded status and `nextCursor`. `--timeout <milliseconds>` controls request timeouts. Only documented flags are accepted; unrelated flags fail before authentication or network requests. ```sh vigilbase customers list --json vigilbase customers summary CUSTOMER_UUID vigilbase customers services CUSTOMER_UUID vigilbase monitoring status CUSTOMER_UUID --light vigilbase monitoring history CUSTOMER_UUID --range 7d --region ams vigilbase orgs members vigilbase support tickets --all --limit 100 vigilbase support tickets --customer-id CUSTOMER_UUID ``` 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). ## Customers For partner-linked customers, invoice and subscription reads are restricted to subscription IDs on that customer's own or linked revenue-active contracts. Sibling customers never receive the partner's account-wide Stripe list. Missing contract scope fails closed; no allowed subscriptions returns an empty list. `vigilbase customers` defaults to `list`; `ls` is an alias for `list`. Pass customer IDs positionally for this group, rather than `--customer-id`. In the table, `C` means `/customers/{customer-id}` under the v1 base, and `L` means `/api/customers/{customer-id}` on One. `P` stands for `--limit 1..1000` and `--cursor TEXT`. | Command after `vigilbase customers` | Flags | Operation and path | | --- | --- | --- | | `list` | `P` | `one.customers.list`, `/customers` | | `show <customer-id>` | None | `one.customers.get`, `C` | | `summary <customer-id>` | None | alias of `show` | | `services <customer-id>` | `P` | `one.customerServices.list`, `C/services` | | `endpoints <customer-id>` | `P` | `one.customerEndpoints.list`, `C/endpoints` | | `contacts <customer-id>` | `P` | `one.customerContacts.list`, `C/contacts` | | `organization <customer-id>` | None | `one.customerOrganization.get`, `C/organization` | | `watchdog-targets <customer-id>` | `P` | `one.watchdogTargets.list`, `C/watchdog-targets` | | `watchdog-scans <customer-id>` | `P`, `--target-id UUID` | `one.watchdogScans.list`, `C/watchdog-scans?targetId=` | | `reports <customer-id>` | `P` | `one.reconReports.list`, `C/recon-reports` | | `report <customer-id> <report-id>` | None | `one.reconReports.get`, `C/recon-reports/{report-id}` | | `investigations <customer-id>` | `--limit 1..100`, `--cursor TEXT`, `--before ISO`, `--issue-id TEXT` | legacy, `L/vigil/investigations?limit=&cursor=&before=&issueId=` | | `investigation <customer-id> <investigation-id>` | `--revision 1..2147483647` | legacy, `L/vigil/investigations/{investigation-id}?revision=` | | `contracts <customer-id>` | `P`, `--status draft\|pending\|active\|expired\|terminated` | `one.contracts.list`, `C/contracts?status=` | | `billing <customer-id>` | None | `one.customerBilling.get`, `C/billing` | | `invoices <customer-id>` | `P`, `--status draft\|open\|paid\|uncollectible\|void` | `one.invoices.list`, `C/invoices?status=` | | `subscriptions <customer-id>` | `P` | `one.subscriptions.list`, `C/subscriptions` | | `projects <customer-id>` | None | legacy, `L/projects` | Unspecified query parameters are omitted. The `--offset` of CLI 0.3 and earlier for `watchdog-scans` is gone; page with `--cursor`. For investigations (legacy), 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. v1 bodies are curated, not the legacy shapes: field names are camelCase, `show` and `summary` both return the customer with its partner, account owner and `serviceCounts`, services carry `monthlyAmount` only for callers who may read billing amounts, and support tickets carry no Pylon HTML or file links. See the API reference at https://docs.vigilbase.com for every field. 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. Signed-out callers get 401 and callers without that permission 404. While the feature is off, permitted staff get 501 `VIGIL_UI_DISABLED` for an existing customer (404 for an unknown one), which the CLI explains with a hint. Stripe resources are fetched by One from Stripe and are not persisted by the CLI. The services command calls `one.customerServices.list` (One's legacy alias is `/service-records`). Vigil's customer lookup reads (`search`, `by-email`, `by-account`, `setup`, `services` and `cloudflare-usage`) are RPC-only and have no HTTP GET handler; they are not CLI endpoints. The existing `/customers/{id}/services` POST/PUT remain for dashboard writes. 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. ## Organizations `vigilbase orgs` defaults to `list`; `ls` is an alias. | Command after `vigilbase orgs` | One GET endpoint | Access | | --- | --- | --- | | `list` | `/api/user/organizations` | Current user's organization memberships | | `show <organization-id>` | `/api/organizations/{id}` | Internal `read:admin` | | `members` | `/api/auth/orgs/members` | Current organization; organization permission checks | | `members <organization-id>` | `/api/organizations/{id}/members` | Internal `read:admin` | | `roles` | `/api/auth/orgs/permission-roles` | Current organization management access | 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. ## Monitoring `vigilbase monitoring` defaults to `health`. All endpoints require `read:monitoring`; customer routes and metric IDs also undergo tenant access checks. | Command after `vigilbase monitoring` | Flags | Operation and path | | --- | --- | --- | | `health` | None | legacy, `/api/monitoring/health` | | `probes` | None | legacy, `/api/monitoring/probes` | | `probe-health` | None | legacy, `/api/monitoring/probes/health` | | `metrics <target-id>...` | None; 1..50 UUID arguments | `one.monitoringMetrics.get`, `/monitoring/metrics?targetIds=UUID&targetIds=UUID` | | `targets <customer-id>` | `--limit 1..1000`, `--cursor TEXT` | `one.monitoringTargets.list`, `/customers/{id}/monitoring/targets` | | `status <customer-id>` | `--light` | `one.monitoringStatus.get`, `/customers/{id}/monitoring/status?light=true` | | `history <customer-id>` | `--range 24h\|7d\|30d`, `--region CODE`, `--target-id UUID` | `one.monitoringHistory.get`, `/customers/{id}/monitoring/history?range=&region=&targetId=` | `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`. A successful health response may describe an unconfigured backend or unknown probes. Inspect `configured`, `connected`, `status`, `metrics_error` (v1: `metricsError`), `has_data` (v1: `hasData`), and `partial`; exit zero means the API request succeeded, not that infrastructure is healthy. Provider-unavailable HTTP errors remain failures with nonzero exit status. ## Support ```sh vigilbase support tickets [--all] [--limit 1..1000] [--cursor <cursor>] [--customer-id <uuid>] [--json] ``` `vigilbase support` also defaults to `tickets`. Calls `one.supportTickets.list`, GET `/support-tickets?includeClosed=true&customerId=UUID` under the v1 base; omitted flags omit their query parameters. Requires `support:access`. Without `--customer-id`, the API uses the current organization's customer and its Pylon account. Vigilbase staff must choose the customer with `--customer-id <uuid>` (a UUID from `vigilbase customers list`); One checks your access to it. Without it, One answers HTTP 400 and the CLI prints One's detail with the hint `Vigilbase staff: add --customer-id <uuid>.` Open tickets are returned by default; `--all` includes closed tickets. One page of 50 by default; the API lists at most the newest 100 tickets. An account with no customer or no Pylon link returns an empty list. The API may rate-limit requests or return 503 when Pylon is unavailable. ## Related commands and validation See [README.md](https://app.unpkg.com/@vigilbase/cli@0.6.0/files/README.md) for sign-in and configuration, [COMMANDS.md](https://app.unpkg.com/@vigilbase/cli@0.6.0/files/COMMANDS.md) for account, billing, public scanners, run history and Watchdog, and [CLOUDFLARE.md](https://app.unpkg.com/@vigilbase/cli@0.6.0/files/CLOUDFLARE.md) for `cf`/`cloudflare`. The read operations above do not replace the existing explicitly confirmed write commands.