delimit-cli 3.14.12 → 3.14.13
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 +1 -0
- package/bin/delimit-cli.js +106 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -121,6 +121,7 @@ That's it. Delimit auto-fetches the base branch spec, diffs it, and posts a PR c
|
|
|
121
121
|
## CLI commands
|
|
122
122
|
|
|
123
123
|
```bash
|
|
124
|
+
npx delimit-cli quickstart # Clone demo project + guided walkthrough
|
|
124
125
|
npx delimit-cli try # Zero-risk demo — saves governance report
|
|
125
126
|
npx delimit-cli demo # Self-contained governance demo
|
|
126
127
|
npx delimit-cli init # Guided wizard with compliance templates
|
package/bin/delimit-cli.js
CHANGED
|
@@ -1538,6 +1538,112 @@ program
|
|
|
1538
1538
|
try { fs.rmSync(tmpDir, { recursive: true }); } catch {}
|
|
1539
1539
|
});
|
|
1540
1540
|
|
|
1541
|
+
// Quickstart command — clone demo repo + guided walkthrough (LED-267)
|
|
1542
|
+
program
|
|
1543
|
+
.command('quickstart')
|
|
1544
|
+
.description('Clone a demo project and walk through governance in 5 minutes')
|
|
1545
|
+
.action(async () => {
|
|
1546
|
+
const targetDir = path.join(process.cwd(), 'delimit-demo');
|
|
1547
|
+
|
|
1548
|
+
console.log(chalk.bold('\n Delimit Quickstart\n'));
|
|
1549
|
+
console.log(chalk.gray(' Clone a demo API project with a pre-broken spec,'));
|
|
1550
|
+
console.log(chalk.gray(' then walk through the governance flow step by step.\n'));
|
|
1551
|
+
|
|
1552
|
+
// Step 1: Clone the quickstart repo
|
|
1553
|
+
if (fs.existsSync(targetDir)) {
|
|
1554
|
+
console.log(chalk.yellow(` ${targetDir} already exists. Using existing directory.\n`));
|
|
1555
|
+
} else {
|
|
1556
|
+
console.log(chalk.bold(' Step 1: Cloning demo project...'));
|
|
1557
|
+
try {
|
|
1558
|
+
execSync(`git clone --depth 1 https://github.com/delimit-ai/delimit-quickstart.git "${targetDir}" 2>/dev/null`, { stdio: 'pipe' });
|
|
1559
|
+
await logp(chalk.green(' Cloned delimit-ai/delimit-quickstart'));
|
|
1560
|
+
} catch {
|
|
1561
|
+
console.log(chalk.yellow(' Could not clone repo. Creating demo files locally...'));
|
|
1562
|
+
fs.mkdirSync(targetDir, { recursive: true });
|
|
1563
|
+
// Create inline demo specs
|
|
1564
|
+
const baseSpec = { openapi: '3.0.3', info: { title: 'Pet Store API', version: '1.0.0' }, paths: { '/pets': { get: { summary: 'List pets', responses: { '200': { description: 'OK' } } } }, '/pets/{petId}': { get: { summary: 'Get pet', parameters: [{ name: 'petId', in: 'path', required: true, schema: { type: 'string' } }], responses: { '200': { description: 'OK' } } } } }, components: { schemas: { Pet: { type: 'object', properties: { id: { type: 'integer' }, name: { type: 'string' }, tag: { type: 'string' } } } } } };
|
|
1565
|
+
const changedSpec = JSON.parse(JSON.stringify(baseSpec));
|
|
1566
|
+
changedSpec.info.version = '2.0.0';
|
|
1567
|
+
delete changedSpec.paths['/pets/{petId}'];
|
|
1568
|
+
delete changedSpec.components.schemas.Pet.properties.tag;
|
|
1569
|
+
fs.writeFileSync(path.join(targetDir, 'openapi.yaml'), yaml.dump(baseSpec));
|
|
1570
|
+
fs.writeFileSync(path.join(targetDir, 'openapi-changed.yaml'), yaml.dump(changedSpec));
|
|
1571
|
+
await logp(chalk.green(' Created demo specs locally'));
|
|
1572
|
+
}
|
|
1573
|
+
}
|
|
1574
|
+
console.log('');
|
|
1575
|
+
|
|
1576
|
+
// Step 2: Initialize governance
|
|
1577
|
+
console.log(chalk.bold(' Step 2: Setting up governance...'));
|
|
1578
|
+
const configDir = path.join(targetDir, '.delimit');
|
|
1579
|
+
if (!fs.existsSync(path.join(configDir, 'policies.yml'))) {
|
|
1580
|
+
fs.mkdirSync(configDir, { recursive: true });
|
|
1581
|
+
fs.writeFileSync(path.join(configDir, 'policies.yml'), POLICY_PRESETS['strict']);
|
|
1582
|
+
await logp(chalk.green(' Created .delimit/policies.yml (strict)'));
|
|
1583
|
+
} else {
|
|
1584
|
+
await logp(chalk.green(' Governance already initialized'));
|
|
1585
|
+
}
|
|
1586
|
+
console.log('');
|
|
1587
|
+
|
|
1588
|
+
// Step 3: Run lint to show breaking changes
|
|
1589
|
+
console.log(chalk.bold(' Step 3: Running governance lint...\n'));
|
|
1590
|
+
const oldSpec = path.join(targetDir, 'openapi.yaml');
|
|
1591
|
+
const newSpec = path.join(targetDir, 'openapi-changed.yaml');
|
|
1592
|
+
|
|
1593
|
+
if (fs.existsSync(oldSpec) && fs.existsSync(newSpec)) {
|
|
1594
|
+
try {
|
|
1595
|
+
const result = apiEngine.lint(oldSpec, newSpec, { policy: 'strict' });
|
|
1596
|
+
if (result && result.summary) {
|
|
1597
|
+
const s = result.summary;
|
|
1598
|
+
const breaking = s.breaking || s.breaking_changes || 0;
|
|
1599
|
+
if (breaking > 0) {
|
|
1600
|
+
console.log(chalk.red.bold(` BLOCKED — ${breaking} breaking change(s) detected\n`));
|
|
1601
|
+
}
|
|
1602
|
+
const violations = result.violations || [];
|
|
1603
|
+
violations.forEach(v => {
|
|
1604
|
+
const icon = v.severity === 'error' ? chalk.red(' BLOCK') : chalk.yellow(' WARN ');
|
|
1605
|
+
console.log(` ${icon} ${v.message}`);
|
|
1606
|
+
});
|
|
1607
|
+
}
|
|
1608
|
+
} catch {
|
|
1609
|
+
console.log(chalk.green(' Spec validated — no breaking changes'));
|
|
1610
|
+
}
|
|
1611
|
+
} else {
|
|
1612
|
+
console.log(chalk.yellow(' No spec files found. Run delimit lint manually.'));
|
|
1613
|
+
}
|
|
1614
|
+
|
|
1615
|
+
// Step 4: Show what to do next
|
|
1616
|
+
console.log(chalk.bold('\n What just happened:'));
|
|
1617
|
+
await logp(chalk.gray(' 1. Cloned a demo API project'));
|
|
1618
|
+
await logp(chalk.gray(' 2. Initialized strict governance policy'));
|
|
1619
|
+
await logp(chalk.gray(' 3. Ran lint and caught breaking changes'));
|
|
1620
|
+
console.log('');
|
|
1621
|
+
console.log(chalk.bold(' Now try in your own project:'));
|
|
1622
|
+
console.log(` ${chalk.green('npx delimit-cli init')} — set up governance`);
|
|
1623
|
+
console.log(` ${chalk.green('npx delimit-cli lint')} — check your API spec`);
|
|
1624
|
+
console.log(` ${chalk.green('npx delimit-cli setup')} — configure AI assistants`);
|
|
1625
|
+
console.log('');
|
|
1626
|
+
console.log(chalk.gray(` Demo project: ${targetDir}`));
|
|
1627
|
+
console.log(chalk.gray(` Clean up: rm -rf delimit-demo\n`));
|
|
1628
|
+
|
|
1629
|
+
// Beta capture
|
|
1630
|
+
try {
|
|
1631
|
+
const betaAns = await inquirer.prompt([{
|
|
1632
|
+
type: 'input',
|
|
1633
|
+
name: 'email',
|
|
1634
|
+
message: chalk.blue('Join the beta? Enter your email (or press Enter to skip):'),
|
|
1635
|
+
}]);
|
|
1636
|
+
if (betaAns.email && betaAns.email.includes('@')) {
|
|
1637
|
+
try {
|
|
1638
|
+
await axios.post('https://delimit.ai/api/subscribe', { email: betaAns.email, source: 'cli-quickstart' });
|
|
1639
|
+
console.log(chalk.green('\n Thanks! You\'re on the list.\n'));
|
|
1640
|
+
} catch {
|
|
1641
|
+
console.log(chalk.green('\n Thanks! Visit https://delimit.ai\n'));
|
|
1642
|
+
}
|
|
1643
|
+
}
|
|
1644
|
+
} catch {}
|
|
1645
|
+
});
|
|
1646
|
+
|
|
1541
1647
|
// Try command — zero-risk demo with Markdown report artifact (LED-264)
|
|
1542
1648
|
program
|
|
1543
1649
|
.command('try')
|
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": "3.14.
|
|
4
|
+
"version": "3.14.13",
|
|
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": [
|