delimit-cli 4.1.4 → 4.1.6
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/bin/delimit-cli.js +38 -12
- package/package.json +1 -1
package/bin/delimit-cli.js
CHANGED
|
@@ -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
|
|
@@ -2396,7 +2396,7 @@ program
|
|
|
2396
2396
|
const { next } = await inquirer.prompt([{
|
|
2397
2397
|
type: 'list',
|
|
2398
2398
|
name: 'next',
|
|
2399
|
-
message: 'What next
|
|
2399
|
+
message: '\n What next?\n',
|
|
2400
2400
|
choices: [
|
|
2401
2401
|
{ name: `Lint this spec for breaking changes`, value: 'lint' },
|
|
2402
2402
|
{ name: 'Set up governance for this project', value: 'init' },
|
|
@@ -2468,14 +2468,40 @@ program
|
|
|
2468
2468
|
} catch {}
|
|
2469
2469
|
} else {
|
|
2470
2470
|
console.log(` ${chalk.yellow('\u2014')} No OpenAPI specs found in this directory`);
|
|
2471
|
-
console.log(
|
|
2471
|
+
console.log('');
|
|
2472
|
+
// Run demo on bundled example spec so users always see value
|
|
2473
|
+
const demoSpec = path.join(__dirname, '..', 'examples', 'petstore-v1.yaml');
|
|
2474
|
+
if (fs.existsSync(demoSpec)) {
|
|
2475
|
+
console.log(chalk.gray(' Running demo on a sample Pet Store API...\n'));
|
|
2476
|
+
try {
|
|
2477
|
+
const demoResult = execSync(
|
|
2478
|
+
`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))"`,
|
|
2479
|
+
{ encoding: 'utf-8', timeout: 15000, cwd: serverDir }
|
|
2480
|
+
);
|
|
2481
|
+
const health = JSON.parse(demoResult);
|
|
2482
|
+
const gradeColors = { A: 'green', B: 'blue', C: 'yellow', D: 'red', F: 'red' };
|
|
2483
|
+
const gradeColor = gradeColors[health.grade] || 'white';
|
|
2484
|
+
console.log(` ${chalk[gradeColor].bold(health.grade)} ${chalk.white.bold(health.overall_score + '/100')} ${chalk.gray('Sample: Pet Store API')}\n`);
|
|
2485
|
+
for (const [dim, data] of Object.entries(health.dimensions || {})) {
|
|
2486
|
+
const score = data.score || 0;
|
|
2487
|
+
const bar = '\u2588'.repeat(Math.round(score / 5)) + '\u2591'.repeat(20 - Math.round(score / 5));
|
|
2488
|
+
const color = score >= 70 ? 'green' : score >= 40 ? 'yellow' : 'red';
|
|
2489
|
+
console.log(` ${chalk.gray(dim.padEnd(16))} ${chalk[color](bar)} ${score}`);
|
|
2490
|
+
}
|
|
2491
|
+
console.log('');
|
|
2492
|
+
console.log(chalk.gray(' This is a demo. Point at your spec: npx delimit-cli scan openapi.yaml'));
|
|
2493
|
+
console.log('');
|
|
2494
|
+
} catch {}
|
|
2495
|
+
} else {
|
|
2496
|
+
console.log(chalk.gray(' Tip: point at a spec file: npx delimit-cli scan openapi.yaml'));
|
|
2497
|
+
}
|
|
2472
2498
|
}
|
|
2473
2499
|
// Interactive next step picker
|
|
2474
2500
|
try {
|
|
2475
2501
|
const { next } = await inquirer.prompt([{
|
|
2476
2502
|
type: 'list',
|
|
2477
2503
|
name: 'next',
|
|
2478
|
-
message: 'What next
|
|
2504
|
+
message: '\n What next?\n',
|
|
2479
2505
|
choices: [
|
|
2480
2506
|
{ name: 'Set up governance for this project', value: 'init' },
|
|
2481
2507
|
{ name: 'Configure AI assistants (Claude, Codex, Gemini)', value: 'setup' },
|
|
@@ -2816,7 +2842,7 @@ program
|
|
|
2816
2842
|
if (!zeroResult.success) {
|
|
2817
2843
|
console.error(chalk.red(`\n ${zeroResult.error}\n`));
|
|
2818
2844
|
if (zeroResult.error_type === 'no_framework') {
|
|
2819
|
-
console.log(' Usage: delimit lint <old_spec> <new_spec>');
|
|
2845
|
+
console.log(' Usage: npx delimit-cli lint <old_spec> <new_spec>');
|
|
2820
2846
|
console.log(' Or run from a FastAPI project directory.\n');
|
|
2821
2847
|
}
|
|
2822
2848
|
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
|
+
"version": "4.1.6",
|
|
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": [
|