delimit-cli 4.1.27 → 4.1.29
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/README.md +4 -1
- package/bin/delimit-cli.js +110 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -31,7 +31,7 @@ Works across any configuration — from a single model on a budget to an enterpr
|
|
|
31
31
|
|
|
32
32
|
```bash
|
|
33
33
|
npx delimit-cli scan # Instant health grade for your API spec
|
|
34
|
-
npx delimit-cli
|
|
34
|
+
npx delimit-cli pr owner/repo#123 # Review any GitHub PR for breaking changes
|
|
35
35
|
npx delimit-cli setup && source ~/.bashrc # Configure AI assistants + activate
|
|
36
36
|
```
|
|
37
37
|
|
|
@@ -143,6 +143,7 @@ That's it. Delimit auto-fetches the base branch spec, diffs it, and posts a PR c
|
|
|
143
143
|
|
|
144
144
|
```bash
|
|
145
145
|
npx delimit-cli scan # Instant spec health grade + recommendations
|
|
146
|
+
npx delimit-cli pr owner/repo#123 # Review any GitHub PR for breaking changes
|
|
146
147
|
npx delimit-cli quickstart # Clone demo project + guided walkthrough
|
|
147
148
|
npx delimit-cli try # Zero-risk demo — saves governance report
|
|
148
149
|
npx delimit-cli demo # Self-contained governance demo
|
|
@@ -153,6 +154,8 @@ npx delimit-cli setup --dry-run # Preview changes first
|
|
|
153
154
|
npx delimit-cli lint api/openapi.yaml # Check for breaking changes
|
|
154
155
|
npx delimit-cli diff old.yaml new.yaml # Compare two specs
|
|
155
156
|
npx delimit-cli explain old.yaml new.yaml # Generate migration guide
|
|
157
|
+
npx delimit-cli ci # Generate GitHub Action workflow
|
|
158
|
+
npx delimit-cli ci --strict --dry-run # Preview strict workflow
|
|
156
159
|
npx delimit-cli doctor # Check setup health
|
|
157
160
|
npx delimit-cli uninstall --dry-run # Preview removal
|
|
158
161
|
```
|
package/bin/delimit-cli.js
CHANGED
|
@@ -2437,6 +2437,7 @@ program
|
|
|
2437
2437
|
choices: [
|
|
2438
2438
|
{ name: `Lint this spec for breaking changes`, value: 'lint' },
|
|
2439
2439
|
{ name: 'Set up governance for this project', value: 'init' },
|
|
2440
|
+
{ name: 'Add CI gate (GitHub Action)', value: 'ci' },
|
|
2440
2441
|
{ name: 'Configure AI assistants (Claude, Codex, Gemini)', value: 'setup' },
|
|
2441
2442
|
{ name: 'Exit', value: 'exit' },
|
|
2442
2443
|
],
|
|
@@ -2445,6 +2446,8 @@ program
|
|
|
2445
2446
|
execSync(`npx delimit-cli lint ${target}`, { stdio: 'inherit' });
|
|
2446
2447
|
} else if (next === 'init') {
|
|
2447
2448
|
execSync('npx delimit-cli init', { stdio: 'inherit' });
|
|
2449
|
+
} else if (next === 'ci') {
|
|
2450
|
+
execSync('npx delimit-cli ci', { stdio: 'inherit' });
|
|
2448
2451
|
} else if (next === 'setup') {
|
|
2449
2452
|
execSync('npx delimit-cli setup', { stdio: 'inherit' });
|
|
2450
2453
|
}
|
|
@@ -2541,6 +2544,7 @@ program
|
|
|
2541
2544
|
message: '\n What next?\n',
|
|
2542
2545
|
choices: [
|
|
2543
2546
|
{ name: 'Set up governance for this project', value: 'init' },
|
|
2547
|
+
{ name: 'Add CI gate (GitHub Action)', value: 'ci' },
|
|
2544
2548
|
{ name: 'Configure AI assistants (Claude, Codex, Gemini)', value: 'setup' },
|
|
2545
2549
|
{ name: 'Run a breaking change demo', value: 'try' },
|
|
2546
2550
|
{ name: 'Exit', value: 'exit' },
|
|
@@ -2548,6 +2552,8 @@ program
|
|
|
2548
2552
|
}]);
|
|
2549
2553
|
if (next === 'init') {
|
|
2550
2554
|
execSync('npx delimit-cli init', { stdio: 'inherit' });
|
|
2555
|
+
} else if (next === 'ci') {
|
|
2556
|
+
execSync('npx delimit-cli ci', { stdio: 'inherit' });
|
|
2551
2557
|
} else if (next === 'setup') {
|
|
2552
2558
|
execSync('npx delimit-cli setup', { stdio: 'inherit' });
|
|
2553
2559
|
} else if (next === 'try') {
|
|
@@ -3034,6 +3040,110 @@ program
|
|
|
3034
3040
|
}
|
|
3035
3041
|
});
|
|
3036
3042
|
|
|
3043
|
+
// CI command — generate GitHub Action workflow
|
|
3044
|
+
program
|
|
3045
|
+
.command('ci')
|
|
3046
|
+
.description('Generate a GitHub Action workflow for API governance on every PR')
|
|
3047
|
+
.option('--spec <path>', 'Path to OpenAPI spec (auto-detected if omitted)')
|
|
3048
|
+
.option('--strict', 'Use strict policy preset')
|
|
3049
|
+
.option('--dry-run', 'Print workflow to stdout instead of writing file')
|
|
3050
|
+
.action(async (opts) => {
|
|
3051
|
+
console.log(chalk.bold('\n Delimit CI Setup\n'));
|
|
3052
|
+
|
|
3053
|
+
// Auto-detect spec
|
|
3054
|
+
let specPath = opts.spec;
|
|
3055
|
+
if (!specPath) {
|
|
3056
|
+
const candidates = [
|
|
3057
|
+
'api/openapi.yaml', 'api/openapi.yml', 'api/openapi.json',
|
|
3058
|
+
'openapi.yaml', 'openapi.yml', 'openapi.json',
|
|
3059
|
+
'api/swagger.yaml', 'api/swagger.yml', 'api/swagger.json',
|
|
3060
|
+
'swagger.yaml', 'swagger.yml', 'swagger.json',
|
|
3061
|
+
'docs/openapi.yaml', 'docs/openapi.yml',
|
|
3062
|
+
'specs/openapi.yaml', 'specs/openapi.yml',
|
|
3063
|
+
];
|
|
3064
|
+
for (const c of candidates) {
|
|
3065
|
+
if (fs.existsSync(path.join(process.cwd(), c))) {
|
|
3066
|
+
specPath = c;
|
|
3067
|
+
break;
|
|
3068
|
+
}
|
|
3069
|
+
}
|
|
3070
|
+
}
|
|
3071
|
+
|
|
3072
|
+
if (specPath) {
|
|
3073
|
+
console.log(chalk.green(` Found spec: ${specPath}`));
|
|
3074
|
+
} else {
|
|
3075
|
+
console.log(chalk.yellow(' No OpenAPI spec found — using auto-detect in workflow'));
|
|
3076
|
+
}
|
|
3077
|
+
|
|
3078
|
+
const policy = opts.strict ? 'strict' : 'default';
|
|
3079
|
+
const specLine = specPath ? `\n spec: ${specPath}` : '';
|
|
3080
|
+
const policyLine = opts.strict ? `\n policy: strict` : '';
|
|
3081
|
+
|
|
3082
|
+
const workflow = `name: API Governance
|
|
3083
|
+
on:
|
|
3084
|
+
pull_request:
|
|
3085
|
+
paths:
|
|
3086
|
+
- '**/*.yaml'
|
|
3087
|
+
- '**/*.yml'
|
|
3088
|
+
- '**/*.json'
|
|
3089
|
+
|
|
3090
|
+
jobs:
|
|
3091
|
+
delimit:
|
|
3092
|
+
name: Breaking Change Check
|
|
3093
|
+
runs-on: ubuntu-latest
|
|
3094
|
+
permissions:
|
|
3095
|
+
pull-requests: write
|
|
3096
|
+
contents: read
|
|
3097
|
+
steps:
|
|
3098
|
+
- uses: actions/checkout@v4
|
|
3099
|
+
with:
|
|
3100
|
+
fetch-depth: 0
|
|
3101
|
+
|
|
3102
|
+
- uses: delimit-ai/delimit-action@v1
|
|
3103
|
+
with:${specLine}${policyLine}
|
|
3104
|
+
comment: true
|
|
3105
|
+
`;
|
|
3106
|
+
|
|
3107
|
+
if (opts.dryRun) {
|
|
3108
|
+
console.log('');
|
|
3109
|
+
console.log(workflow);
|
|
3110
|
+
return;
|
|
3111
|
+
}
|
|
3112
|
+
|
|
3113
|
+
// Write workflow file
|
|
3114
|
+
const workflowDir = path.join(process.cwd(), '.github', 'workflows');
|
|
3115
|
+
const workflowPath = path.join(workflowDir, 'api-governance.yml');
|
|
3116
|
+
|
|
3117
|
+
if (fs.existsSync(workflowPath)) {
|
|
3118
|
+
const ans = await inquirer.prompt([{
|
|
3119
|
+
type: 'confirm',
|
|
3120
|
+
name: 'overwrite',
|
|
3121
|
+
message: chalk.yellow(' .github/workflows/api-governance.yml already exists. Overwrite?'),
|
|
3122
|
+
default: false,
|
|
3123
|
+
}]);
|
|
3124
|
+
if (!ans.overwrite) {
|
|
3125
|
+
console.log(chalk.gray('\n Skipped. Use --dry-run to preview the workflow.\n'));
|
|
3126
|
+
return;
|
|
3127
|
+
}
|
|
3128
|
+
}
|
|
3129
|
+
|
|
3130
|
+
fs.mkdirSync(workflowDir, { recursive: true });
|
|
3131
|
+
fs.writeFileSync(workflowPath, workflow);
|
|
3132
|
+
|
|
3133
|
+
console.log(chalk.green.bold(`\n Created: .github/workflows/api-governance.yml`));
|
|
3134
|
+
console.log(chalk.gray(` Policy: ${policy}`));
|
|
3135
|
+
console.log('');
|
|
3136
|
+
console.log(chalk.bold(' What happens next:'));
|
|
3137
|
+
console.log(` ${chalk.green('1.')} Open a PR that changes an API spec`);
|
|
3138
|
+
console.log(` ${chalk.green('2.')} Delimit detects breaking changes automatically`);
|
|
3139
|
+
console.log(` ${chalk.green('3.')} PR gets a comment with violations + migration guide`);
|
|
3140
|
+
console.log('');
|
|
3141
|
+
console.log(chalk.bold(' Commit it:'));
|
|
3142
|
+
console.log(chalk.gray(` git add .github/workflows/api-governance.yml`));
|
|
3143
|
+
console.log(chalk.gray(` git commit -m "ci: add API governance gate"`));
|
|
3144
|
+
console.log(chalk.gray(` git push\n`));
|
|
3145
|
+
});
|
|
3146
|
+
|
|
3037
3147
|
// Lint command — diff + policy (primary command)
|
|
3038
3148
|
// Supports zero-spec mode: `delimit lint` (no args) auto-extracts from FastAPI
|
|
3039
3149
|
program
|
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.29",
|
|
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": [
|