@verica-app/cli 0.1.0 → 0.1.2
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/README.md +9 -4
- package/dist/cli.js +5 -4
- package/package.json +10 -11
package/README.md
CHANGED
|
@@ -53,10 +53,12 @@ evals:
|
|
|
53
53
|
|
|
54
54
|
## Environment
|
|
55
55
|
|
|
56
|
-
| Var
|
|
57
|
-
|
|
|
58
|
-
| `VERICA_TOKEN`
|
|
59
|
-
|
|
56
|
+
| Var | Required | Notes |
|
|
57
|
+
| -------------- | -------- | -------------------------------------------- |
|
|
58
|
+
| `VERICA_TOKEN` | yes | Workspace API token (Settings → API tokens). |
|
|
59
|
+
|
|
60
|
+
`VERICA_TOKEN` is the only thing you set. The CLI talks to the hosted Verica API by
|
|
61
|
+
default — you don't configure a URL.
|
|
60
62
|
|
|
61
63
|
## Key flags
|
|
62
64
|
|
|
@@ -69,6 +71,9 @@ evals:
|
|
|
69
71
|
- `--threshold <0..1>` · `--baseline-ref <ref>` · `--baseline-run <id>` — override the gate per branch.
|
|
70
72
|
- `--git-sha` / `--git-ref` — provenance (auto-detected from CI env otherwise).
|
|
71
73
|
|
|
74
|
+
> Local dev / self-hosting only: point the CLI at another instance with `--base-url`
|
|
75
|
+
> (or the `VERICA_BASE_URL` env var). Clients never need this.
|
|
76
|
+
|
|
72
77
|
## Exit codes
|
|
73
78
|
|
|
74
79
|
`0` passed · `1` gate failed · `2` validation/transport error.
|
package/dist/cli.js
CHANGED
|
@@ -4485,6 +4485,7 @@ function printSummary(evalId, run) {
|
|
|
4485
4485
|
}
|
|
4486
4486
|
|
|
4487
4487
|
// src/cli.ts
|
|
4488
|
+
var DEFAULT_BASE_URL = "https://verica.app";
|
|
4488
4489
|
var USAGE = `verica \u2014 run a Verica eval from CI and gate the merge on the result.
|
|
4489
4490
|
|
|
4490
4491
|
Usage:
|
|
@@ -4507,14 +4508,15 @@ Options:
|
|
|
4507
4508
|
--baseline-run <id> No-regression baseline = this specific run.
|
|
4508
4509
|
--git-sha <sha> Commit SHA (else auto-detected from CI env).
|
|
4509
4510
|
--git-ref <ref> Git ref (else auto-detected from CI env).
|
|
4510
|
-
--base-url <url> API base URL (
|
|
4511
|
+
--base-url <url> Override the API base URL (dev/self-host only).
|
|
4511
4512
|
--poll-interval <sec> Initial poll interval (default 3).
|
|
4512
4513
|
--timeout <sec> Max wait (default 1800).
|
|
4513
4514
|
--help Show this help.
|
|
4514
4515
|
|
|
4515
4516
|
Env:
|
|
4516
4517
|
VERICA_TOKEN Workspace API token (required).
|
|
4517
|
-
VERICA_BASE_URL API base URL
|
|
4518
|
+
VERICA_BASE_URL Override the API base URL \u2014 dev/self-host only;
|
|
4519
|
+
defaults to ${DEFAULT_BASE_URL}.
|
|
4518
4520
|
|
|
4519
4521
|
Exit codes: 0 passed, 1 gate failed, 2 validation/transport error.`;
|
|
4520
4522
|
function finiteNumber(v) {
|
|
@@ -4554,8 +4556,7 @@ async function main() {
|
|
|
4554
4556
|
}
|
|
4555
4557
|
const token = process.env.VERICA_TOKEN;
|
|
4556
4558
|
if (!token) throw new Error("VERICA_TOKEN is required (a workspace API token).");
|
|
4557
|
-
const baseUrl = values["base-url"]
|
|
4558
|
-
if (!baseUrl) throw new Error("Set --base-url or the VERICA_BASE_URL environment variable.");
|
|
4559
|
+
const baseUrl = values["base-url"]?.trim() || process.env.VERICA_BASE_URL?.trim() || DEFAULT_BASE_URL;
|
|
4559
4560
|
const threshold = finiteNumber(values.threshold);
|
|
4560
4561
|
if (values.threshold !== void 0 && threshold === void 0) {
|
|
4561
4562
|
throw new Error(`--threshold must be a number between 0 and 1 (got "${values.threshold}").`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@verica-app/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Run a Verica eval from CI and block the merge on the result.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -31,21 +31,20 @@
|
|
|
31
31
|
"engines": {
|
|
32
32
|
"node": ">=20"
|
|
33
33
|
},
|
|
34
|
-
"scripts": {
|
|
35
|
-
"build": "tsup",
|
|
36
|
-
"prepublishOnly": "tsup",
|
|
37
|
-
"typecheck": "tsc --noEmit",
|
|
38
|
-
"test": "vitest run",
|
|
39
|
-
"lint": "echo 'lint: cli ok'"
|
|
40
|
-
},
|
|
41
34
|
"dependencies": {
|
|
42
35
|
"yaml": "^2.6.1"
|
|
43
36
|
},
|
|
44
37
|
"devDependencies": {
|
|
45
|
-
"@evals/api-contract": "workspace:*",
|
|
46
38
|
"@types/node": "^22.10.2",
|
|
47
39
|
"tsup": "^8.3.5",
|
|
48
40
|
"typescript": "^5.7.2",
|
|
49
|
-
"vitest": "^3.2.6"
|
|
41
|
+
"vitest": "^3.2.6",
|
|
42
|
+
"@evals/api-contract": "0.0.0"
|
|
43
|
+
},
|
|
44
|
+
"scripts": {
|
|
45
|
+
"build": "tsup",
|
|
46
|
+
"typecheck": "tsc --noEmit",
|
|
47
|
+
"test": "vitest run",
|
|
48
|
+
"lint": "echo 'lint: cli ok'"
|
|
50
49
|
}
|
|
51
|
-
}
|
|
50
|
+
}
|