#!/usr/bin/env python3 """CLI helper to list and set voices for OpenCode and Claude tools.""" import sys from pathlib import Path # Add VoiceAgent1 project root to sys.path project_root = Path("/Users/adolforeyna/Projects/VoiceAgent1") if str(project_root) not in sys.path: sys.path.insert(0, str(project_root)) from voice_manager import KOKORO_VOICES, MACOS_VOICES, VoiceManager def main(): workspace = Path.home() / "Workspace" vm = VoiceManager(workspace) if len(sys.argv) < 2 or sys.argv[1] in ("list", "ls", "--list"): print("Available Voices:\n") print("Kokoro Voices (On-Device Neural Speech):") for k, v in KOKORO_VOICES.items(): active = " (ACTIVE)" if k == vm._active_voice else "" print(f" - {k}: {v}{active}") print("\nmacOS System Voices:") for k, v in MACOS_VOICES.items(): active = " (ACTIVE)" if k == vm._active_voice else "" print(f" - {k}: {v}{active}") return action = sys.argv[1] if action in ("set", "change") and len(sys.argv) >= 3: target_voice = sys.argv[2] ok, msg = vm.apply_voice(target_voice) print(msg) else: # Treat single argument as target voice target_voice = sys.argv[1] ok, msg = vm.apply_voice(target_voice) print(msg) if __name__ == "__main__": main()