@braingrid/cli 0.2.13 → 0.2.15

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/CHANGELOG.md CHANGED
@@ -7,6 +7,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.2.15] - 2025-12-15
11
+
12
+ ### Changed
13
+
14
+ - **CI/CD: Switch to OIDC-based npm publishing**
15
+ - GitHub Actions workflow now uses OpenID Connect (Trusted Publishing) for npm authentication
16
+ - No longer requires NPM_TOKEN secret - authentication is handled via OIDC
17
+ - More secure and eliminates token expiration issues
18
+
19
+ ## [0.2.14] - 2025-12-15
20
+
21
+ ### Added
22
+
23
+ - **Requirement auto-detection for task commands**
24
+ - Task commands now auto-detect the requirement ID from git branch names (e.g., `feature/REQ-123-something` → `REQ-123`)
25
+ - Matches the existing behavior of requirement commands
26
+ - Applies to all task commands: `list`, `summary`, `show`, `create`, `update`, `delete`
27
+ - Explicit `-r/--requirement` flag still works and takes precedence over auto-detection
28
+
10
29
  ## [0.2.13] - 2025-12-08
11
30
 
12
31
  ### Added
package/dist/cli.js CHANGED
@@ -422,7 +422,7 @@ import axios3, { AxiosError as AxiosError2 } from "axios";
422
422
 
423
423
  // src/build-config.ts
424
424
  var BUILD_ENV = true ? "production" : process.env.NODE_ENV === "test" ? "development" : "production";
425
- var CLI_VERSION = true ? "0.2.13" : "0.0.0-test";
425
+ var CLI_VERSION = true ? "0.2.15" : "0.0.0-test";
426
426
  var PRODUCTION_CONFIG = {
427
427
  apiUrl: "https://app.braingrid.ai",
428
428
  workosAuthUrl: "https://auth.braingrid.ai",
@@ -4498,12 +4498,6 @@ async function handleTaskList(opts) {
4498
4498
  message: chalk8.red("\u274C Not authenticated. Please run `braingrid login` first.")
4499
4499
  };
4500
4500
  }
4501
- if (!opts.requirement) {
4502
- return {
4503
- success: false,
4504
- message: chalk8.red("\u274C No requirement specified.\n\n") + chalk8.dim("Please provide a requirement ID:\n") + chalk8.cyan("braingrid task list -r REQ-456") + chalk8.dim(" (if initialized) or\n") + chalk8.cyan("braingrid task list -r REQ-456 -p PROJ-123")
4505
- };
4506
- }
4507
4501
  const workspace = await workspaceManager.getProject(opts.project);
4508
4502
  if (!workspace.success) {
4509
4503
  return {
@@ -4512,7 +4506,14 @@ async function handleTaskList(opts) {
4512
4506
  };
4513
4507
  }
4514
4508
  const projectId = workspace.projectId;
4515
- const requirementId = normalizeRequirementId(opts.requirement);
4509
+ const requirementResult = await workspaceManager.getRequirement(opts.requirement);
4510
+ if (!requirementResult.success) {
4511
+ return {
4512
+ success: false,
4513
+ message: requirementResult.error
4514
+ };
4515
+ }
4516
+ const requirementId = requirementResult.requirementId;
4516
4517
  stopSpinner = showSpinner("Loading tasks", chalk8.gray);
4517
4518
  const response = await taskService.listTasks(projectId, requirementId);
4518
4519
  stopSpinner();
@@ -4525,7 +4526,7 @@ async function handleTaskList(opts) {
4525
4526
  };
4526
4527
  }
4527
4528
  const projectShortId = projectId;
4528
- const requirementShortId = opts.requirement;
4529
+ const requirementShortId = opts.requirement || requirementId;
4529
4530
  const format = opts.format || "markdown";
4530
4531
  const config = getConfig();
