
___x_cmd_whisper_livekit___runmain(){
    # ffmpeg dependency
    ___x_cmd_hascmd ffmpeg || ___x_cmd env try ffmpeg

    if ___x_cmd os is darwin; then
        ___x_cmd_whisper_livekit___runcmd --with mlx-whisper "$@"
    else
        ___x_cmd_whisper_livekit___runcmd "$@"
    fi
}

___x_cmd_whisper_livekit___runcmd(){
    if ! ___x_cmd hascmd wlk; then
        ___x_cmd_whisper_livekit___install || return $?
    fi

    ___x_cmd_whisper_livekit___runcmd(){
        local with_list=
        while [ $# -gt 0 ]; do
            case "$1" in
                --with) with_list="$with_list,$2";      arg:2:shift ;;
                *)      break ;;
            esac
        done
        ___x_cmd uv tool run --with "httpx[socks],python-multipart${with_list}" --with "" --from whisperlivekit wlk "$@";
    } && ___x_cmd_whisper_livekit___runcmd "$@"
}
