@zksecurity/zkao-cli 0.2.0 → 0.5.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 (2) hide show
  1. package/dist/index.js +27 -0
  2. package/package.json +7 -3
package/dist/index.js CHANGED
@@ -476,6 +476,13 @@ config.command("show").description("Show the resolved settings (token masked)").
476
476
  });
477
477
  });
478
478
  program.command("repos").description("List repositories in the project").action(() => run((c) => c.listRepositories()));
479
+ program.command("repos:wait <repositoryId>").description("Wait until a repository is ready to scan").option("--timeout <ms>", "give up after this long", toInt).action(
480
+ (repositoryId, opts) => run(
481
+ (c) => c.waitForRepositoryReady(repositoryId, {
482
+ ...opts.timeout !== void 0 ? { timeoutMs: opts.timeout } : {}
483
+ })
484
+ )
485
+ );
479
486
  var guidance = program.command("guidance").description("Read and update a repository's guidance");
480
487
  guidance.command("get <repoId>").description("Show a repository's configured guidance").action((repoId) => run((c) => c.getRepositoryGuidance(repoId)));
481
488
  guidance.command("set <repoId> <file|->").description("Set a repository's guidance from a file (or - for stdin)").option(
@@ -504,6 +511,20 @@ guidance.command("clear <repoId>").description("Remove a repository's guidance")
504
511
  });
505
512
  })
506
513
  );
514
+ var areas = program.command("areas").description("List and manage a repository's audit areas");
515
+ areas.command("list <repoId>").description("Show the subsystems a scan can be scoped to").option("--branch <branch>", "read sizes from this branch's map").action(
516
+ (repoId, opts) => run(
517
+ (c) => c.listAuditAreas(repoId, {
518
+ ...opts.branch === void 0 ? {} : { branch: opts.branch }
519
+ })
520
+ )
521
+ );
522
+ areas.command("add <repoId> <name>").description("Add a custom audit area").option("--description <text>", "what this part of the code does").action(
523
+ (repoId, name, opts) => run((c) => c.createAuditArea(repoId, name, opts.description ?? null))
524
+ );
525
+ areas.command("rm <repoId> <areaKey>").description("Delete a custom audit area").action(
526
+ (repoId, areaKey) => run((c) => c.deleteAuditArea(repoId, areaKey))
527
+ );
507
528
  var scans = program.command("scans").description("Launch, list, and poll scans");
508
529
  scans.command("list").option("--page <n>", "page number", toInt).option("--limit <n>", "page size (max 100)", toInt).action(
509
530
  (opts) => run((c) => c.listScans({ page: opts.page, limit: opts.limit }))
@@ -524,6 +545,11 @@ scans.command("wait <scanId>").description("Poll a scan until it finishes (honor
524
545
  scans.command("launch").description("Launch a scan").requiredOption("--repo <id>", "repository id").requiredOption("--budget <credits>", "max budget, in credits", toInt).option("--preset <ref>", "scan preset ref (see `zkao presets`)").option("--branch <name>", "branch to scan").option("--commit <sha>", "specific commit to scan").option("--message <text>", "commit message (metadata)").option("--flow <id>", "optional-flow id to opt into (repeatable)", collect, []).option(
525
546
  "--guidance <file|->",
526
547
  "per-scan guidance from a file (or - for stdin); replaces the repo's guidance for this scan"
548
+ ).option(
549
+ "--area <key>",
550
+ "audit area to scope the scan to (repeatable; see `zkao areas list`)",
551
+ collect,
552
+ []
527
553
  ).action(
528
554
  (opts) => {
529
555
  const body = {
@@ -534,6 +560,7 @@ scans.command("launch").description("Launch a scan").requiredOption("--repo <id>
534
560
  commitHash: opts.commit ?? null,
535
561
  commitMessage: opts.message ?? null,
536
562
  optInFlowIds: opts.flow.length > 0 ? opts.flow : void 0,
563
+ auditAreaKeys: opts.area.length > 0 ? opts.area : void 0,
537
564
  ...opts.guidance !== void 0 ? { guidance: readContentArg(opts.guidance) } : {}
538
565
  };
539
566
  return run((c) => c.launchScan(body));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zksecurity/zkao-cli",
3
- "version": "0.2.0",
3
+ "version": "0.5.1",
4
4
  "description": "Command-line interface for the zkao Project API",
5
5
  "license": "MIT",
6
6
  "author": "zkSecurity",
@@ -22,7 +22,11 @@
22
22
  "bin": {
23
23
  "zkao": "./dist/index.js"
24
24
  },
25
- "files": ["dist", "LICENSE", "README.md"],
25
+ "files": [
26
+ "dist",
27
+ "LICENSE",
28
+ "README.md"
29
+ ],
26
30
  "engines": {
27
31
  "node": ">=18"
28
32
  },
@@ -35,7 +39,7 @@
35
39
  "prepublishOnly": "node -e \"if (!(process.env.npm_config_user_agent || '').includes('bun/')) { console.error('Publish with bun publish: npm ships the literal workspace:* dependency and breaks installs.'); process.exit(1); }\""
36
40
  },
37
41
  "dependencies": {
38
- "@zksecurity/zkao-sdk": "0.2.0",
42
+ "@zksecurity/zkao-sdk": "0.5.1",
39
43
  "commander": "^12.1.0"
40
44
  },
41
45
  "devDependencies": {