diff --git a/Sources/MiniWhisperCLI/CLI.swift b/Sources/MiniWhisperCLI/CLI.swift index 569d14f..c2a5a8a 100644 --- a/Sources/MiniWhisperCLI/CLI.swift +++ b/Sources/MiniWhisperCLI/CLI.swift @@ -3,16 +3,24 @@ import Foundation enum CLI { static func run(arguments: [String]) async -> Int32 { guard let command = arguments.first else { - Help.printRoot() + Help.printBareRoot() + return 0 + } + + if Help.isRootFullHelp(arguments) { + Help.printFull() return 0 } let rest = Array(arguments.dropFirst()) switch command { - case "-h", "--help", "help": + case "-h", "--help": Help.printRoot() return 0 + case "-V", "--version": + Console.out(Version.current) + return 0 case "transcribe": return await TranscribeCommand.run(arguments: rest) case "models": @@ -37,6 +45,40 @@ enum CLI { } enum Help { + static func isRootFullHelp(_ arguments: [String]) -> Bool { + guard arguments.count == 2 else { return false } + return arguments.contains { $0 == "--help" || $0 == "-h" } + && arguments.contains("--full") + } + + static func printBareRoot() { + Console.out( + """ + MiniWhisper CLI + Local audio transcription with Parakeet and Whisper. + + Usage: + miniwhispercli [options] + + Start here (for AI agents): + miniwhispercli skills get core + miniwhispercli skills get timestamps + miniwhispercli skills list --json + + Version-matched guidance. Load core first; use the JSON list for available guides. + + Next: + miniwhispercli transcribe