airgen-cli 0.20.3 → 0.21.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.
@@ -137,10 +137,13 @@ export function registerRequirementCommands(program, client) {
137
137
  .option("--section <id>", "Section ID")
138
138
  .option("--tags <tags>", "Comma-separated tags")
139
139
  .option("--idempotency-key <key>", "Prevent duplicates on retry — returns existing if key was already used")
140
+ .option("--verifies <ref>", "Atomically create a 'verifies' trace link to this requirement ref")
140
141
  .action(async (tenant, projectKey, opts) => {
141
142
  if (!opts.section && !opts.document) {
142
- console.error("Warning: No --section or --document specified. Requirement will be project-level with a generic ref (e.g., REQ-PROJECTNAME-001).");
143
- console.error(" Use --section <id> to assign to a document section for proper ref prefixing.");
143
+ console.error("Error: --section or --document is required. Without it, the requirement gets a project-level ref");
144
+ console.error(" (e.g., REQ-SEEMERGENCYDIESEL...-001) that breaks delete/reassign on long project slugs.");
145
+ console.error(" Use: airgen docs sections list <tenant> <project> <document> to find section IDs.");
146
+ process.exit(1);
144
147
  }
145
148
  const data = await client.post("/requirements", {
146
149
  tenant,
@@ -154,6 +157,7 @@ export function registerRequirementCommands(program, client) {
154
157
  sectionId: opts.section,
155
158
  tags: opts.tags?.split(",").map(t => t.trim()),
156
159
  idempotencyKey: opts.idempotencyKey,
160
+ verifiesRef: opts.verifies,
157
161
  });
158
162
  if (isJsonMode()) {
159
163
  output(data);
@@ -164,6 +168,8 @@ export function registerRequirementCommands(program, client) {
164
168
  }
165
169
  else {
166
170
  console.log("Requirement created.");
171
+ if (data.traceLink)
172
+ console.log("Trace link (verifies) created.");
167
173
  }
168
174
  output(data);
169
175
  }
@@ -378,6 +384,11 @@ export function registerRequirementCommands(program, client) {
378
384
  skipped++;
379
385
  continue;
380
386
  }
387
+ if (!item.document && !item.documentSlug && !item.section && !item.sectionId) {
388
+ console.error(` [${i}] Skipped: missing document/section (would create homeless requirement)`);
389
+ skipped++;
390
+ continue;
391
+ }
381
392
  if (opts.dryRun) {
382
393
  console.log(` [dry-run] ${truncate(text, 80)}`);
383
394
  created++;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "airgen-cli",
3
- "version": "0.20.3",
3
+ "version": "0.21.0",
4
4
  "description": "AIRGen CLI — requirements engineering from the command line",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",