@aisdlc/cli 2.5.1 → 3.1.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/dist/index.js CHANGED
@@ -1667,12 +1667,15 @@ function runGitCheckout(taskId, options = {}) {
1667
1667
  function runGitHookInstall(options = {}) {
1668
1668
  const rootDir = options.root || process.cwd();
1669
1669
  console.log(pc4.cyan(`
1670
- \u{1F527} [AI-SDLC Git] Installing deterministic hook for commit trailers...`));
1670
+ \u{1F527} [AI-SDLC Git] Installing deterministic Git hooks (pre-commit & prepare-commit-msg)...`));
1671
1671
  const result = installGitHooks(rootDir);
1672
1672
  if (result.success) {
1673
- console.log(pc4.green(`\u2714 [COMPLIANT] Git Hook successfully installed at:`));
1674
- console.log(` \u{1F449} ${pc4.bold(result.hookPath || ".git/hooks/prepare-commit-msg")}
1675
- `);
1673
+ console.log(pc4.green(`\u2714 [COMPLIANT] Git Hooks successfully installed:`));
1674
+ const hooks = result.installedHooks || [result.hookPath || ".git/hooks/prepare-commit-msg"];
1675
+ for (const h of hooks) {
1676
+ console.log(` \u{1F449} ${pc4.bold(h)}`);
1677
+ }
1678
+ console.log();
1676
1679
  return true;
1677
1680
  } else {
1678
1681
  console.error(pc4.red(`
@@ -2092,6 +2095,26 @@ function runReportQuality(options = {}) {
2092
2095
  return result.verdict === "PASS";
2093
2096
  }
2094
2097
 
2098
+ // src/commands/inspect.ts
2099
+ import { inspectElement, formatInspectResultMarkdown } from "@aisdlc/core";
2100
+ function isJsonOutput2(options = {}) {
2101
+ if (options.json !== void 0) return Boolean(options.json);
2102
+ if (options.format !== void 0) return options.format.trim().toLowerCase() === "json";
2103
+ const env = process.env.AISDLC_FORMAT?.trim().toLowerCase() || process.env.AISDLC_OUTPUT?.trim().toLowerCase();
2104
+ return env === "json";
2105
+ }
2106
+ function runInspect(query, options = {}) {
2107
+ const root = options.root || process.cwd();
2108
+ const result = inspectElement(query, { rootDir: root });
2109
+ if (isJsonOutput2(options)) {
2110
+ console.log(JSON.stringify(result, null, 2));
2111
+ return result.found;
2112
+ }
2113
+ const markdown = formatInspectResultMarkdown(result);
2114
+ console.log(markdown);
2115
+ return result.found;
2116
+ }
2117
+
2095
2118
  // src/commands/sdd.ts
2096
2119
  import * as path3 from "path";
2097
2120
  import pc9 from "picocolors";
@@ -2451,7 +2474,7 @@ function runChangeNew(options) {
2451
2474
 
2452
2475
  // src/index.ts
2453
2476
  var program = new Command();
2454
- program.name("aisdlc").description("AI-SDLC: Spec-Driven Development, Governance & Quality Gates for AI & Humans").version("2.5.1");
2477
+ program.name("aisdlc").description("AI-SDLC: Spec-Driven Development, Governance & Quality Gates for AI & Humans").version("3.0.0");
2455
2478
  program.command("check").description("Unified pre-flight command: validates Quality Gates with optional non-destructive auto-fix").option("--fix", "Automatically synchronize Gherkin scenarios (.feature) and cryptographic digests of PDaC citations").option("-r, --root <path>", "Project root directory").option("--vuln", "Scan for known vulnerabilities (CVE/GHSA) in dependencies").option("--json", "Emit verification results in structured JSON format").option("-F, --format <format>", "Output format: text or json").action((opts) => {
2456
2479
  const passed = runCheck({
2457
2480
  fix: opts.fix,
@@ -2738,6 +2761,14 @@ sddCommand.command("integrate").description("Integrate and synchronize implement
2738
2761
  });
2739
2762
  process.exit(passed ? 0 : 1);
2740
2763
  });
2764
+ program.command("inspect <element>").description("Inspect an element (FR, UC, CMP, task, or source file) to display technical summary and relationships").option("-r, --root <path>", "Project root directory").option("--json", "Structured JSON format output").option("-F, --format <format>", "Output format: text or json").action((element, opts) => {
2765
+ const passed = runInspect(element, {
2766
+ root: opts.root,
2767
+ json: opts.json,
2768
+ format: opts.format
2769
+ });
2770
+ process.exit(passed ? 0 : 1);
2771
+ });
2741
2772
  program.command("init [directory]").description("Initialize a new repository with AI-SDLC guidelines, schemas, and policies").option("-d, --dry-run", "Simulate file and directory creation without writing to disk").option("-f, --force", "Force overwrite existing agent, rule, and policy configurations with canonical templates").option("--ci <provider>", "CI/CD provider for pipeline generation (github, gitlab, azure, bitbucket)").option("--agents [targets]", "AI agent environments to configure (all, cursor, claude, antigravity, copilot, mcp, or comma-separated combination)").option("--arch, --architecture <granularity>", "Architecture templates granularity level (minimal, full, complete, none)").option("--json", "Structured JSON format output").option("-F, --format <format>", "Output format: text or json").action(async (directory, opts) => {
2742
2773
  let agents = opts.agents;
2743
2774
  let arch = opts.architecture || opts.arch;