4531
4532
  const output = formatTasksListOutput(response.tasks, format, true, {
@@ -4560,12 +4561,6 @@ async function handleTaskSummary(opts) {
4560
4561
  message: chalk8.red("\u274C Not authenticated. Please run `braingrid login` first.")
4561
4562
  };
4562
4563
  }
4563
- if (!opts.requirement) {
4564
- return {
4565
- success: false,
4566
- message: chalk8.red("\u274C No requirement specified.\n\n") + chalk8.dim("Please provide a requirement ID:\n") + chalk8.cyan("braingrid task summary -r REQ-456") + chalk8.dim(" (if initialized) or\n") + chalk8.cyan("braingrid task summary -r REQ-456 -p PROJ-123")
4567
- };
4568
- }
4569
4564
  const workspace = await workspaceManager.getProject(opts.project);
4570
4565
  if (!workspace.success) {
4571
4566
  return {
@@ -4574,7 +4569,14 @@ async function handleTaskSummary(opts) {
4574
4569
  };
4575
4570
  }
4576
4571
  const projectId = workspace.projectId;
4577
- const requirementId = normalizeRequirementId(opts.requirement);
4572
+ const requirementResult = await workspaceManager.getRequirement(opts.requirement);
4573
+ if (!requirementResult.success) {
4574
+ return {
4575
+ success: false,
4576
+ message: requirementResult.error
4577
+ };
4578
+ }
4579
+ const requirementId = requirementResult.requirementId;
4578
4580
  stopSpinner = showSpinner("Loading tasks", chalk8.gray);
4579
4581
  const response = await taskService.listTasks(projectId, requirementId);
4580
4582
  stopSpinner();
@@ -4587,7 +4589,7 @@ async function handleTaskSummary(opts) {
4587
4589
  };
4588
4590
  }
4589
4591
  const projectShortId = projectId;
4590
- const requirementShortId = opts.requirement;
4592
+ const requirementShortId = opts.requirement || requirementId;
4591
4593
  const config = getConfig();
4592
4594
  const output = formatTasksListOutput(response.tasks, "table", false, {
4593
4595
  requirementId,
@@ -4621,21 +4623,22 @@ async function handleTaskShow(id, opts) {
4621
4623
  message: chalk8.red("\u274C Not authenticated. Please run `braingrid login` first.")
4622
4624
  };
4623
4625
  }
4624
- if (!opts?.requirement) {
4626
+ const workspace = await workspaceManager.getProject(opts?.project);
4627
+ if (!workspace.success) {
4625
4628
  return {
4626
4629
  success: false,
4627
- message: chalk8.red("\u274C No requirement specified.\n\n") + chalk8.dim("Please provide a requirement ID:\n") + chalk8.cyan("braingrid task show TASK-789 -r REQ-456") + chalk8.dim(" (if initialized) or\n") + chalk8.cyan("braingrid task show TASK-789 -r REQ-456 -p PROJ-123")
4630
+ message: workspace.error
4628
4631
  };
4629
4632
  }
4630
- const workspace = await workspaceManager.getProject(opts.project);
4631
- if (!workspace.success) {
4633
+ const projectId = workspace.projectId;
4634
+ const requirementResult = await workspaceManager.getRequirement(opts?.requirement);
4635
+ if (!requirementResult.success) {
4632
4636
  return {
4633
4637
  success: false,
4634
- message: workspace.error
4638
+ message: requirementResult.error
4635
4639
  };
4636
4640
  }
4637
- const projectId = workspace.projectId;
4638
- const requirementId = normalizeRequirementId(opts.requirement);
4641
+ const requirementId = requirementResult.requirementId;
4639
4642
  const taskId = normalizeTaskId(id);
4640
4643
  const config = getConfig();
4641
4644
  stopSpinner = showSpinner("Loading task", chalk8.gray);
@@ -4646,7 +4649,7 @@ async function handleTaskShow(id, opts) {
4646
4649
  showContent: true,
4647
4650
  apiUrl: config.apiUrl,
4648
4651
  projectShortId: projectId,
4649
- requirementShortId: opts.requirement,
4652
+ requirementShortId: opts?.requirement || requirementId,
4650
4653
  requirementId
4651
4654
  });
4652
4655
  return {
@@ -4675,12 +4678,6 @@ async function handleTaskCreate(opts) {
4675
4678
  message: chalk8.red("\u274C Not authenticated. Please run `braingrid login` first.")
4676
4679
  };
4677
4680
  }
4678
- if (!opts.requirement) {
4679
- return {
4680
- success: false,
4681
- message: chalk8.red("\u274C No requirement specified.\n\n") + chalk8.dim("Please provide a requirement ID:\n") + chalk8.cyan('braingrid task create -r REQ-456 --title "..."') + chalk8.dim(" (if initialized) or\n") + chalk8.cyan('braingrid task create -r REQ-456 -p PROJ-123 --title "..."')
4682
- };
4683
- }
4684
4681
  const workspace = await workspaceManager.getProject(opts.project);
4685
4682
  if (!workspace.success) {
4686
4683
  return {
@@ -4689,9 +4686,16 @@ async function handleTaskCreate(opts) {
4689
4686
  };
4690
4687
  }
4691
4688
  const projectId = workspace.projectId;
4692
- const requirementId = normalizeRequirementId(opts.requirement);
4689
+ const requirementResult = await workspaceManager.getRequirement(opts.requirement);
4690
+ if (!requirementResult.success) {
4691
+ return {
4692
+ success: false,
4693
+ message: requirementResult.error
4694
+ };
4695
+ }
4696
+ const requirementId = requirementResult.requirementId;
4693
4697
  const projectShortId = projectId;
4694
- const requirementShortId = opts.requirement;
4698
+ const requirementShortId = opts.requirement || requirementId;
4695
4699
  const config = getConfig();
4696
4700
  stopSpinner = showSpinner("Creating task", chalk8.gray);
4697
4701
  const task2 = await taskService.createTask(projectId, requirementId, {
@@ -4740,12 +4744,6 @@ async function handleTaskUpdate(id, opts) {
4740
4744
  message: chalk8.red("\u274C Please provide at least one field to update (--status or --title)")
4741
4745
  };
4742
4746
  }
4743
- if (!opts.requirement) {
4744
- return {
4745
- success: false,
4746
- message: chalk8.red("\u274C No requirement specified.\n\n") + chalk8.dim("Please provide a requirement ID:\n") + chalk8.cyan("braingrid task update TASK-789 -r REQ-456 --status COMPLETED") + chalk8.dim(" (if initialized) or\n") + chalk8.cyan("braingrid task update TASK-789 -r REQ-456 -p PROJ-123 --status COMPLETED")
4747
- };
4748
- }
4749
4747
  const workspace = await workspaceManager.getProject(opts.project);
4750
4748
  if (!workspace.success) {
4751
4749
  return {
@@ -4754,7 +4752,14 @@ async function handleTaskUpdate(id, opts) {
4754
4752
  };
4755
4753
  }
4756
4754
  const projectId = workspace.projectId;
4757
- const requirementId = normalizeRequirementId(opts.requirement);
4755
+ const requirementResult = await workspaceManager.getRequirement(opts.requirement);
4756
+ if (!requirementResult.success) {
4757
+ return {
4758
+ success: false,
4759
+ message: requirementResult.error
4760
+ };
4761
+ }
4762
+ const requirementId = requirementResult.requirementId;
4758
4763
  const taskId = normalizeTaskId(id);
4759
4764
  const config = getConfig();
4760
4765
  stopSpinner = showSpinner("Updating task", chalk8.gray);
@@ -4769,7 +4774,7 @@ async function handleTaskUpdate(id, opts) {
4769
4774
  successMessage: `Updated task ${task2.number}`,
4770
4775
  apiUrl: config.apiUrl,
4771
4776
  projectShortId: projectId,
4772
- requirementShortId: opts.requirement,
4777
+ requirementShortId: opts.requirement || requirementId,
4773
4778
  requirementId
4774
4779
  });
4775
4780
  return {
@@ -4804,12 +4809,6 @@ async function handleTaskDelete(id, opts) {
4804
4809
  message: chalk8.yellow("\u26A0\uFE0F Deleting a task is permanent. Use --force to confirm deletion.")
4805
4810
  };
4806
4811
  }
4807
- if (!opts.requirement) {
4808
- return {
4809
- success: false,
4810
- message: chalk8.red("\u274C No requirement specified.\n\n") + chalk8.dim("Please provide a requirement ID:\n") + chalk8.cyan("braingrid task delete TASK-789 -r REQ-456 --force") + chalk8.dim(" (if initialized) or\n") + chalk8.cyan("braingrid task delete TASK-789 -r REQ-456 -p PROJ-123 --force")
4811
- };
4812
- }
4813
4812
  const workspace = await workspaceManager.getProject(opts.project);
4814
4813
  if (!workspace.success) {
4815
4814
  return {
@@ -4818,7 +4817,14 @@ async function handleTaskDelete(id, opts) {
4818
4817
  };
4819
4818
  }
4820
4819
  const projectId = workspace.projectId;
4821
- const requirementId = normalizeRequirementId(opts.requirement);
4820
+ const requirementResult = await workspaceManager.getRequirement(opts.requirement);
4821
+ if (!requirementResult.success) {
4822
+ return {
4823
+ success: false,
4824
+ message: requirementResult.error
4825
+ };
4826
+ }
4827
+ const requirementId = requirementResult.requirementId;
4822
4828
  const taskId = normalizeTaskId(id);
4823
4829
  stopSpinner = showSpinner("Deleting task", chalk8.gray);
4824
4830
  await taskService.deleteTask(projectId, requirementId, taskId);