@test-lab-ai/cli 0.2.5 → 0.2.6
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/bin/testlab.mjs +8 -1
- package/package.json +1 -1
package/bin/testlab.mjs
CHANGED
|
@@ -24,7 +24,7 @@ import { loadImportFile, runImport } from "../lib/import.mjs"
|
|
|
24
24
|
import { browserLogin } from "../lib/login.mjs"
|
|
25
25
|
import { EXAMPLES_TEXT } from "../lib/examples.mjs"
|
|
26
26
|
import { TESTLAB_SKILLS, AGENTS, detectAgents, installSkill } from "../lib/skills.mjs"
|
|
27
|
-
import { checkForUpdate } from "../lib/update-check.mjs"
|
|
27
|
+
import { checkForUpdate, currentVersion } from "../lib/update-check.mjs"
|
|
28
28
|
|
|
29
29
|
const log = (...a) => console.log(...a)
|
|
30
30
|
function errExit(msg) {
|
|
@@ -56,6 +56,7 @@ Options:
|
|
|
56
56
|
--stdin Read the value (key/credential) from stdin
|
|
57
57
|
--force (login) re-authenticate even if a stored key still works
|
|
58
58
|
--dry-run (import) validate + print plan order without writing
|
|
59
|
+
--version, -v Print the installed CLI version
|
|
59
60
|
|
|
60
61
|
Get a key at https://test-lab.ai/admin/settings/api-keys · run \`testlab examples\` for JSON shapes`
|
|
61
62
|
|
|
@@ -74,6 +75,7 @@ function parse() {
|
|
|
74
75
|
force: { type: "boolean" },
|
|
75
76
|
global: { type: "boolean" },
|
|
76
77
|
agent: { type: "string" },
|
|
78
|
+
version: { type: "boolean", short: "v" },
|
|
77
79
|
help: { type: "boolean", short: "h" },
|
|
78
80
|
},
|
|
79
81
|
})
|
|
@@ -342,6 +344,11 @@ async function main() {
|
|
|
342
344
|
|
|
343
345
|
checkForUpdate() // best-effort "update available" notice (cached, non-blocking)
|
|
344
346
|
|
|
347
|
+
if (flags.version || args[0] === "version") {
|
|
348
|
+
log(currentVersion() || "unknown")
|
|
349
|
+
return
|
|
350
|
+
}
|
|
351
|
+
|
|
345
352
|
if (flags.help || args.length === 0 || args[0] === "help") {
|
|
346
353
|
log(HELP)
|
|
347
354
|
return
|