airgen-cli 0.5.1 → 0.7.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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { readFileSync } from "node:fs";
|
|
1
|
+
import { readFileSync, writeFileSync } from "node:fs";
|
|
2
2
|
import { output, isJsonMode } from "../output.js";
|
|
3
3
|
export function registerImportExportCommands(program, client) {
|
|
4
4
|
const imp = program.command("import").description("Import requirements");
|
|
@@ -63,4 +63,20 @@ export function registerImportExportCommands(program, client) {
|
|
|
63
63
|
output(data);
|
|
64
64
|
}
|
|
65
65
|
});
|
|
66
|
+
exp
|
|
67
|
+
.command("documents")
|
|
68
|
+
.description("Export complete document set as ReqIF or Excel (includes sections, requirements, trace links, linksets)")
|
|
69
|
+
.argument("<tenant>", "Tenant slug")
|
|
70
|
+
.argument("<project>", "Project slug")
|
|
71
|
+
.option("--format <fmt>", "Format: reqif, excel", "reqif")
|
|
72
|
+
.option("-o, --output <file>", "Output file path")
|
|
73
|
+
.action(async (tenant, project, opts) => {
|
|
74
|
+
const format = opts.format === "excel" ? "excel" : "reqif";
|
|
75
|
+
const ext = format === "excel" ? "xlsx" : "reqif";
|
|
76
|
+
const outPath = opts.output ?? `${project}.${ext}`;
|
|
77
|
+
console.error(`Exporting documents as ${format}...`);
|
|
78
|
+
const { data } = await client.fetchBinary(`/documents-export/${tenant}/${project}?format=${format}`);
|
|
79
|
+
writeFileSync(outPath, data);
|
|
80
|
+
console.log(`Exported to ${outPath} (${(data.length / 1024).toFixed(1)} KB)`);
|
|
81
|
+
});
|
|
66
82
|
}
|
|
@@ -34,7 +34,8 @@ export function registerTraceabilityCommands(program, client) {
|
|
|
34
34
|
.requiredOption("--source <id>", "Source requirement ID")
|
|
35
35
|
.requiredOption("--target <id>", "Target requirement ID")
|
|
36
36
|
.requiredOption("--type <type>", "Link type: satisfies, derives, verifies, implements, refines, conflicts")
|
|
37
|
-
.option("--description <desc>", "
|
|
37
|
+
.option("--description <desc>", "Short description for traceability matrices")
|
|
38
|
+
.option("--rationale <text>", "Engineering justification for why this link exists")
|
|
38
39
|
.action(async (tenant, projectKey, opts) => {
|
|
39
40
|
const data = await client.post("/trace-links", {
|
|
40
41
|
tenant,
|
|
@@ -43,6 +44,7 @@ export function registerTraceabilityCommands(program, client) {
|
|
|
43
44
|
targetRequirementId: opts.target,
|
|
44
45
|
linkType: opts.type,
|
|
45
46
|
description: opts.description,
|
|
47
|
+
rationale: opts.rationale,
|
|
46
48
|
});
|
|
47
49
|
if (isJsonMode()) {
|
|
48
50
|
output(data);
|