Skip to content

Write HTML. Render video. Built for agents.

fix(cli): improve whisper-cpp install guidance and add doctor check (#1681)

Miguel Ángel344618e22aaf
diff --git a/packages/cli/src/commands/doctor.ts b/packages/cli/src/commands/doctor.ts
index c5779c8426..6619b164d8 100644
--- a/packages/cli/src/commands/doctor.ts
+++ b/packages/cli/src/commands/doctor.ts
@@ -145,6 +145,19 @@ function checkEnvironment(): CheckResult {
return { ok: true, detail: parts.join(" \u00B7 ") };
}
+async function checkWhisper(): Promise<CheckResult> {
+ const { findWhisper, getInstallInstructions } = await import("../whisper/manager.js");
+ const result = findWhisper();
+ if (result) {
+ return { ok: true, detail: result.executablePath };
+ }
+ return {
+ ok: false,
+ detail: "Not found (optional \u2014 needed for transcription)",
+ hint: getInstallInstructions(),
+ };
+}
+
export interface CheckOutcome {
name: string;
ok: boolean;
@@ -213,6 +226,7 @@ export default defineCommand({
}
checks.push({ name: "Environment", run: checkEnvironment });
+ checks.push({ name: "whisper-cpp", run: checkWhisper });
const outcomes: CheckOutcome[] = [];
for (const check of checks) {
diff --git a/packages/cli/src/whisper/manager.ts b/packages/cli/src/whisper/manager.ts
index 05a7c74489..7985283382 100644
--- a/packages/cli/src/whisper/manager.ts
+++ b/packages/cli/src/whisper/manager.ts
@@ -151,10 +151,16 @@ export function findWhisper(): WhisperResult | undefined {
return findFromEnv() ?? findFromSystem() ?? findBuiltBinary();
}
-function getInstallInstructions(): string {
+export function getInstallInstructions(): string {
if (platform() === "darwin") {
return "brew install whisper-cpp";
}
+ if (platform() === "linux") {
+ return "Build from source: https://github.com/ggml-org/whisper.cpp#building (requires cmake and a C compiler)";
+ }
+ if (platform() === "win32") {
+ return "Build with cmake: https://github.com/ggml-org/whisper.cpp#building";
+ }
return "See https://github.com/ggml-org/whisper.cpp#building";
}