@beryl-so/cli 0.33.0 → 0.34.0

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 CHANGED
@@ -216,8 +216,9 @@ Author, inspect, version, and heal a project's tests: the checks Beryl runs on e
216
216
  | `beryl tests set-plan <test-id>` | Replace a test's step plan from a JSON file (creates a new version) | `tests_set_plan` |
217
217
  | `beryl tests rename <test-id> <title>` | Rename a test | `tests_rename` |
218
218
  | `beryl tests set-groups <test-id>` | Replace the groups a test belongs to | `tests_set_groups` |
219
+ | `beryl tests add-groups <test-ids...>` | Add groups to one or more tests, keeping the groups they already have | `tests_add_groups` |
219
220
  | `beryl tests quarantine <test-id> <state>` | Mute a flaky test: it keeps running, but its failures stop failing the run | `tests_quarantine` |
220
- | `beryl tests delete <test-id>` | Delete a test, its version history, and its results | `tests_delete` |
221
+ | `beryl tests delete <test-ids...>` | Delete tests, their version history, and their results | `tests_delete` |
221
222
  | `beryl tests recompile <test-id>` | Validate + verify an edited plan against the live site before persisting | `tests_recompile` |
222
223
  | `beryl tests versions <test-id>` | List a test's version history | `tests_versions` |
223
224
  | `beryl tests version <test-id> <version-no>` | Show one specific version of a test (including its plan) | `tests_version` |
@@ -139,6 +139,11 @@ export const testCommands = [
139
139
  type: "boolean",
140
140
  description: "With --page, show only tests carrying no group",
141
141
  },
142
+ {
143
+ name: "q",
144
+ type: "string",
145
+ description: "With --page, show only tests whose title contains this text (case-insensitive)",
146
+ },
142
147
  ],
143
148
  async run(ctx, input) {
144
149
  const { workspaceId, projectId } = await ctx.requireProject(input);
@@ -159,6 +164,7 @@ export const testCommands = [
159
164
  page_size: flagNum(input, "page-size"),
160
165
  status: flagStr(input, "status"),
161
166
  group: flagBool(input, "ungrouped") ? "__ungrouped__" : group,
167
+ q: flagStr(input, "q"),
162
168
  environment_id: flagStr(input, "env"),
163
169
  })).items;
164
170
  }
@@ -552,6 +558,39 @@ export const testCommands = [
552
558
  };
553
559
  },
554
560
  },
561
+ {
562
+ name: "tests add-groups",
563
+ summary: "Add groups to one or more tests, keeping the groups they already have",
564
+ description: "The additive counterpart of `tests set-groups`: every listed test gains the given " +
565
+ "groups and loses none, so you don't need to know what each test already carries. " +
566
+ "Names must already exist in the project (`beryl groups list`); an unknown name is " +
567
+ "an error, never a new group.",
568
+ scope: "project",
569
+ args: [{ name: "test-ids", description: "One or more test ids", required: true, variadic: true }],
570
+ flags: [
571
+ {
572
+ name: "group",
573
+ type: "strings",
574
+ description: "Group name to add, repeatable (at least one)",
575
+ },
576
+ ],
577
+ examples: ["beryl tests add-groups 4f… 9a… --group Smoke", "beryl tests add-groups 4f… --group Checkout --group Smoke"],
578
+ async run(ctx, input) {
579
+ const { workspaceId, projectId } = await ctx.requireProject(input);
580
+ const add = flagStrings(input, "group");
581
+ if (!add)
582
+ throw new UsageError("Pass at least one --group");
583
+ const ids = argList(input, "test-ids");
584
+ const data = (await ctx.client.post(`${projectPath(workspaceId, projectId)}/tests/bulk-groups`, {
585
+ test_case_ids: ids,
586
+ add,
587
+ }));
588
+ return {
589
+ data,
590
+ human: `Added ${add.join(", ")} to ${data.updated} of ${ids.length} test${ids.length === 1 ? "" : "s"} (the rest already had them).`,
591
+ };
592
+ },
593
+ },
555
594
  {
556
595
  name: "tests quarantine",
557
596
  summary: "Mute a flaky test: it keeps running, but its failures stop failing the run",
@@ -581,16 +620,28 @@ export const testCommands = [
581
620
  },
582
621
  {
583
622
  name: "tests delete",
584
- summary: "Delete a test, its version history, and its results",
623
+ summary: "Delete tests, their version history, and their results",
624
+ description: "Several ids are deleted together in one transaction: an unknown id fails the whole " +
625
+ "call and nothing is deleted.",
585
626
  scope: "project",
586
- args: [{ name: "test-id", description: "Test id", required: true }],
627
+ args: [{ name: "test-ids", description: "One or more test ids", required: true, variadic: true }],
587
628
  flags: [{ name: "force", type: "boolean", description: "Skip the confirmation prompt" }],
629
+ examples: ["beryl tests delete 4f… --force", "beryl tests delete 4f… 9a… 1c…"],
588
630
  async run(ctx, input) {
589
631
  const { workspaceId, projectId } = await ctx.requireProject(input);
590
- const testId = arg(input, "test-id");
591
- await ctx.confirm(`Delete test ${testId} and all its history?`, flagBool(input, "force"));
592
- await ctx.client.del(testPath(workspaceId, projectId, testId));
593
- return { human: "Deleted." };
632
+ const ids = argList(input, "test-ids");
633
+ const single = ids.length === 1 ? ids[0] : undefined;
634
+ const what = single ? `test ${single} and all its history` : `${ids.length} tests and all their history`;
635
+ await ctx.confirm(`Delete ${what}?`, flagBool(input, "force"));
636
+ if (single) {
637
+ await ctx.client.del(testPath(workspaceId, projectId, single));
638
+ }
639
+ else {
640
+ await ctx.client.post(`${projectPath(workspaceId, projectId)}/tests/bulk-delete`, {
641
+ test_case_ids: ids,
642
+ });
643
+ }
644
+ return { human: ids.length === 1 ? "Deleted." : `Deleted ${ids.length} tests.` };
594
645
  },
595
646
  },
596
647
  {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@beryl-so/cli",
3
- "version": "0.33.0",
4
- "description": "Beryl on the command line \u2014 projects, runs, the exploring agent, and an MCP server over the same commands.",
3
+ "version": "0.34.0",
4
+ "description": "Beryl on the command line projects, runs, the exploring agent, and an MCP server over the same commands.",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "homepage": "https://beryl.so/docs/cli",