@docker-doctor/cli 0.3.0 → 0.3.1

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 CHANGED
@@ -28,13 +28,18 @@ Works with any project that uses Docker.
28
28
  npx @docker-doctor/cli@latest
29
29
  ```
30
30
 
31
- ### 2. Browse rules
31
+ ### 2. Install for agents
32
+
33
+ Once you have an audit, install the skill so your coding agent learns the `/docker-doctor` triage workflow and can fix the issues for you:
32
34
 
33
35
  ```bash
34
- npx @docker-doctor/cli@latest rules list
35
- npx @docker-doctor/cli@latest rules explain docker-doctor/no-root-user
36
+ npx @docker-doctor/cli@latest install
36
37
  ```
37
38
 
39
+ Works with Claude Code, Cursor, Codex, OpenCode, and many more. After an interactive scan finds issues, Docker Doctor also offers to hand them straight to an agent detected on your machine.
40
+
41
+ [Rules reference →](https://docker-doctor.vercel.app/docs/reference/rules)
42
+
38
43
  ### 3. Run in CI
39
44
 
40
45
  Docker Doctor walks you through setting up a GitHub Actions workflow after your first scan:
@@ -45,15 +50,19 @@ npx @docker-doctor/cli@latest
45
50
 
46
51
  ### 4. Configure
47
52
 
48
- ```js
53
+ ```ts
49
54
  // docker-doctor.config.ts
55
+ import type { DockerDoctorConfig } from "@docker-doctor/cli";
56
+
50
57
  export default {
51
58
  rules: {
52
59
  "docker-doctor/no-root-user": "error",
53
60
  },
54
- };
61
+ } satisfies DockerDoctorConfig;
55
62
  ```
56
63
 
