_but() {
    local i cur prev opts cmd
    COMPREPLY=()
    if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then
        cur="$2"
    else
        cur="${COMP_WORDS[COMP_CWORD]}"
    fi
    prev="$3"
    cmd=""
    opts=""

    for i in "${COMP_WORDS[@]:0:COMP_CWORD}"
    do
        case "${cmd},${i}" in
            ",$1")
                cmd="but"
                ;;
            but,.)
                cmd="but__subcmd__gui"
                ;;
            but,absorb)
                cmd="but__subcmd__absorb"
                ;;
            but,actions)
                cmd="but__subcmd__actions"
                ;;
            but,alias)
                cmd="but__subcmd__alias"
                ;;
            but,amend)
                cmd="but__subcmd__amend"
                ;;
            but,apply)
                cmd="but__subcmd__apply"
                ;;
            but,branch)
                cmd="but__subcmd__branch"
                ;;
            but,claude)
                cmd="but__subcmd__claude"
                ;;
            but,clean)
                cmd="but__subcmd__clean"
                ;;
            but,commit)
                cmd="but__subcmd__commit"
                ;;
            but,completions)
                cmd="but__subcmd__completions"
                ;;
            but,config)
                cmd="but__subcmd__config"
                ;;
            but,cursor)
                cmd="but__subcmd__cursor"
                ;;
            but,diff)
                cmd="but__subcmd__diff"
                ;;
            but,discard)
                cmd="but__subcmd__discard"
                ;;
            but,edit)
                cmd="but__subcmd__edit"
                ;;
            but,eval-hook)
                cmd="but__subcmd__eval__subcmd__hook"
                ;;
            but,fetch)
                cmd="but__subcmd__fetch"
                ;;
            but,gui)
                cmd="but__subcmd__gui"
                ;;
            but,help)
                cmd="but__subcmd__help"
                ;;
            but,mark)
                cmd="but__subcmd__mark"
                ;;
            but,mcp)
                cmd="but__subcmd__mcp"
                ;;
            but,merge)
                cmd="but__subcmd__merge"
                ;;
            but,metrics)
                cmd="but__subcmd__metrics"
                ;;
            but,move)
                cmd="but__subcmd__move"
                ;;
            but,mr)
                cmd="but__subcmd__pr"
                ;;
            but,onboarding)
                cmd="but__subcmd__onboarding"
                ;;
            but,oplog)
                cmd="but__subcmd__oplog"
                ;;
            but,pick)
                cmd="but__subcmd__pick"
                ;;
            but,pr)
                cmd="but__subcmd__pr"
                ;;
            but,pull)
                cmd="but__subcmd__pull"
                ;;
            but,push)
                cmd="but__subcmd__push"
                ;;
            but,refresh-remote-data)
                cmd="but__subcmd__refresh__subcmd__remote__subcmd__data"
                ;;
            but,resolve)
                cmd="but__subcmd__resolve"
                ;;
            but,review)
                cmd="but__subcmd__pr"
                ;;
            but,reword)
                cmd="but__subcmd__reword"
                ;;
            but,rub)
                cmd="but__subcmd__rub"
                ;;
            but,setup)
                cmd="but__subcmd__setup"
                ;;
            but,show)
                cmd="but__subcmd__show"
                ;;
            but,skill)
                cmd="but__subcmd__skill"
                ;;
            but,squash)
                cmd="but__subcmd__squash"
                ;;
            but,stage)
                cmd="but__subcmd__stage"
                ;;
            but,status)
                cmd="but__subcmd__status"
                ;;
            but,teardown)
                cmd="but__subcmd__teardown"
                ;;
            but,tui)
                cmd="but__subcmd__tui"
                ;;
            but,unapply)
                cmd="but__subcmd__unapply"
                ;;
            but,uncommit)
                cmd="but__subcmd__uncommit"
                ;;
            but,undo)
                cmd="but__subcmd__undo"
                ;;
            but,unmark)
                cmd="but__subcmd__unmark"
                ;;
            but,unstage)
                cmd="but__subcmd__unstage"
                ;;
            but,update)
                cmd="but__subcmd__update"
                ;;
            but,worktree)
                cmd="but__subcmd__worktree"
                ;;
            but__subcmd__actions,handle-changes)
                cmd="but__subcmd__actions__subcmd__handle__subcmd__changes"
                ;;
            but__subcmd__alias,add)
                cmd="but__subcmd__alias__subcmd__add"
                ;;
            but__subcmd__alias,list)
                cmd="but__subcmd__alias__subcmd__list"
                ;;
            but__subcmd__alias,remove)
                cmd="but__subcmd__alias__subcmd__remove"
                ;;
            but__subcmd__branch,delete)
                cmd="but__subcmd__branch__subcmd__delete"
                ;;
            but__subcmd__branch,list)
                cmd="but__subcmd__branch__subcmd__list"
                ;;
            but__subcmd__branch,move)
                cmd="but__subcmd__branch__subcmd__move"
                ;;
            but__subcmd__branch,new)
                cmd="but__subcmd__branch__subcmd__new"
                ;;
            but__subcmd__branch,show)
                cmd="but__subcmd__branch__subcmd__show"
                ;;
            but__subcmd__claude,last)
                cmd="but__subcmd__claude__subcmd__last"
                ;;
            but__subcmd__claude,post-tool)
                cmd="but__subcmd__claude__subcmd__post__subcmd__tool"
                ;;
            but__subcmd__claude,pre-tool)
                cmd="but__subcmd__claude__subcmd__pre__subcmd__tool"
                ;;
            but__subcmd__claude,stop)
                cmd="but__subcmd__claude__subcmd__stop"
                ;;
            but__subcmd__commit,empty)
                cmd="but__subcmd__commit__subcmd__empty"
                ;;
            but__subcmd__config,ai)
                cmd="but__subcmd__config__subcmd__ai"
                ;;
            but__subcmd__config,forge)
                cmd="but__subcmd__config__subcmd__forge"
                ;;
            but__subcmd__config,metrics)
                cmd="but__subcmd__config__subcmd__metrics"
                ;;
            but__subcmd__config,target)
                cmd="but__subcmd__config__subcmd__target"
                ;;
            but__subcmd__config,ui)
                cmd="but__subcmd__config__subcmd__ui"
                ;;
            but__subcmd__config,user)
                cmd="but__subcmd__config__subcmd__user"
                ;;
            but__subcmd__config__subcmd__ai,anthropic)
                cmd="but__subcmd__config__subcmd__ai__subcmd__anthropic"
                ;;
            but__subcmd__config__subcmd__ai,lmstudio)
                cmd="but__subcmd__config__subcmd__ai__subcmd__lmstudio"
                ;;
            but__subcmd__config__subcmd__ai,ollama)
                cmd="but__subcmd__config__subcmd__ai__subcmd__ollama"
                ;;
            but__subcmd__config__subcmd__ai,openai)
                cmd="but__subcmd__config__subcmd__ai__subcmd__openai"
                ;;
            but__subcmd__config__subcmd__ai,openrouter)
                cmd="but__subcmd__config__subcmd__ai__subcmd__openrouter"
                ;;
            but__subcmd__config__subcmd__ai,show)
                cmd="but__subcmd__config__subcmd__ai__subcmd__show"
                ;;
            but__subcmd__config__subcmd__forge,auth)
                cmd="but__subcmd__config__subcmd__forge__subcmd__auth"
                ;;
            but__subcmd__config__subcmd__forge,forget)
                cmd="but__subcmd__config__subcmd__forge__subcmd__forget"
                ;;
            but__subcmd__config__subcmd__forge,list-users)
                cmd="but__subcmd__config__subcmd__forge__subcmd__list__subcmd__users"
                ;;
            but__subcmd__config__subcmd__ui,set)
                cmd="but__subcmd__config__subcmd__ui__subcmd__set"
                ;;
            but__subcmd__config__subcmd__ui,unset)
                cmd="but__subcmd__config__subcmd__ui__subcmd__unset"
                ;;
            but__subcmd__config__subcmd__user,set)
                cmd="but__subcmd__config__subcmd__user__subcmd__set"
                ;;
            but__subcmd__config__subcmd__user,unset)
                cmd="but__subcmd__config__subcmd__user__subcmd__unset"
                ;;
            but__subcmd__cursor,after-edit)
                cmd="but__subcmd__cursor__subcmd__after__subcmd__edit"
                ;;
            but__subcmd__cursor,stop)
                cmd="but__subcmd__cursor__subcmd__stop"
                ;;
            but__subcmd__oplog,list)
                cmd="but__subcmd__oplog__subcmd__list"
                ;;
            but__subcmd__oplog,restore)
                cmd="but__subcmd__oplog__subcmd__restore"
                ;;
            but__subcmd__oplog,snapshot)
                cmd="but__subcmd__oplog__subcmd__snapshot"
                ;;
            but__subcmd__pr,auto-merge)
                cmd="but__subcmd__pr__subcmd__auto__subcmd__merge"
                ;;
            but__subcmd__pr,new)
                cmd="but__subcmd__pr__subcmd__new"
                ;;
            but__subcmd__pr,set-draft)
                cmd="but__subcmd__pr__subcmd__set__subcmd__draft"
                ;;
            but__subcmd__pr,set-ready)
                cmd="but__subcmd__pr__subcmd__set__subcmd__ready"
                ;;
            but__subcmd__pr,template)
                cmd="but__subcmd__pr__subcmd__template"
                ;;
            but__subcmd__resolve,cancel)
                cmd="but__subcmd__resolve__subcmd__cancel"
                ;;
            but__subcmd__resolve,finish)
                cmd="but__subcmd__resolve__subcmd__finish"
                ;;
            but__subcmd__resolve,status)
                cmd="but__subcmd__resolve__subcmd__status"
                ;;
            but__subcmd__skill,check)
                cmd="but__subcmd__skill__subcmd__check"
                ;;
            but__subcmd__skill,install)
                cmd="but__subcmd__skill__subcmd__install"
                ;;
            but__subcmd__update,check)
                cmd="but__subcmd__update__subcmd__check"
                ;;
            but__subcmd__update,install)
                cmd="but__subcmd__update__subcmd__install"
                ;;
            but__subcmd__update,suppress)
                cmd="but__subcmd__update__subcmd__suppress"
                ;;
            but__subcmd__worktree,destroy)
                cmd="but__subcmd__worktree__subcmd__destroy"
                ;;
            but__subcmd__worktree,integrate)
                cmd="but__subcmd__worktree__subcmd__integrate"
                ;;
            but__subcmd__worktree,list)
                cmd="but__subcmd__worktree__subcmd__list"
                ;;
            but__subcmd__worktree,new)
                cmd="but__subcmd__worktree__subcmd__new"
                ;;
            *)
                ;;
        esac
    done

    case "${cmd}" in
        but)
            opts="-t -C -f -j -h -V --trace --log-file --current-dir --format --json --status-after --help --version [PATH] status rub diff edit show setup teardown pull branch worktree mark unmark gui . commit push clean reword oplog undo absorb discard pr review mr refresh-remote-data mcp claude cursor actions metrics completions update alias config resolve fetch squash uncommit amend merge move pick unapply apply stage unstage skill help onboarding eval-hook tui"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                --log-file)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --current-dir)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                -C)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --format)
                    COMPREPLY=($(compgen -W "human shell json none" -- "${cur}"))
                    return 0
                    ;;
                -f)
                    COMPREPLY=($(compgen -W "human shell json none" -- "${cur}"))
                    return 0
                    ;;
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__absorb)
            opts="-j -h --dry-run --json --status-after --help [SOURCE]"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__actions)
            opts="-j -h --json --status-after --help handle-changes"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__actions__subcmd__handle__subcmd__changes)
            opts="-d -j -h --description --description --handler --json --status-after --help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                --description)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --description)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                -d)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --handler)
                    COMPREPLY=($(compgen -W "simple" -- "${cur}"))
                    return 0
                    ;;
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__alias)
            opts="-j -h --json --status-after --help list add remove"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__alias__subcmd__add)
            opts="-g -j -h --global --json --status-after --help <NAME> <VALUE>"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__alias__subcmd__list)
            opts="-j -h --json --status-after --help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__alias__subcmd__remove)
            opts="-g -j -h --global --json --status-after --help <NAME>"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__amend)
            opts="-j -h --json --status-after --help <FILE> <COMMIT>"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__apply)
            opts="-j -h --json --status-after --help <BRANCH_NAME>"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__branch)
            opts="-j -h --json --status-after --help new delete list show move"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__branch__subcmd__delete)
            opts="-f -j -h --force --json --status-after --help <BRANCH_NAME>"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__branch__subcmd__list)
            opts="-l -r -a -j -h --local --remote --all --no-ahead --review --no-check --empty --json --status-after --help [FILTER]"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__branch__subcmd__move)
            opts="-j -h --json --status-after --help [ARGS]..."
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__branch__subcmd__new)
            opts="-a -j -h --anchor --json --status-after --help [BRANCH_NAME]"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                --anchor)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                -a)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__branch__subcmd__show)
            opts="-r -f -j -h --review --files --ai --check --json --status-after --help <BRANCH_ID>"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__claude)
            opts="-j -h --json --status-after --help pre-tool post-tool stop last"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__claude__subcmd__last)
            opts="-o -j -h --offset --json --status-after --help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                --offset)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                -o)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__claude__subcmd__post__subcmd__tool)
            opts="-j -h --json --status-after --help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__claude__subcmd__pre__subcmd__tool)
            opts="-j -h --json --status-after --help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__claude__subcmd__stop)
            opts="-j -h --json --status-after --help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__clean)
            opts="-j -h --dry-run --pull --include-upstream --json --status-after --help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__commit)
            opts="-m -c -o -n -i -p -j -h --message --message-file --create --only --no-hooks --ai --changes --diff --no-diff --json --status-after --help [BRANCH] empty"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                --message)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                -m)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --message-file)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --ai)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                -i)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --changes)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                -p)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__commit__subcmd__empty)
            opts="-j -h --before --after --json --status-after --help [TARGET]"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                --before)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --after)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__completions)
            opts="-j -h --json --status-after --help bash elvish fish powershell zsh"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__config)
            opts="-j -h --json --status-after --help user forge target metrics ui ai"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__config__subcmd__ai)
            opts="-j -h --local --global --json --status-after --help show openai anthropic ollama lmstudio openrouter"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__config__subcmd__ai__subcmd__anthropic)
            opts="-j -h --key-option --model --api-key --api-key-env --json --status-after --help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                --key-option)
                    COMPREPLY=($(compgen -W "bring-your-own butler-api" -- "${cur}"))
                    return 0
                    ;;
                --model)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --api-key)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --api-key-env)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__config__subcmd__ai__subcmd__lmstudio)
            opts="-j -h --endpoint --model --json --status-after --help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                --endpoint)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --model)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__config__subcmd__ai__subcmd__ollama)
            opts="-j -h --endpoint --model --json --status-after --help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                --endpoint)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --model)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__config__subcmd__ai__subcmd__openai)
            opts="-j -h --key-option --model --endpoint --api-key --api-key-env --json --status-after --help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                --key-option)
                    COMPREPLY=($(compgen -W "bring-your-own butler-api" -- "${cur}"))
                    return 0
                    ;;
                --model)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --endpoint)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --api-key)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --api-key-env)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__config__subcmd__ai__subcmd__openrouter)
            opts="-j -h --model --api-key --api-key-env --json --status-after --help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                --model)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --api-key)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --api-key-env)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__config__subcmd__ai__subcmd__show)
            opts="-j -h --json --status-after --help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__config__subcmd__forge)
            opts="-j -h --json --status-after --help auth list-users forget"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__config__subcmd__forge__subcmd__auth)
            opts="-j -h --json --status-after --help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__config__subcmd__forge__subcmd__forget)
            opts="-j -h --json --status-after --help [USERNAME]"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__config__subcmd__forge__subcmd__list__subcmd__users)
            opts="-j -h --json --status-after --help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__config__subcmd__metrics)
            opts="-j -h --json --status-after --help enable disable"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__config__subcmd__target)
            opts="-j -h --json --status-after --help [BRANCH]"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__config__subcmd__ui)
            opts="-j -h --json --status-after --help set unset"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__config__subcmd__ui__subcmd__set)
            opts="-g -j -h --global --json --status-after --help tui <VALUE>"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__config__subcmd__ui__subcmd__unset)
            opts="-g -j -h --global --json --status-after --help tui"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__config__subcmd__user)
            opts="-j -h --json --status-after --help set unset"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__config__subcmd__user__subcmd__set)
            opts="-g -j -h --global --json --status-after --help name email editor <VALUE>"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__config__subcmd__user__subcmd__unset)
            opts="-g -j -h --global --json --status-after --help name email editor"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__cursor)
            opts="-j -h --json --status-after --help after-edit stop"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__cursor__subcmd__after__subcmd__edit)
            opts="-j -h --json --status-after --help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__cursor__subcmd__stop)
            opts="-j -h --nightly --json --status-after --help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__diff)
            opts="-j -h --tui --no-tui --json --status-after --help [TARGET]"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__discard)
            opts="-j -h --json --status-after --help <ID>"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__edit)
            opts="-j -h --json --status-after --help <FILE>"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__eval__subcmd__hook)
            opts="-j -h --json --status-after --help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__fetch)
            opts="-j -h --json --status-after --help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__gui)
            opts="-j -h --json --status-after --help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__help)
            opts="-j -h --json --status-after --help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__mark)
            opts="-d -j -h --delete --json --status-after --help <TARGET>"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__mcp)
            opts="-j -h --json --status-after --help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__merge)
            opts="-j -h --json --status-after --help <BRANCH>"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__metrics)
            opts="-j -h --command-name --props --json --status-after --help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                --command-name)
                    COMPREPLY=($(compgen -W "init absorb discard status tui stf rub move diff edit show commit commit-empty push reword oplog-list oplog-snapshot restore undo gui base-fetch base-check pull branch-new branch-delete branch-list branch-show branch-unapply branch-apply branch-move branch-tear-off claude-pre-tool claude-post-tool claude-stop cursor-after-edit cursor-stop worktree mark unmark forge-auth forge-list-users forge-forget pr-new pr-template disable-auto-merge enable-auto-merge set-review-ready set-review-draft completions alias-check alias-add alias-remove refresh-remote-data resolve update merge skill-install skill-check pick clean unknown" -- "${cur}"))
                    return 0
                    ;;
                --props)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__move)
            opts="-a -j -h --after --json --status-after --help <SOURCE> <TARGET>"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__onboarding)
            opts="-j -h --json --status-after --help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__oplog)
            opts="-j -h --json --status-after --help list snapshot restore"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__oplog__subcmd__list)
            opts="-s -j -h --since --snapshot --json --status-after --help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                --since)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__oplog__subcmd__restore)
            opts="-f -j -h --force --json --status-after --help <OPLOG_SHA>"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__oplog__subcmd__snapshot)
            opts="-m -j -h --message --json --status-after --help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                --message)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                -m)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__pick)
            opts="-j -h --json --status-after --help <SOURCE> [TARGET_BRANCH]"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__pr)
            opts="-d -j -h --draft --json --status-after --help new auto-merge set-draft set-ready template"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__pr__subcmd__auto__subcmd__merge)
            opts="-d -j -h --off --json --status-after --help [SELECTOR]"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__pr__subcmd__new)
            opts="-m -F -f -s -t -d -j -h --message --file --with-force --skip-force-push-protection --no-verify --no-hooks --default --draft --json --status-after --help [BRANCH]"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                --message)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                -m)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --file)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                -F)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__pr__subcmd__set__subcmd__draft)
            opts="-j -h --json --status-after --help [SELECTOR]"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__pr__subcmd__set__subcmd__ready)
            opts="-j -h --json --status-after --help [SELECTOR]"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__pr__subcmd__template)
            opts="-j -h --json --status-after --help [TEMPLATE_PATH]"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__pull)
            opts="-c -j -h --check --json --status-after --help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__push)
            opts="-f -s -w -y -a -t -p -d -j -h --with-force --skip-force-push-protection --no-verify --no-hooks --wip --ready --hashtag --topic --tb --private --dry-run --json --status-after --help [BRANCH_ID]"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                --hashtag)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                -a)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --topic)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                -t)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__refresh__subcmd__remote__subcmd__data)
            opts="-j -h --fetch --pr --ci --updates --json --status-after --help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__resolve)
            opts="-j -h --json --status-after --help [COMMIT] status finish cancel"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__resolve__subcmd__cancel)
            opts="-f -j -h --force --json --status-after --help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__resolve__subcmd__finish)
            opts="-j -h --json --status-after --help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__resolve__subcmd__status)
            opts="-j -h --json --status-after --help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__reword)
            opts="-m -f -j -h --message --format --diff --no-diff --json --status-after --help <TARGET>"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                --message)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                -m)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__rub)
            opts="-j -h --json --status-after --help <SOURCE> <TARGET>"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__setup)
            opts="-j -h --init --json --status-after --help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__show)
            opts="-v -j -h --verbose --json --status-after --help <COMMIT>"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__skill)
            opts="-j -h --json --status-after --help install check"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__skill__subcmd__check)
            opts="-g -l -u -j -h --global --local --update --json --status-after --help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__skill__subcmd__install)
            opts="-g -p -d -j -h --global --path --detect --json --status-after --help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                --path)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                -p)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__squash)
            opts="-d -m -i -j -h --drop-message --message --ai --json --status-after --help [COMMITS]..."
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                --message)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                -m)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --ai)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                -i)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__stage)
            opts="-b -j -h --branch --json --status-after --help [FILE_OR_HUNK] [BRANCH_POS]"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                --branch)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                -b)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__status)
            opts="-f -v -r -u -j -h --verbose --refresh-prs --upstream --no-hint --json --status-after --help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__teardown)
            opts="-j -h --json --status-after --help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__tui)
            opts="-j -h --json --status-after --help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__unapply)
            opts="-f -j -h --force --json --status-after --help <IDENTIFIER>"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__uncommit)
            opts="-d -j -h --discard --json --status-after --help <SOURCE>"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__undo)
            opts="-j -h --json --status-after --help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__unmark)
            opts="-j -h --json --status-after --help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__unstage)
            opts="-j -h --json --status-after --help <FILE_OR_HUNK> [BRANCH]"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__update)
            opts="-j -h --json --status-after --help check suppress install"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__update__subcmd__check)
            opts="-j -h --json --status-after --help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__update__subcmd__install)
            opts="-j -h --json --status-after --help [TARGET]"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__update__subcmd__suppress)
            opts="-j -h --json --status-after --help [DAYS]"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__worktree)
            opts="-j -h --json --status-after --help new list integrate destroy"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__worktree__subcmd__destroy)
            opts="-j -h --reference --json --status-after --help <TARGET>"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__worktree__subcmd__integrate)
            opts="-j -h --target --dry --json --status-after --help <PATH>"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                --target)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__worktree__subcmd__list)
            opts="-j -h --json --status-after --help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        but__subcmd__worktree__subcmd__new)
            opts="-j -h --json --status-after --help <REFERENCE>"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
    esac
}

if [[ "${BASH_VERSINFO[0]}" -eq 4 && "${BASH_VERSINFO[1]}" -ge 4 || "${BASH_VERSINFO[0]}" -gt 4 ]]; then
    complete -F _but -o nosort -o bashdefault -o default but
else
    complete -F _but -o bashdefault -o default but
fi
