@rigour-labs/cli 1.2.1 → 1.5.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/cli.js +48 -5
- package/dist/commands/guide.d.ts +1 -0
- package/dist/commands/guide.js +22 -0
- package/dist/commands/setup.d.ts +1 -0
- package/dist/commands/setup.js +28 -0
- package/package.json +3 -3
- package/src/cli.ts +47 -5
- package/src/commands/guide.ts +21 -0
- package/src/commands/setup.ts +28 -0
package/dist/cli.js
CHANGED
|
@@ -1,16 +1,30 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
3
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
7
|
const commander_1 = require("commander");
|
|
5
8
|
const init_js_1 = require("./commands/init.js");
|
|
6
9
|
const check_js_1 = require("./commands/check.js");
|
|
7
10
|
const explain_js_1 = require("./commands/explain.js");
|
|
8
11
|
const run_js_1 = require("./commands/run.js");
|
|
12
|
+
const guide_js_1 = require("./commands/guide.js");
|
|
13
|
+
const setup_js_1 = require("./commands/setup.js");
|
|
14
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
9
15
|
const program = new commander_1.Command();
|
|
10
16
|
program
|
|
11
17
|
.name('rigour')
|
|
12
|
-
.description('
|
|
13
|
-
.version('1.
|
|
18
|
+
.description('🛡️ Rigour: The Quality Gate Loop for AI-Assisted Engineering')
|
|
19
|
+
.version('1.3.0')
|
|
20
|
+
.addHelpText('before', chalk_1.default.bold.cyan(`
|
|
21
|
+
____ _
|
|
22
|
+
/ __ \\(_)____ ___ __ __ _____
|
|
23
|
+
/ /_/ // // __ \`/ / / / / // ___/
|
|
24
|
+
/ _, _// // /_/ // /_/ / / // /
|
|
25
|
+
/_/ |_|/_/ \\__, / \\__,_/_/ /_/
|
|
26
|
+
/____/
|
|
27
|
+
`));
|
|
14
28
|
program
|
|
15
29
|
.command('init')
|
|
16
30
|
.description('Initialize Rigour in the current directory')
|
|
@@ -18,6 +32,11 @@ program
|
|
|
18
32
|
.option('--paradigm <name>', 'Coding paradigm (oop, functional, minimal)')
|
|
19
33
|
.option('--dry-run', 'Show detected configuration without writing files')
|
|
20
34
|
.option('--explain', 'Show detection markers for roles and paradigms')
|
|
35
|
+
.addHelpText('after', `
|
|
36
|
+
Examples:
|
|
37
|
+
$ rigour init # Auto-discover role & paradigm
|
|
38
|
+
$ rigour init --preset api --explain # Force API role and show why
|
|
39
|
+
`)
|
|
21
40
|
.action(async (options) => {
|
|
22
41
|
await (0, init_js_1.initCommand)(process.cwd(), options);
|
|
23
42
|
});
|
|
@@ -26,12 +45,21 @@ program
|
|
|
26
45
|
.description('Run quality gate checks')
|
|
27
46
|
.option('--ci', 'CI mode (minimal output, non-zero exit on fail)')
|
|
28
47
|
.option('--json', 'Output report in JSON format')
|
|
48
|
+
.addHelpText('after', `
|
|
49
|
+
Examples:
|
|
50
|
+
$ rigour check # Run interactive check
|
|
51
|
+
$ rigour check --ci # Run in CI environment
|
|
52
|
+
`)
|
|
29
53
|
.action(async (options) => {
|
|
30
54
|
await (0, check_js_1.checkCommand)(process.cwd(), options);
|
|
31
55
|
});
|
|
32
56
|
program
|
|
33
57
|
.command('explain')
|
|
34
58
|
.description('Explain the last quality gate report with actionable bullets')
|
|
59
|
+
.addHelpText('after', `
|
|
60
|
+
Examples:
|
|
61
|
+
$ rigour explain # Get a human-readable violation summary
|
|
62
|
+
`)
|
|
35
63
|
.action(async () => {
|
|
36
64
|
await (0, explain_js_1.explainCommand)(process.cwd());
|
|
37
65
|
});
|
|
@@ -39,14 +67,29 @@ program
|
|
|
39
67
|
.command('run')
|
|
40
68
|
.description('Execute an agent command in a loop until quality gates pass')
|
|
41
69
|
.argument('[command...]', 'The agent command to run (e.g., cursor-agent ...)')
|
|
42
|
-
.option('-i, --iterations <number>', 'Maximum number of loop iterations (deprecated, use --max-cycles)', '3')
|
|
43
70
|
.option('-c, --max-cycles <number>', 'Maximum number of loop iterations', '3')
|
|
44
71
|
.option('--fail-fast', 'Abort loop immediately on first gate failure')
|
|
72
|
+
.addHelpText('after', `
|
|
73
|
+
Examples:
|
|
74
|
+
$ rigour run -- claude "fix issues" # Loop Claude until PASS
|
|
75
|
+
$ rigour run -c 5 -- cursor-agent # Run Cursor agent for up to 5 cycles
|
|
76
|
+
`)
|
|
45
77
|
.action(async (args, options) => {
|
|
46
|
-
const maxCycles = parseInt(options.maxCycles || options.iterations);
|
|
47
78
|
await (0, run_js_1.runLoop)(process.cwd(), args, {
|
|
48
|
-
iterations: maxCycles,
|
|
79
|
+
iterations: parseInt(options.maxCycles),
|
|
49
80
|
failFast: !!options.failFast
|
|
50
81
|
});
|
|
51
82
|
});
|
|
83
|
+
program
|
|
84
|
+
.command('guide')
|
|
85
|
+
.description('Show the interactive engineering guide')
|
|
86
|
+
.action(async () => {
|
|
87
|
+
await (0, guide_js_1.guideCommand)();
|
|
88
|
+
});
|
|
89
|
+
program
|
|
90
|
+
.command('setup')
|
|
91
|
+
.description('Show installation and global setup guidance')
|
|
92
|
+
.action(async () => {
|
|
93
|
+
await (0, setup_js_1.setupCommand)();
|
|
94
|
+
});
|
|
52
95
|
program.parse();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function guideCommand(): Promise<void>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.guideCommand = guideCommand;
|
|
7
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
8
|
+
async function guideCommand() {
|
|
9
|
+
console.log(chalk_1.default.bold.cyan('\n🛡️ Rigour Labs | The Engineering Guide\n'));
|
|
10
|
+
console.log(chalk_1.default.bold('Getting Started:'));
|
|
11
|
+
console.log(chalk_1.default.dim(' 1. Run ') + chalk_1.default.cyan('rigour init') + chalk_1.default.dim(' to detect your project role and apply standards.'));
|
|
12
|
+
console.log(chalk_1.default.dim(' 2. Run ') + chalk_1.default.cyan('rigour check') + chalk_1.default.dim(' to see existing violations.'));
|
|
13
|
+
console.log(chalk_1.default.dim(' 3. Run ') + chalk_1.default.cyan('rigour run -- <your-agent-command>') + chalk_1.default.dim(' to automate the fix loop.\n'));
|
|
14
|
+
console.log(chalk_1.default.bold('Key Concepts:'));
|
|
15
|
+
console.log(chalk_1.default.yellow(' • Fix Packet v2') + chalk_1.default.dim(': Structured diagnostics fed directly into AI agents.'));
|
|
16
|
+
console.log(chalk_1.default.yellow(' • Safety Rails') + chalk_1.default.dim(': Prevents "explosive" refactoring (max files changed).'));
|
|
17
|
+
console.log(chalk_1.default.yellow(' • Strategic Guardians') + chalk_1.default.dim(': Dependency and Architectural boundary enforcement.\n'));
|
|
18
|
+
console.log(chalk_1.default.bold('Workflow Integration:'));
|
|
19
|
+
console.log(chalk_1.default.green(' • Cursor') + chalk_1.default.dim(': Add the MCP server or use the ') + chalk_1.default.cyan('.cursor/rules/rigour.mdc') + chalk_1.default.dim(' handshake.'));
|
|
20
|
+
console.log(chalk_1.default.green(' • CI/CD') + chalk_1.default.dim(': Use ') + chalk_1.default.cyan('rigour check --ci') + chalk_1.default.dim(' to fail PRs that violate quality gates.\n'));
|
|
21
|
+
console.log(chalk_1.default.dim('For more detailed docs, visit: ') + chalk_1.default.underline('https://github.com/erashu212/rigour/docs\n'));
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function setupCommand(): Promise<void>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.setupCommand = setupCommand;
|
|
7
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
8
|
+
async function setupCommand() {
|
|
9
|
+
console.log(chalk_1.default.bold.cyan('\n🛠️ Rigour Labs | Setup & Installation\n'));
|
|
10
|
+
console.log(chalk_1.default.bold('1. Global Installation (Recommended)'));
|
|
11
|
+
console.log(chalk_1.default.dim(' To use Rigour anywhere in your terminal:'));
|
|
12
|
+
console.log(chalk_1.default.green(' $ npm install -g @rigour-labs/cli\n'));
|
|
13
|
+
console.log(chalk_1.default.bold('2. Project-Local installation'));
|
|
14
|
+
console.log(chalk_1.default.dim(' To keep Rigour versioned with your project:'));
|
|
15
|
+
console.log(chalk_1.default.green(' $ npm install --save-dev @rigour-labs/cli\n'));
|
|
16
|
+
console.log(chalk_1.default.bold('3. Standalone Binaries (Zero-Install)'));
|
|
17
|
+
console.log(chalk_1.default.dim(' If you do not want to use Node.js:'));
|
|
18
|
+
console.log(chalk_1.default.dim(' • macOS: ') + chalk_1.default.cyan('https://github.com/erashu212/rigour/releases/latest/download/rigour-macos'));
|
|
19
|
+
console.log(chalk_1.default.dim(' • Linux: ') + chalk_1.default.cyan('https://github.com/erashu212/rigour/releases/latest/download/rigour-linux'));
|
|
20
|
+
console.log(chalk_1.default.dim(' • Windows: ') + chalk_1.default.cyan('https://github.com/erashu212/rigour/releases/latest/download/rigour-windows.exe\n'));
|
|
21
|
+
console.log(chalk_1.default.bold('4. MCP Integration (for AI Agents)'));
|
|
22
|
+
console.log(chalk_1.default.dim(' To let Cursor or Claude use Rigour natively:'));
|
|
23
|
+
console.log(chalk_1.default.dim(' Path to MCP: ') + chalk_1.default.cyan('packages/rigour-mcp/dist/index.js'));
|
|
24
|
+
console.log(chalk_1.default.dim(' Add this to your Cursor/Claude settings.\n'));
|
|
25
|
+
console.log(chalk_1.default.bold('Update Guidance:'));
|
|
26
|
+
console.log(chalk_1.default.dim(' Keep Rigour sharp by updating regularly:'));
|
|
27
|
+
console.log(chalk_1.default.green(' $ npm install -g @rigour-labs/cli@latest\n'));
|
|
28
|
+
}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rigour-labs/cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"bin": {
|
|
5
5
|
"rigour": "dist/cli.js"
|
|
6
6
|
},
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
|
-
"url": "https://github.com/
|
|
9
|
+
"url": "https://github.com/rigour-labs/rigour"
|
|
10
10
|
},
|
|
11
11
|
"publishConfig": {
|
|
12
12
|
"access": "public",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"fs-extra": "^11.2.0",
|
|
21
21
|
"globby": "^14.0.1",
|
|
22
22
|
"yaml": "^2.8.2",
|
|
23
|
-
"@rigour-labs/core": "1.
|
|
23
|
+
"@rigour-labs/core": "1.5.0"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@types/fs-extra": "^11.0.4",
|
package/src/cli.ts
CHANGED
|
@@ -4,13 +4,24 @@ import { initCommand } from './commands/init.js';
|
|
|
4
4
|
import { checkCommand } from './commands/check.js';
|
|
5
5
|
import { explainCommand } from './commands/explain.js';
|
|
6
6
|
import { runLoop } from './commands/run.js';
|
|
7
|
+
import { guideCommand } from './commands/guide.js';
|
|
8
|
+
import { setupCommand } from './commands/setup.js';
|
|
9
|
+
import chalk from 'chalk';
|
|
7
10
|
|
|
8
11
|
const program = new Command();
|
|
9
12
|
|
|
10
13
|
program
|
|
11
14
|
.name('rigour')
|
|
12
|
-
.description('
|
|
13
|
-
.version('1.
|
|
15
|
+
.description('🛡️ Rigour: The Quality Gate Loop for AI-Assisted Engineering')
|
|
16
|
+
.version('1.3.0')
|
|
17
|
+
.addHelpText('before', chalk.bold.cyan(`
|
|
18
|
+
____ _
|
|
19
|
+
/ __ \\(_)____ ___ __ __ _____
|
|
20
|
+
/ /_/ // // __ \`/ / / / / // ___/
|
|
21
|
+
/ _, _// // /_/ // /_/ / / // /
|
|
22
|
+
/_/ |_|/_/ \\__, / \\__,_/_/ /_/
|
|
23
|
+
/____/
|
|
24
|
+
`));
|
|
14
25
|
|
|
15
26
|
program
|
|
16
27
|
.command('init')
|
|
@@ -19,6 +30,11 @@ program
|
|
|
19
30
|
.option('--paradigm <name>', 'Coding paradigm (oop, functional, minimal)')
|
|
20
31
|
.option('--dry-run', 'Show detected configuration without writing files')
|
|
21
32
|
.option('--explain', 'Show detection markers for roles and paradigms')
|
|
33
|
+
.addHelpText('after', `
|
|
34
|
+
Examples:
|
|
35
|
+
$ rigour init # Auto-discover role & paradigm
|
|
36
|
+
$ rigour init --preset api --explain # Force API role and show why
|
|
37
|
+
`)
|
|
22
38
|
.action(async (options: any) => {
|
|
23
39
|
await initCommand(process.cwd(), options);
|
|
24
40
|
});
|
|
@@ -28,6 +44,11 @@ program
|
|
|
28
44
|
.description('Run quality gate checks')
|
|
29
45
|
.option('--ci', 'CI mode (minimal output, non-zero exit on fail)')
|
|
30
46
|
.option('--json', 'Output report in JSON format')
|
|
47
|
+
.addHelpText('after', `
|
|
48
|
+
Examples:
|
|
49
|
+
$ rigour check # Run interactive check
|
|
50
|
+
$ rigour check --ci # Run in CI environment
|
|
51
|
+
`)
|
|
31
52
|
.action(async (options: any) => {
|
|
32
53
|
await checkCommand(process.cwd(), options);
|
|
33
54
|
});
|
|
@@ -35,6 +56,10 @@ program
|
|
|
35
56
|
program
|
|
36
57
|
.command('explain')
|
|
37
58
|
.description('Explain the last quality gate report with actionable bullets')
|
|
59
|
+
.addHelpText('after', `
|
|
60
|
+
Examples:
|
|
61
|
+
$ rigour explain # Get a human-readable violation summary
|
|
62
|
+
`)
|
|
38
63
|
.action(async () => {
|
|
39
64
|
await explainCommand(process.cwd());
|
|
40
65
|
});
|
|
@@ -43,15 +68,32 @@ program
|
|
|
43
68
|
.command('run')
|
|
44
69
|
.description('Execute an agent command in a loop until quality gates pass')
|
|
45
70
|
.argument('[command...]', 'The agent command to run (e.g., cursor-agent ...)')
|
|
46
|
-
.option('-i, --iterations <number>', 'Maximum number of loop iterations (deprecated, use --max-cycles)', '3')
|
|
47
71
|
.option('-c, --max-cycles <number>', 'Maximum number of loop iterations', '3')
|
|
48
72
|
.option('--fail-fast', 'Abort loop immediately on first gate failure')
|
|
73
|
+
.addHelpText('after', `
|
|
74
|
+
Examples:
|
|
75
|
+
$ rigour run -- claude "fix issues" # Loop Claude until PASS
|
|
76
|
+
$ rigour run -c 5 -- cursor-agent # Run Cursor agent for up to 5 cycles
|
|
77
|
+
`)
|
|
49
78
|
.action(async (args: string[], options: any) => {
|
|
50
|
-
const maxCycles = parseInt(options.maxCycles || options.iterations);
|
|
51
79
|
await runLoop(process.cwd(), args, {
|
|
52
|
-
iterations: maxCycles,
|
|
80
|
+
iterations: parseInt(options.maxCycles),
|
|
53
81
|
failFast: !!options.failFast
|
|
54
82
|
});
|
|
55
83
|
});
|
|
56
84
|
|
|
85
|
+
program
|
|
86
|
+
.command('guide')
|
|
87
|
+
.description('Show the interactive engineering guide')
|
|
88
|
+
.action(async () => {
|
|
89
|
+
await guideCommand();
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
program
|
|
93
|
+
.command('setup')
|
|
94
|
+
.description('Show installation and global setup guidance')
|
|
95
|
+
.action(async () => {
|
|
96
|
+
await setupCommand();
|
|
97
|
+
});
|
|
98
|
+
|
|
57
99
|
program.parse();
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
|
|
3
|
+
export async function guideCommand() {
|
|
4
|
+
console.log(chalk.bold.cyan('\n🛡️ Rigour Labs | The Engineering Guide\n'));
|
|
5
|
+
|
|
6
|
+
console.log(chalk.bold('Getting Started:'));
|
|
7
|
+
console.log(chalk.dim(' 1. Run ') + chalk.cyan('rigour init') + chalk.dim(' to detect your project role and apply standards.'));
|
|
8
|
+
console.log(chalk.dim(' 2. Run ') + chalk.cyan('rigour check') + chalk.dim(' to see existing violations.'));
|
|
9
|
+
console.log(chalk.dim(' 3. Run ') + chalk.cyan('rigour run -- <your-agent-command>') + chalk.dim(' to automate the fix loop.\n'));
|
|
10
|
+
|
|
11
|
+
console.log(chalk.bold('Key Concepts:'));
|
|
12
|
+
console.log(chalk.yellow(' • Fix Packet v2') + chalk.dim(': Structured diagnostics fed directly into AI agents.'));
|
|
13
|
+
console.log(chalk.yellow(' • Safety Rails') + chalk.dim(': Prevents "explosive" refactoring (max files changed).'));
|
|
14
|
+
console.log(chalk.yellow(' • Strategic Guardians') + chalk.dim(': Dependency and Architectural boundary enforcement.\n'));
|
|
15
|
+
|
|
16
|
+
console.log(chalk.bold('Workflow Integration:'));
|
|
17
|
+
console.log(chalk.green(' • Cursor') + chalk.dim(': Add the MCP server or use the ') + chalk.cyan('.cursor/rules/rigour.mdc') + chalk.dim(' handshake.'));
|
|
18
|
+
console.log(chalk.green(' • CI/CD') + chalk.dim(': Use ') + chalk.cyan('rigour check --ci') + chalk.dim(' to fail PRs that violate quality gates.\n'));
|
|
19
|
+
|
|
20
|
+
console.log(chalk.dim('For more detailed docs, visit: ') + chalk.underline('https://github.com/erashu212/rigour/docs\n'));
|
|
21
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
|
|
3
|
+
export async function setupCommand() {
|
|
4
|
+
console.log(chalk.bold.cyan('\n🛠️ Rigour Labs | Setup & Installation\n'));
|
|
5
|
+
|
|
6
|
+
console.log(chalk.bold('1. Global Installation (Recommended)'));
|
|
7
|
+
console.log(chalk.dim(' To use Rigour anywhere in your terminal:'));
|
|
8
|
+
console.log(chalk.green(' $ npm install -g @rigour-labs/cli\n'));
|
|
9
|
+
|
|
10
|
+
console.log(chalk.bold('2. Project-Local installation'));
|
|
11
|
+
console.log(chalk.dim(' To keep Rigour versioned with your project:'));
|
|
12
|
+
console.log(chalk.green(' $ npm install --save-dev @rigour-labs/cli\n'));
|
|
13
|
+
|
|
14
|
+
console.log(chalk.bold('3. Standalone Binaries (Zero-Install)'));
|
|
15
|
+
console.log(chalk.dim(' If you do not want to use Node.js:'));
|
|
16
|
+
console.log(chalk.dim(' • macOS: ') + chalk.cyan('https://github.com/erashu212/rigour/releases/latest/download/rigour-macos'));
|
|
17
|
+
console.log(chalk.dim(' • Linux: ') + chalk.cyan('https://github.com/erashu212/rigour/releases/latest/download/rigour-linux'));
|
|
18
|
+
console.log(chalk.dim(' • Windows: ') + chalk.cyan('https://github.com/erashu212/rigour/releases/latest/download/rigour-windows.exe\n'));
|
|
19
|
+
|
|
20
|
+
console.log(chalk.bold('4. MCP Integration (for AI Agents)'));
|
|
21
|
+
console.log(chalk.dim(' To let Cursor or Claude use Rigour natively:'));
|
|
22
|
+
console.log(chalk.dim(' Path to MCP: ') + chalk.cyan('packages/rigour-mcp/dist/index.js'));
|
|
23
|
+
console.log(chalk.dim(' Add this to your Cursor/Claude settings.\n'));
|
|
24
|
+
|
|
25
|
+
console.log(chalk.bold('Update Guidance:'));
|
|
26
|
+
console.log(chalk.dim(' Keep Rigour sharp by updating regularly:'));
|
|
27
|
+
console.log(chalk.green(' $ npm install -g @rigour-labs/cli@latest\n'));
|
|
28
|
+
}
|