64
+ Prefer YAML? `docker-doctor.config.yaml` works too, with editor autocomplete via `# yaml-language-server: $schema=https://docker-doctor.vercel.app/schema.json`. A `defineConfig` helper is also exported for projects with `@docker-doctor/cli` installed — see the [configuration docs](https://docker-doctor.vercel.app/docs/reference/configuration).
65
+
57
66
  ## How the score works
58
67
 
59
68
  Every scan produces a 0-100 health score alongside a label (`Excellent 🏆`, `Good ✅`, `Needs Work ⚠️`, `Critical 🚨`).
package/dist/cli.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- const require_src = require('./src-TEhFWhpk.cjs');
2
+ const require_src = require('./src-38C8Tk2b.cjs');
3
3
  let node_fs_promises = require("node:fs/promises");
4
4
  node_fs_promises = require_src.__toESM(node_fs_promises, 1);
5
5
  let node_path = require("node:path");
@@ -9,11 +9,15 @@ node_os = require_src.__toESM(node_os, 1);
9
9
  let node_readline = require("node:readline");
10
10
  node_readline = require_src.__toESM(node_readline, 1);
11
11
  let node_timers_promises = require("node:timers/promises");
12
+ let agent_install = require("agent-install");
12
13
  let node_process = require("node:process");
13
14
  node_process = require_src.__toESM(node_process, 1);
14
15
  let node_tty = require("node:tty");
15
16
  node_tty = require_src.__toESM(node_tty, 1);
16
17
  let commander = require("commander");
18
+ let node_child_process = require("node:child_process");
19
+ let node_fs = require("node:fs");
20
+ node_fs = require_src.__toESM(node_fs, 1);
17
21
 
18
22
  //#region ../../node_modules/.bun/chalk@5.6.2/node_modules/chalk/source/vendor/ansi-styles/index.js
19
23
  const ANSI_BACKGROUND_OFFSET = 10;
@@ -420,6 +424,234 @@ Object.defineProperties(createChalk.prototype, styles);
420
424
  const chalk = createChalk();
421
425
  const chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
422
426
 
427
+ //#endregion
428
+ //#region src/agents/clipboard.ts
429
+ const getClipboardCommands = () => {
430
+ if (process.platform === "darwin") return [{
431
+ args: [],
432
+ command: "pbcopy"
433
+ }];
434
+ if (process.platform === "win32") return [{
435
+ args: [],
436
+ command: "clip"
437
+ }];
438
+ return [
439
+ {
440
+ args: [],
441
+ command: "wl-copy"
442
+ },
443
+ {
444
+ args: ["-selection", "clipboard"],
445
+ command: "xclip"
446
+ },
447
+ {
448
+ args: ["--clipboard", "--input"],
449
+ command: "xsel"
450
+ }
451
+ ];
452
+ };
453
+ const tryCopy = ({ command, args }, text) => new Promise((resolve) => {
454
+ const child = (0, node_child_process.spawn)(command, args, { stdio: [
455
+ "pipe",
456
+ "ignore",
457
+ "ignore"
458
+ ] });
459
+ child.once("error", () => {
460
+ resolve(false);
461
+ });
462
+ child.once("exit", (code) => {
463
+ resolve(code === 0);
464
+ });
465
+ child.stdin.end(text);
466
+ });
467
+ const tryCommands = async (commands, text) => {
468
+ const [first, ...rest] = commands;
469
+ if (!first) return false;
470
+ if (await tryCopy(first, text)) return true;
471
+ return tryCommands(rest, text);
472
+ };
473
+ const copyToClipboard = (text) => tryCommands(getClipboardCommands(), text);
474
+
475
+ //#endregion
476
+ //#region src/agents/diagnostics-dir.ts
477
+ const DIAGNOSTICS_DIR_NAME = ".docker-doctor";
478
+ const UNSAFE_FILE_CHARS = /[^a-z0-9-]+/giu;
479
+ const ruleFileName = (rule) => {
480
+ return `${(rule.split("/").at(-1) ?? rule).replace(UNSAFE_FILE_CHARS, "-")}.txt`;
481
+ };
482
+ const groupDiagnosticsByRule = (diagnostics) => {
483
+ const groups = /* @__PURE__ */ new Map();
484
+ for (const diagnostic of diagnostics) {
485
+ const group = groups.get(diagnostic.rule);
486
+ if (group) group.push(diagnostic);
487
+ else groups.set(diagnostic.rule, [diagnostic]);
488
+ }
489
+ return groups;
490
+ };
491
+ const writeDiagnosticsDirectory = async (diagnostics, report, rootDir) => {
492
+ const dir = node_path.default.join(rootDir, DIAGNOSTICS_DIR_NAME);
493
+ await node_fs_promises.default.rm(dir, {
494
+ force: true,
495
+ recursive: true
496
+ });
497
+ await node_fs_promises.default.mkdir(dir, { recursive: true });
498
+ await node_fs_promises.default.writeFile(node_path.default.join(dir, "diagnostics.json"), JSON.stringify(report, null, 2), "utf-8");
499
+ const writes = [];
500
+ for (const [rule, ruleDiagnostics] of groupDiagnosticsByRule(diagnostics)) {
501
+ const [first] = ruleDiagnostics;
502
+ const lines = [
503
+ `${rule} (${first.severity})`,
504
+ first.message,
505
+ `Fix: ${first.help}`,
506
+ "",
507
+ ...ruleDiagnostics.map((d) => `${d.file}${d.line === void 0 ? "" : `:${d.line}`}`),
508
+ ""
509
+ ];
510
+ writes.push(node_fs_promises.default.writeFile(node_path.default.join(dir, ruleFileName(rule)), lines.join("\n"), "utf-8"));
511
+ }
512
+ await Promise.all(writes);
513
+ };
514
+ const ensureGitignoreEntry = async (rootDir) => {
515
+ const gitignorePath = node_path.default.join(rootDir, ".gitignore");
516
+ let existing = null;
517
+ try {
518
+ existing = await node_fs_promises.default.readFile(gitignorePath, "utf-8");
519
+ } catch {
520
+ existing = null;
521
+ }
522
+ if (existing !== null) {
523
+ if (existing.split(/\r?\n/u).some((line) => [
524
+ ".docker-doctor",
525
+ `${".docker-doctor"}/`,
526
+ `/${".docker-doctor"}`,
527
+ `/${".docker-doctor"}/`
528
+ ].includes(line.trim()))) return;
529
+ const separator = existing.endsWith("\n") || existing === "" ? "" : "\n";
530
+ await node_fs_promises.default.writeFile(gitignorePath, `${existing}${separator}${DIAGNOSTICS_DIR_NAME}/\n`, "utf-8");
531
+ return;
532
+ }
533
+ try {
534
+ await node_fs_promises.default.access(node_path.default.join(rootDir, ".git"));
535
+ } catch {
536
+ return;
537
+ }
538
+ await node_fs_promises.default.writeFile(gitignorePath, `${DIAGNOSTICS_DIR_NAME}/\n`, "utf-8");
539
+ };
540
+
541
+ //#endregion
542
+ //#region src/agents/handoff-payload.ts
543
+ const MAX_FILES_PER_RULE = 5;
544
+ const SEVERITY_RANK = {
545
+ error: 0,
546
+ info: 2,
547
+ warning: 1
548
+ };
549
+ const SEVERITY_LABEL = {
550
+ error: "ERROR",
551
+ info: "INFO",
552
+ warning: "WARN"
553
+ };
554
+ const buildHandoffPayload = (input) => {
555
+ const groups = [...groupDiagnosticsByRule(input.diagnostics).entries()].toSorted(([, a], [, b]) => {
556
+ const rankDelta = SEVERITY_RANK[a[0].severity] - SEVERITY_RANK[b[0].severity];
557
+ return rankDelta === 0 ? b.length - a.length : rankDelta;
558
+ });
559
+ const issueWord = groups.length === 1 ? "issue" : "issues";
560
+ const lines = [`Fix the ${groups.length} Docker Doctor ${issueWord} in ${input.projectName}.`, ""];
561
+ for (const [index, [rule, ruleDiagnostics]] of groups.entries()) {
562
+ const [first] = ruleDiagnostics;
563
+ const category = require_src.findRule(rule)?.category ?? "General";
564
+ const countBadge = ruleDiagnostics.length > 1 ? ` (×${ruleDiagnostics.length})` : "";
565
+ lines.push(`${index + 1}. ${SEVERITY_LABEL[first.severity]} ${category}: ${first.message} [${rule}]${countBadge}`, ` Fix: ${first.help}`);
566
+ const files = [...new Set(ruleDiagnostics.map((d) => d.file))];
567
+ for (const file of files.slice(0, MAX_FILES_PER_RULE)) {
568
+ const firstSite = ruleDiagnostics.find((d) => d.file === file && d.line !== void 0);
569
+ lines.push(` - ${file}${firstSite ? `:${firstSite.line}` : ""}`);
570
+ }
571
+ const remaining = files.length - MAX_FILES_PER_RULE;
572
+ if (remaining > 0) lines.push(` - +${remaining} more files`);
573
+ }
574
+ lines.push("", `Full report (diagnostics.json + a .txt per rule): ${DIAGNOSTICS_DIR_NAME}/`, "", "Read each file and fix the root cause — don't suppress or silence the rule.", "When you're done, re-run `npx @docker-doctor/cli@latest .` and confirm the score improved and no errors remain.");
575
+ return lines.join("\n");
576
+ };
577
+
578
+ //#endregion
579
+ //#region src/agents/is-command-available.ts
580
+ const WINDOWS_EXTENSIONS = [
581
+ ".exe",
582
+ ".cmd",
583
+ ".bat"
584
+ ];
585
+ const isCommandAvailable = (command) => {
586
+ const pathValue = process.env.PATH ?? "";
587
+ const extensions = process.platform === "win32" ? WINDOWS_EXTENSIONS : [""];
588
+ for (const dir of pathValue.split(node_path.default.delimiter)) {
589
+ if (dir === "") continue;
590
+ for (const extension of extensions) try {
591
+ node_fs.default.accessSync(node_path.default.join(dir, command + extension), node_fs.default.constants.X_OK);
592
+ return true;
593
+ } catch {}
594
+ }
595
+ return false;
596
+ };
597
+
598
+ //#endregion
599
+ //#region src/agents/launchable-agents.ts
600
+ const LAUNCHABLE_AGENT_IDS = [
601
+ "claude-code",
602
+ "codex",
603
+ "cursor"
604
+ ];
605
+ const AGENT_BINARIES = {
606
+ "claude-code": "claude",
607
+ codex: "codex",
608
+ cursor: "cursor-agent"
609
+ };
610
+ const AGENT_AUTO_FLAGS = {
611
+ "claude-code": ["--dangerously-skip-permissions"],
612
+ codex: ["--yolo"],
613
+ cursor: ["--force"]
614
+ };
615
+ const detectLaunchableAgents = () => {
616
+ if (process.platform === "win32") return [];
617
+ return LAUNCHABLE_AGENT_IDS.filter((agentId) => isCommandAvailable(AGENT_BINARIES[agentId]));
618
+ };
619
+
620
+ //#endregion
621
+ //#region src/agents/launch-agent.ts
622
+ const launchAgent = (agentId, prompt) => new Promise((resolve) => {
623
+ const child = (0, node_child_process.spawn)(AGENT_BINARIES[agentId], [...AGENT_AUTO_FLAGS[agentId], prompt], { stdio: "inherit" });
624
+ child.once("error", () => {
625
+ resolve(false);
626
+ });
627
+ child.once("exit", () => {
628
+ resolve(true);
629
+ });
630
+ });
631
+
632
+ //#endregion
633
+ //#region src/agents/skill-install.ts
634
+ const moduleDir = __dirname;
635
+ const getSkillSourceDirectory = () => {
636
+ const candidates = [node_path.default.resolve(moduleDir, "../skill/docker-doctor"), node_path.default.resolve(moduleDir, "../../../../skills/docker-doctor")];
637
+ for (const candidate of candidates) if (node_fs.default.existsSync(node_path.default.join(candidate, agent_install.SKILL_MANIFEST_FILE))) return candidate;
638
+ return null;
639
+ };
640
+ const installSkillForAgents = async (agents, projectRoot) => {
641
+ const source = getSkillSourceDirectory();
642
+ if (!source) return null;
643
+ try {
644
+ return await (0, agent_install.installSkillsFromSource)({
645
+ agents,
646
+ cwd: projectRoot,
647
+ mode: "copy",
648
+ source
649
+ });
650
+ } catch {
651
+ return null;
652
+ }
653
+ };
654
+
423
655
  //#endregion
424
656
  //#region src/formatters/terminal.ts
425
657
  const printCodeFrame = (content, line, severityColor) => {
@@ -696,7 +928,104 @@ const askSelect = (question, options, defaultIndex = 0) => {
696
928
  process.stdin.on("keypress", handleKeypress);
697
929
  });
698
930
  };
