delimit-cli 4.1.4 → 4.1.5

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.
Files changed (2) hide show
  1. package/bin/delimit-cli.js +34 -11
  2. package/package.json +1 -1
@@ -1312,7 +1312,7 @@ program
1312
1312
 
1313
1313
  if (fs.existsSync(policyFile)) {
1314
1314
  console.log(chalk.yellow(' Already initialized — .delimit/policies.yml exists'));
1315
- console.log(` Run ${chalk.bold('delimit lint')} to check your API.\n`);
1315
+ console.log(` Run ${chalk.bold('npx delimit-cli lint')} to check your API.\n`);
1316
1316
  return;
1317
1317
  }
1318
1318
 
@@ -1723,7 +1723,7 @@ jobs:
1723
1723
  owner: context.repo.owner,
1724
1724
  repo: context.repo.repo,
1725
1725
  title: 'API Drift Detected — Governance Review Needed',
1726
- body: 'The weekly drift monitor detected changes to the API spec that have not been reviewed through governance. Run delimit lint to review.',
1726
+ body: 'The weekly drift monitor detected changes to the API spec that have not been reviewed through governance. Run npx delimit-cli lint to review.',
1727
1727
  labels: ['api-governance', 'drift'],
1728
1728
  });
1729
1729
  `;
@@ -1781,10 +1781,10 @@ jobs:
1781
1781
  console.log(chalk.green(' Saved baseline to .delimit/baseline.yaml'));
1782
1782
  }
1783
1783
  } else {
1784
- console.log(chalk.gray(' Zero-Spec extraction skipped — run `delimit lint` manually'));
1784
+ console.log(chalk.gray(' Zero-Spec extraction skipped — run `npx delimit-cli lint` manually'));
1785
1785
  }
1786
1786
  } catch {
1787
- console.log(chalk.gray(' Zero-Spec extraction skipped — run `delimit lint` manually'));
1787
+ console.log(chalk.gray(' Zero-Spec extraction skipped — run `npx delimit-cli lint` manually'));
1788
1788
  }
1789
1789
  }
1790
1790
 
@@ -1878,11 +1878,11 @@ jobs:
1878
1878
  console.log(chalk.gray(` Evidence saved to .delimit/evidence/\n`));
1879
1879
  console.log(' Next steps:');
1880
1880
  if (specPath) {
1881
- console.log(` ${chalk.bold('delimit lint')} ${specPath} ${specPath} — lint on every PR`);
1881
+ console.log(` ${chalk.bold('npx delimit-cli lint')} ${specPath} ${specPath} — lint on every PR`);
1882
1882
  } else if (['fastapi', 'nestjs', 'express'].includes(framework)) {
1883
- console.log(` ${chalk.bold('delimit lint')} — zero-spec mode (${frameworkLabel})`);
1883
+ console.log(` ${chalk.bold('npx delimit-cli lint')} — zero-spec mode (${frameworkLabel})`);
1884
1884
  } else {
1885
- console.log(` ${chalk.bold('delimit lint')} — add an OpenAPI spec first`);
1885
+ console.log(` ${chalk.bold('npx delimit-cli lint')} — add an OpenAPI spec first`);
1886
1886
  }
1887
1887
  console.log(` ${chalk.bold('delimit doctor')} — verify setup`);
1888
1888
  console.log(` ${chalk.bold('delimit explain')} — human-readable report`);
@@ -2175,7 +2175,7 @@ program
2175
2175
  console.log(chalk.green(' Spec validated — no breaking changes'));
2176
2176
  }
2177
2177
  } else {
2178
- console.log(chalk.yellow(' No spec files found. Run delimit lint manually.'));
2178
+ console.log(chalk.yellow(' No spec files found. Run npx delimit-cli lint manually.'));
2179
2179
  }
2180
2180
 
2181
2181
  // Step 4: Show what to do next
@@ -2467,8 +2467,31 @@ program
2467
2467
  }
2468
2468
  } catch {}
2469
2469
  } else {
2470
- console.log(` ${chalk.yellow('\u2014')} No OpenAPI specs found in this directory`);
2471
- console.log(chalk.gray(' Tip: point at a spec file directly: npx delimit-cli scan openapi.yaml'));
2470
+ console.log(` ${chalk.yellow('\u2014')} No OpenAPI specs found in this directory\n`);
2471
+ // Run demo on bundled example spec so users always see value
2472
+ const demoSpec = path.join(__dirname, '..', 'examples', 'petstore-v1.yaml');
2473
+ if (fs.existsSync(demoSpec)) {
2474
+ console.log(chalk.gray(' Running demo on a sample Pet Store API...\n'));
2475
+ try {
2476
+ const demoResult = execSync(
2477
+ `python3 -c "import sys,json; sys.path.insert(0,'${serverDir}'); from core.spec_health import score_spec; import yaml; spec=yaml.safe_load(open('${demoSpec}')); r=score_spec(spec); print(json.dumps(r))"`,
2478
+ { encoding: 'utf-8', timeout: 15000, cwd: serverDir }
2479
+ );
2480
+ const health = JSON.parse(demoResult);
2481
+ const gradeColors = { A: 'green', B: 'blue', C: 'yellow', D: 'red', F: 'red' };
2482
+ const gradeColor = gradeColors[health.grade] || 'white';
2483
+ console.log(` ${chalk[gradeColor].bold(health.grade)} ${chalk.white.bold(health.overall_score + '/100')} ${chalk.gray('Sample: Pet Store API')}\n`);
2484
+ for (const [dim, data] of Object.entries(health.dimensions || {})) {
2485
+ const score = data.score || 0;
2486
+ const bar = '\u2588'.repeat(Math.round(score / 5)) + '\u2591'.repeat(20 - Math.round(score / 5));
2487
+ const color = score >= 70 ? 'green' : score >= 40 ? 'yellow' : 'red';
2488
+ console.log(` ${chalk.gray(dim.padEnd(16))} ${chalk[color](bar)} ${score}`);
2489
+ }
2490
+ console.log(chalk.gray('\n This is a demo. Point at your spec: npx delimit-cli scan openapi.yaml'));
2491
+ } catch {}
2492
+ } else {
2493
+ console.log(chalk.gray(' Tip: point at a spec file: npx delimit-cli scan openapi.yaml'));
2494
+ }
2472
2495
  }
2473
2496
  // Interactive next step picker
2474
2497
  try {
@@ -2816,7 +2839,7 @@ program
2816
2839
  if (!zeroResult.success) {
2817
2840
  console.error(chalk.red(`\n ${zeroResult.error}\n`));
2818
2841
  if (zeroResult.error_type === 'no_framework') {
2819
- console.log(' Usage: delimit lint <old_spec> <new_spec>');
2842
+ console.log(' Usage: npx delimit-cli lint <old_spec> <new_spec>');
2820
2843
  console.log(' Or run from a FastAPI project directory.\n');
2821
2844
  }
2822
2845
  process.exit(1);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "delimit-cli",
3
3
  "mcpName": "io.github.delimit-ai/delimit-mcp-server",
4
- "version": "4.1.4",
4
+ "version": "4.1.5",
5
5
  "description": "Unify Claude Code, Codex, Cursor, and Gemini CLI with persistent context, governance, and multi-model debate.",
6
6
  "main": "index.js",
7
7
  "files": [