@rigour-labs/cli 4.0.3 ā 4.0.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.
package/dist/cli.js
CHANGED
|
@@ -14,8 +14,9 @@ import { demoCommand } from './commands/demo.js';
|
|
|
14
14
|
import { hooksInitCommand } from './commands/hooks.js';
|
|
15
15
|
import { settingsShowCommand, settingsSetKeyCommand, settingsRemoveKeyCommand, settingsSetCommand, settingsGetCommand, settingsResetCommand, settingsPathCommand } from './commands/settings.js';
|
|
16
16
|
import { checkForUpdates } from './utils/version.js';
|
|
17
|
+
import { getCliVersion } from './utils/cli-version.js';
|
|
17
18
|
import chalk from 'chalk';
|
|
18
|
-
const CLI_VERSION =
|
|
19
|
+
const CLI_VERSION = getCliVersion();
|
|
19
20
|
const program = new Command();
|
|
20
21
|
program.addCommand(indexCommand);
|
|
21
22
|
program.addCommand(studioCommand);
|
|
@@ -13,7 +13,8 @@ import path from 'path';
|
|
|
13
13
|
import chalk from 'chalk';
|
|
14
14
|
import yaml from 'yaml';
|
|
15
15
|
import { getScoreHistory, getScoreTrend } from '@rigour-labs/core';
|
|
16
|
-
|
|
16
|
+
import { getCliVersion } from '../utils/cli-version.js';
|
|
17
|
+
const CLI_VERSION = getCliVersion();
|
|
17
18
|
export async function exportAuditCommand(cwd, options = {}) {
|
|
18
19
|
const format = options.format || 'json';
|
|
19
20
|
const configPath = path.join(cwd, 'rigour.yml');
|
package/dist/commands/setup.js
CHANGED
|
@@ -2,6 +2,7 @@ import chalk from 'chalk';
|
|
|
2
2
|
import path from 'path';
|
|
3
3
|
import fs from 'fs-extra';
|
|
4
4
|
import { loadSettings, getSettingsPath, isModelCached, getModelsDir } from '@rigour-labs/core';
|
|
5
|
+
import { getCliVersion } from '../utils/cli-version.js';
|
|
5
6
|
export async function setupCommand() {
|
|
6
7
|
console.log(chalk.bold.cyan('\nš ļø Rigour Labs | Setup & System Check\n'));
|
|
7
8
|
// āā Section 1: Installation Status āā
|
|
@@ -98,16 +99,3 @@ export async function setupCommand() {
|
|
|
98
99
|
console.log(chalk.dim(' MCP: ') + chalk.cyan('packages/rigour-mcp/dist/index.js'));
|
|
99
100
|
console.log('');
|
|
100
101
|
}
|
|
101
|
-
function getCliVersion() {
|
|
102
|
-
try {
|
|
103
|
-
const pkgPath = path.resolve(new URL(import.meta.url).pathname, '../../../package.json');
|
|
104
|
-
if (fs.existsSync(pkgPath)) {
|
|
105
|
-
const pkg = fs.readJsonSync(pkgPath);
|
|
106
|
-
return pkg.version || null;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
catch {
|
|
110
|
-
// fallback
|
|
111
|
-
}
|
|
112
|
-
return '2.0.0';
|
|
113
|
-
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
/**
|
|
4
|
+
* Resolve CLI version from local package.json at runtime.
|
|
5
|
+
* Works for source and built dist paths.
|
|
6
|
+
*/
|
|
7
|
+
export function getCliVersion(fallback = '0.0.0') {
|
|
8
|
+
try {
|
|
9
|
+
const pkgPath = path.resolve(path.dirname(new URL(import.meta.url).pathname), '../../package.json');
|
|
10
|
+
if (fs.existsSync(pkgPath)) {
|
|
11
|
+
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf-8'));
|
|
12
|
+
if (pkg.version && pkg.version.trim().length > 0) {
|
|
13
|
+
return pkg.version;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
catch {
|
|
18
|
+
// Fall through to fallback.
|
|
19
|
+
}
|
|
20
|
+
return fallback;
|
|
21
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rigour-labs/cli",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.5",
|
|
4
4
|
"description": "CLI quality gates for AI-generated code. Forces AI agents (Claude, Cursor, Copilot) to meet strict engineering standards with PASS/FAIL enforcement.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://rigour.run",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"inquirer": "9.2.16",
|
|
45
45
|
"ora": "^8.0.1",
|
|
46
46
|
"yaml": "^2.8.2",
|
|
47
|
-
"@rigour-labs/core": "4.0.
|
|
47
|
+
"@rigour-labs/core": "4.0.5"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@types/fs-extra": "^11.0.4",
|