build: color-code open output

This commit is contained in:
2026-03-21 00:22:31 +05:30
parent c642148cac
commit 17bb1130c8
3 changed files with 23 additions and 11 deletions
+19 -11
View File
@@ -1,4 +1,5 @@
import * as fs from "node:fs";
import chalk from 'chalk';
import type { MultiModelOptions, MultiModelResult } from "../types";
import {
runCommand,
@@ -201,13 +202,17 @@ export async function openMultiModel(options: MultiModelOptions): Promise<MultiM
sessionName,
windows: windowNames,
instructions: [
`Error: Created tmux session '${sessionName}', but some model launches failed.`,
`Succeeded: ${succeededModels.length > 0 ? succeededModels.join(", ") : "none"}.`,
`Failed: ${failedModels.join(", ")}.`,
`Attach with \`${attachCommand}\` to inspect the session.`,
`Cleanup when done using either:`,
`1. ${primaryCleanup}`,
`2. Or run manually: \`${cleanupCommand}\``,
chalk.red(`Error: Created tmux session '${sessionName}', but some model launches failed.`),
chalk.red(`Failed: ${failedModels.join(", ")}.`),
chalk.dim(`Succeeded: ${succeededModels.length > 0 ? succeededModels.join(", ") : "none"}.`),
"",
chalk.bold(`Attach with \`${attachCommand}\` to inspect the session.`),
"",
chalk.dim(`When finished, clean up using:`),
primaryCleanup,
"",
chalk.dim(`Alternate manual cleanup - `),
chalk.dim(cleanupCommand)
].join("\n"),
};
}
@@ -217,10 +222,13 @@ export async function openMultiModel(options: MultiModelOptions): Promise<MultiM
sessionName,
windows: windowNames,
instructions: [
`Use \`${attachCommand}\` to join session.`,
`When finished, clean up using either:`,
`1. ${primaryCleanup}`,
`2. Or run manually: \`${cleanupCommand}\``,
chalk.bold(`Use \`${attachCommand}\` to join session.`),
"",
chalk.dim(`When finished, clean up using:`),
primaryCleanup,
"",
chalk.dim(`Alternate manual cleanup - `),
chalk.dim(cleanupCommand)
].join("\n"),
};
}