mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-03 04:38:33 +00:00
fix(cli): improve whisper-cpp install guidance and add doctor check (#1681)
- Platform-specific install instructions for Linux (apt) and Windows (releases page / cmake) instead of a generic "see GitHub" fallback - Export getInstallInstructions so doctor can reuse it - Add whisper-cpp check to `hyperframes doctor` after the Environment check — reports path when found, shows install hint when missing
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user