699
- const runInteractiveWizard = async () => {
931
+ const askMultiSelect = (question, options) => {
932
+ if (!process.stdin.isTTY) return Promise.resolve(options.flatMap((option, i) => option.selected ? [i] : []));
933
+ return new Promise((resolve) => {
934
+ let index = 0;
935
+ const selected = options.map((option) => option.selected);
936
+ const lineCount = options.length + 2;
937
+ node_readline.default.emitKeypressEvents(process.stdin);
938
+ process.stdin.setRawMode(true);
939
+ process.stdin.resume();
940
+ process.stdout.write("\x1B[?25l");
941
+ const render = (firstTime = false) => {
942
+ if (!firstTime) process.stdout.write(`\u001B[${lineCount}A\r`);
943
+ process.stdout.write(`\r\u001B[K ${chalk.green("✔")} ${chalk.bold(question)}\n`);
944
+ let i = 0;
945
+ for (const option of options) {
946
+ const isCursor = i === index;
947
+ const cursor = isCursor ? chalk.cyan("❯ ") : " ";
948
+ const box = selected[i] ? chalk.cyan("[x]") : chalk.dim("[ ]");
949
+ let text = chalk.dim(option.label);
950
+ if (isCursor) text = chalk.cyan.bold(option.label);
951
+ else if (selected[i]) text = option.label;
952
+ process.stdout.write(`\r\u001B[K${cursor}${box} ${text}\n`);
953
+ i += 1;
954
+ }
955
+ process.stdout.write(`\r\u001B[K ${chalk.dim("space to toggle · enter to confirm")}\n`);
956
+ };
957
+ render(true);
958
+ const handleKeypress = (str, key) => {
959
+ const cleanup = () => {
960
+ process.stdin.removeListener("keypress", handleKeypress);
961
+ if (process.stdin.isTTY) process.stdin.setRawMode(false);
962
+ process.stdin.pause();
963
+ process.stdout.write("\x1B[?25h");
964
+ };
965
+ if (key.name === "up" || key.name === "k") {
966
+ index = (index - 1 + options.length) % options.length;
967
+ render();
968
+ } else if (key.name === "down" || key.name === "j") {
969
+ index = (index + 1) % options.length;
970
+ render();
971
+ } else if (key.name === "space" || str === " ") {
972
+ selected[index] = !selected[index];
973
+ render();
974
+ } else if (key.name === "return" || key.name === "enter" || str === "\r" || str === "\n") {
975
+ cleanup();
976
+ const chosen = options.flatMap((option, i) => selected[i] ? [option.label] : []);
977
+ process.stdout.write(`\u001B[${lineCount}A\r\u001B[K`);
978
+ process.stdout.write(` ${chalk.green("✔")} ${chalk.bold(question)} › ${chosen.length > 0 ? chalk.cyan(chosen.join(", ")) : chalk.dim("none")}\n`);
979
+ for (let i = 0; i < lineCount - 1; i += 1) process.stdout.write("\r\x1B[K\n");
980
+ process.stdout.write(`\u001B[${lineCount - 1}A`);
981
+ resolve(options.flatMap((_, i) => selected[i] ? [i] : []));
982
+ } else if (key.ctrl && key.name === "c") {
983
+ cleanup();
984
+ process.stdout.write("\n");
985
+ process.exit(130);
986
+ }
987
+ };
988
+ process.stdin.on("keypress", handleKeypress);
989
+ });
990
+ };
991
+ const printAgentPrompt = (payload) => {
992
+ console.log(`\n${chalk.dim("──── Agent prompt ────")}`);
993
+ console.log(payload);
994
+ console.log(chalk.dim("──────────────────────"));
995
+ };
996
+ const agentDisplayName = (agent) => agent === "universal" ? "Universal" : (0, agent_install.getSkillAgentConfig)(agent).displayName;
997
+ const runAgentHandoff = async (context) => {
998
+ const launchable = detectLaunchableAgents();
999
+ const options = [
1000
+ ...launchable.map((agentId) => agentDisplayName(agentId)),
1001
+ "Copy prompt to clipboard",
1002
+ "Skip"
1003
+ ];
1004
+ const skipIndex = options.length - 1;
1005
+ const clipboardIndex = options.length - 2;
1006
+ const choice = await askSelect("What would you like to do next?", options);
1007
+ if (choice === skipIndex) return;
1008
+ await writeDiagnosticsDirectory(context.diagnostics, context.report, context.rootDir);
1009
+ await ensureGitignoreEntry(context.rootDir);
1010
+ const payload = buildHandoffPayload({
1011
+ diagnostics: context.diagnostics,
1012
+ projectName: node_path.default.basename(context.rootDir)
1013
+ });
1014
+ if (choice === clipboardIndex) {
1015
+ if (await copyToClipboard(payload)) console.log(`\n ${chalk.green("✔")} Prompt copied — paste it into any agent or chat.`);
1016
+ else printAgentPrompt(payload);
1017
+ return;
1018
+ }
1019
+ const agentId = launchable[choice];
1020
+ const installResult = await installSkillForAgents([agentId], context.rootDir);
1021
+ if (installResult && installResult.installed.length > 0) console.log(`\n ${chalk.green("✔")} Installed the docker-doctor skill for ${agentDisplayName(agentId)}`);
1022
+ console.log(`\n Handing off to ${agentDisplayName(agentId)}...\n`);
1023
+ if (!await launchAgent(agentId, payload)) {
1024
+ console.log(` ${chalk.yellow("⚠")} Couldn't launch ${AGENT_BINARIES[agentId]}. Here's the prompt instead:`);
1025
+ printAgentPrompt(payload);
1026
+ }
1027
+ };
1028
+ const runInteractiveWizard = async (context) => {
700
1029
  try {
701
1030
  if (await askConfirm("Add Docker Doctor to GitHub Actions?")) {
702
1031
  const workflowDir = node_path.default.resolve(".github/workflows");
@@ -723,10 +1052,8 @@ jobs:
723
1052
  console.log(`\n ${chalk.green("✨")} Created ${chalk.cyan(".github/workflows/docker-doctor.yml")}!`);
724
1053
  console.log(` Scan every pull request to prevent new Docker issues while you fix the backlog.`);
725
1054
  }
726
- if (await askSelect("What would you like to do next?", ["View rules list", "Skip"]) === 0) {
727
- console.log(`\n ${chalk.bold("Available Rules:")}`);
728
- for (const r of require_src.allRules) console.log(` - ${chalk.cyan(r.key)}: ${r.message} (${chalk.dim(r.category)})`);
729
- }
1055
+ if (context.diagnostics.length === 0) return;
1056
+ await runAgentHandoff(context);
730
1057
  } catch {}
731
1058
  };
732
1059
  const runRulesEngine = async (rootDir, project, rulesConfig, projectFilesList, fileContents, options, setStatus) => {
@@ -859,7 +1186,11 @@ program.argument("[dir]", "directory to scan", ".").option("-v, --verbose", "sho
859
1186
  }
860
1187
  await formatTerminal(filteredDiagnostics, score, label, project, options.verbose, fileContents);
861
1188
  const hasErrors = filteredDiagnostics.some((d) => d.severity === "error");
862
- if (process.stdout.isTTY && process.stdin.isTTY) await runInteractiveWizard();
1189
+ if (process.stdout.isTTY && process.stdin.isTTY) await runInteractiveWizard({
1190
+ diagnostics: filteredDiagnostics,
1191
+ report: require_src.toJsonReport(filteredDiagnostics, score, label, project),
1192
+ rootDir
1193
+ });
863
1194
  process.exitCode = hasErrors ? 1 : 0;
864
1195
  } finally {
865
1196
  if (spinnerInterval !== null) {
@@ -873,6 +1204,55 @@ program.argument("[dir]", "directory to scan", ".").option("-v, --verbose", "sho
873
1204
  process.exit(1);
874
1205
  }
875
1206
  });
1207
+ const CURATED_INSTALL_AGENTS = [
1208
+ "claude-code",
1209
+ "codex",
1210
+ "cursor",
1211
+ "opencode"
1212
+ ];
1213
+ const resolveInstallAgents = async (requested) => {
1214
+ if (requested && requested.length > 0) {
1215
+ const invalid = requested.filter((agent) => !(0, agent_install.isSkillAgentType)(agent));
1216
+ if (invalid.length > 0) {
1217
+ console.error(`Unknown agent id(s): ${invalid.join(", ")}`);
1218
+ console.error(`Valid ids: ${(0, agent_install.getSkillAgentTypes)().filter((agent) => agent !== "universal").join(", ")}`);
1219
+ return null;
1220
+ }
1221
+ return requested.filter((agent) => (0, agent_install.isSkillAgentType)(agent));
1222
+ }
1223
+ if (!(process.stdin.isTTY && process.stdout.isTTY)) {
1224
+ console.error("Non-interactive run: pass --agent <id...> (e.g. --agent claude-code cursor).");
1225
+ return null;
1226
+ }
1227
+ const detected = (await (0, agent_install.detectInstalledSkillAgents)()).filter((agent) => agent !== "universal");
1228
+ const choices = [.../* @__PURE__ */ new Set([...detected, ...CURATED_INSTALL_AGENTS])];
1229
+ const detectedSet = new Set(detected);
1230
+ return (await askMultiSelect("Which coding agents should get the docker-doctor skill?", choices.map((agent) => ({
1231
+ label: agentDisplayName(agent),
1232
+ selected: detectedSet.has(agent)
1233
+ })))).map((i) => choices[i]);
1234
+ };
1235
+ program.command("install").description("install the Docker Doctor agent skill for your coding agents").option("-a, --agent <agents...>", "agent id(s) to install for (e.g. claude-code codex cursor)").action(async (options) => {
1236
+ if (!getSkillSourceDirectory()) {
1237
+ console.error("Bundled skill not found — this looks like a broken installation.");
1238
+ process.exit(1);
1239
+ }
1240
+ const agents = await resolveInstallAgents(options.agent);
1241
+ if (agents === null) process.exit(1);
1242
+ if (agents.length === 0) {
1243
+ console.log("Nothing selected — skipped.");
1244
+ return;
1245
+ }
1246
+ const result = await installSkillForAgents(agents, process.cwd());
1247
+ if (!result) {
1248
+ console.error("Failed to install the skill.");
1249
+ process.exit(1);
1250
+ }
1251
+ for (const installed of result.installed) console.log(` ${chalk.green("✔")} ${agentDisplayName(installed.agent)} → ${installed.path}`);
1252
+ for (const failed of result.failed) console.log(` ${chalk.red("✖")} ${agentDisplayName(failed.agent)}: ${failed.error}`);
1253
+ if (result.installed.length > 0) console.log(`\n The agent can now run ${chalk.cyan("/docker-doctor")} to scan and triage this project.`);
1254
+ process.exitCode = result.failed.length > 0 ? 1 : 0;
1255
+ });
876
1256
  const rules = program.command("rules").description("manage and list configuration rules");
877
1257
  rules.command("list").description("list all available rules").action(() => {
878
1258
  console.log("\nAvailable Rules:");