# shellcheck shell=dash

___X_CMD_GROK_DEFAULT_FIRST_MODEL="grok-3-mini"
___X_CMD_GROK_DEFAULT_ENDPOINT="https://api.x.ai"

___x_cmd log init grok
xrc:mod:lib     grok    cfg chat model/_index

___x_cmd_grok___main(){
    [ "$#" -gt 0 ] ||   set -- --help

    local op="$1";      shift
    case "$op" in
        chat)           ___x_cmd_grok_chat "$@"         ;;
        init|--init)    ___x_cmd_grok_init "$@"         ;;
        --cur|--cfg)    ___x_cmd_grok_"${op#--}" "$@"   ;;
        model)          ___x_cmd_grok_model "$@"        ;;
        --has-apikey)   ___x_cmd_grok_has_apikey "$@"   ;;
        -h|--help)      ___x_cmd help -m grok "$@";    return 0     ;;
        *)              ___x_cmd help -m grok "$@";    return 64    ;;
    esac
}
