aicm 0.14.2 → 0.14.4
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 +2 -0
- package/dist/cli.js +4 -1
- package/dist/commands/install.d.ts +5 -1
- package/dist/commands/install.js +21 -10
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -247,6 +247,7 @@ Options:
|
|
|
247
247
|
|
|
248
248
|
- `--ci`: run in CI environments (default: `false`)
|
|
249
249
|
- `--verbose`: show detailed output and stack traces for debugging
|
|
250
|
+
- `--dry-run`: simulate installation without writing files, useful for validating presets in CI
|
|
250
251
|
|
|
251
252
|
## Node.js API
|
|
252
253
|
|
|
@@ -290,6 +291,7 @@ Installs rules and MCP servers based on configuration.
|
|
|
290
291
|
- `config`: Custom config object to use instead of loading from file
|
|
291
292
|
- `installOnCI`: Run installation on CI environments (default: `false`)
|
|
292
293
|
- `verbose`: Show verbose output and stack traces for debugging (default: `false`)
|
|
294
|
+
- `dryRun`: Simulate installation without writing files, useful for preset validation in CI (default: `false`)
|
|
293
295
|
|
|
294
296
|
**Returns:**
|
|
295
297
|
|
package/dist/cli.js
CHANGED
|
@@ -19,6 +19,7 @@ async function runCli() {
|
|
|
19
19
|
"--version": Boolean,
|
|
20
20
|
"--ci": Boolean,
|
|
21
21
|
"--verbose": Boolean,
|
|
22
|
+
"--dry-run": Boolean,
|
|
22
23
|
"-h": "--help",
|
|
23
24
|
"-v": "--version",
|
|
24
25
|
}, {
|
|
@@ -42,7 +43,7 @@ async function runCli() {
|
|
|
42
43
|
(0, init_1.initCommand)();
|
|
43
44
|
break;
|
|
44
45
|
case "install":
|
|
45
|
-
await (0, install_1.installCommand)(args["--ci"], args["--verbose"]);
|
|
46
|
+
await (0, install_1.installCommand)(args["--ci"], args["--verbose"], args["--dry-run"]);
|
|
46
47
|
break;
|
|
47
48
|
case "list":
|
|
48
49
|
await (0, list_1.listCommand)();
|
|
@@ -74,10 +75,12 @@ ${chalk_1.default.bold("OPTIONS")}
|
|
|
74
75
|
-v, --version Show version number
|
|
75
76
|
--ci Run in CI environments (default: \`false\`)
|
|
76
77
|
--verbose Show detailed output and stack traces for debugging
|
|
78
|
+
--dry-run Simulate installation without writing files, useful for validating presets in CI
|
|
77
79
|
|
|
78
80
|
${chalk_1.default.bold("EXAMPLES")}
|
|
79
81
|
$ aicm init
|
|
80
82
|
$ aicm install
|
|
83
|
+
$ aicm install --dry-run
|
|
81
84
|
$ aicm list
|
|
82
85
|
`);
|
|
83
86
|
}
|
|
@@ -16,6 +16,10 @@ export interface InstallOptions {
|
|
|
16
16
|
* Show verbose output during installation
|
|
17
17
|
*/
|
|
18
18
|
verbose?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Perform a dry run without writing any files
|
|
21
|
+
*/
|
|
22
|
+
dryRun?: boolean;
|
|
19
23
|
}
|
|
20
24
|
/**
|
|
21
25
|
* Result of the install operation
|
|
@@ -49,4 +53,4 @@ export declare function install(options?: InstallOptions): Promise<InstallResult
|
|
|
49
53
|
/**
|
|
50
54
|
* CLI command wrapper for install
|
|
51
55
|
*/
|
|
52
|
-
export declare function installCommand(installOnCI?: boolean, verbose?: boolean): Promise<void>;
|
|
56
|
+
export declare function installCommand(installOnCI?: boolean, verbose?: boolean, dryRun?: boolean): Promise<void>;
|
package/dist/commands/install.js
CHANGED
|
@@ -323,11 +323,13 @@ async function installPackage(options = {}) {
|
|
|
323
323
|
}
|
|
324
324
|
}
|
|
325
325
|
try {
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
326
|
+
if (!options.dryRun) {
|
|
327
|
+
// Write rules to targets
|
|
328
|
+
writeRulesToTargets(rules, config.targets);
|
|
329
|
+
// Write MCP servers
|
|
330
|
+
if (mcpServers && Object.keys(mcpServers).length > 0) {
|
|
331
|
+
writeMcpServersToTargets(mcpServers, config.targets, cwd);
|
|
332
|
+
}
|
|
331
333
|
}
|
|
332
334
|
return {
|
|
333
335
|
success: true,
|
|
@@ -387,7 +389,7 @@ async function installWorkspacesPackages(packages, options = {}) {
|
|
|
387
389
|
/**
|
|
388
390
|
* Install rules across multiple packages in a workspace
|
|
389
391
|
*/
|
|
390
|
-
async function installWorkspaces(cwd, installOnCI, verbose = false) {
|
|
392
|
+
async function installWorkspaces(cwd, installOnCI, verbose = false, dryRun = false) {
|
|
391
393
|
return (0, working_directory_1.withWorkingDirectory)(cwd, async () => {
|
|
392
394
|
if (verbose) {
|
|
393
395
|
console.log(chalk_1.default.blue("🔍 Discovering packages..."));
|
|
@@ -420,6 +422,7 @@ async function installWorkspaces(cwd, installOnCI, verbose = false) {
|
|
|
420
422
|
const result = await installWorkspacesPackages(packages, {
|
|
421
423
|
installOnCI,
|
|
422
424
|
verbose,
|
|
425
|
+
dryRun,
|
|
423
426
|
});
|
|
424
427
|
if (verbose) {
|
|
425
428
|
result.packages.forEach((pkg) => {
|
|
@@ -482,7 +485,7 @@ async function install(options = {}) {
|
|
|
482
485
|
const shouldUseWorkspaces = (resolvedConfig === null || resolvedConfig === void 0 ? void 0 : resolvedConfig.config.workspaces) ||
|
|
483
486
|
(!resolvedConfig && (0, config_1.detectWorkspacesFromPackageJson)(cwd));
|
|
484
487
|
if (shouldUseWorkspaces) {
|
|
485
|
-
return await installWorkspaces(cwd, installOnCI, options.verbose);
|
|
488
|
+
return await installWorkspaces(cwd, installOnCI, options.verbose, options.dryRun);
|
|
486
489
|
}
|
|
487
490
|
return installPackage(options);
|
|
488
491
|
});
|
|
@@ -490,14 +493,22 @@ async function install(options = {}) {
|
|
|
490
493
|
/**
|
|
491
494
|
* CLI command wrapper for install
|
|
492
495
|
*/
|
|
493
|
-
async function installCommand(installOnCI, verbose) {
|
|
496
|
+
async function installCommand(installOnCI, verbose, dryRun) {
|
|
494
497
|
var _a;
|
|
495
|
-
const result = await install({ installOnCI, verbose });
|
|
498
|
+
const result = await install({ installOnCI, verbose, dryRun });
|
|
496
499
|
if (!result.success) {
|
|
497
500
|
throw (_a = result.error) !== null && _a !== void 0 ? _a : new Error("Installation failed with unknown error");
|
|
498
501
|
}
|
|
499
502
|
else {
|
|
500
|
-
if (
|
|
503
|
+
if (dryRun) {
|
|
504
|
+
if (result.packagesCount > 1) {
|
|
505
|
+
console.log(`Dry run: ${result.installedRuleCount} rules across ${result.packagesCount} packages validated`);
|
|
506
|
+
}
|
|
507
|
+
else {
|
|
508
|
+
console.log("Dry run: configuration validated");
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
else if (result.packagesCount > 1) {
|
|
501
512
|
console.log(`Successfully installed ${result.installedRuleCount} rules across ${result.packagesCount} packages`);
|
|
502
513
|
}
|
|
503
514
|
else {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aicm",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.4",
|
|
4
4
|
"description": "A TypeScript CLI tool for managing AI IDE rules across different projects and teams",
|
|
5
5
|
"main": "dist/api.js",
|
|
6
6
|
"types": "dist/api.d.ts",
|
|
@@ -56,13 +56,13 @@
|
|
|
56
56
|
"watch": "tsc --watch",
|
|
57
57
|
"start": "node dist/bin/aicm.js",
|
|
58
58
|
"dev": "ts-node src/bin/aicm.ts",
|
|
59
|
-
"test": "jest",
|
|
59
|
+
"test": "pnpm build && jest",
|
|
60
60
|
"test:watch": "jest --watch",
|
|
61
61
|
"test:all": "npm run build && npm run test",
|
|
62
62
|
"format": "prettier --write .",
|
|
63
63
|
"format:check": "prettier --check .",
|
|
64
64
|
"lint": "eslint",
|
|
65
65
|
"version": "auto-changelog -p && git add CHANGELOG.md",
|
|
66
|
-
"release": "np
|
|
66
|
+
"release": "np"
|
|
67
67
|
}
|
|
68
68
|
}
|