_photocraft__cli() {
    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="photocraft__cli"
                ;;
            photocraft__cli,batch)
                cmd="photocraft__cli__subcmd__batch"
                ;;
            photocraft__cli,commands)
                cmd="photocraft__cli__subcmd__commands"
                ;;
            photocraft__cli,convert)
                cmd="photocraft__cli__subcmd__convert"
                ;;
            photocraft__cli,droplet)
                cmd="photocraft__cli__subcmd__droplet"
                ;;
            photocraft__cli,help)
                cmd="photocraft__cli__subcmd__help"
                ;;
            photocraft__cli,info)
                cmd="photocraft__cli__subcmd__info"
                ;;
            photocraft__cli,mcp)
                cmd="photocraft__cli__subcmd__mcp"
                ;;
            photocraft__cli,run)
                cmd="photocraft__cli__subcmd__run"
                ;;
            photocraft__cli,serve)
                cmd="photocraft__cli__subcmd__serve"
                ;;
            photocraft__cli__subcmd__help,batch)
                cmd="photocraft__cli__subcmd__help__subcmd__batch"
                ;;
            photocraft__cli__subcmd__help,commands)
                cmd="photocraft__cli__subcmd__help__subcmd__commands"
                ;;
            photocraft__cli__subcmd__help,convert)
                cmd="photocraft__cli__subcmd__help__subcmd__convert"
                ;;
            photocraft__cli__subcmd__help,droplet)
                cmd="photocraft__cli__subcmd__help__subcmd__droplet"
                ;;
            photocraft__cli__subcmd__help,help)
                cmd="photocraft__cli__subcmd__help__subcmd__help"
                ;;
            photocraft__cli__subcmd__help,info)
                cmd="photocraft__cli__subcmd__help__subcmd__info"
                ;;
            photocraft__cli__subcmd__help,mcp)
                cmd="photocraft__cli__subcmd__help__subcmd__mcp"
                ;;
            photocraft__cli__subcmd__help,run)
                cmd="photocraft__cli__subcmd__help__subcmd__run"
                ;;
            photocraft__cli__subcmd__help,serve)
                cmd="photocraft__cli__subcmd__help__subcmd__serve"
                ;;
            *)
                ;;
        esac
    done

    case "${cmd}" in
        photocraft__cli)
            opts="-h -V --help --version convert info run batch droplet commands mcp serve help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        photocraft__subcmd__cli__subcmd__batch)
            opts="-h --actions --action --in --out --in-place --format --quality --tiff-layers --tiff-compression --tga-bits --dpx-bits --dds-compression --dds-mipmaps --jpeg-format --help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                --actions)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --action)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --in)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --out)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --format)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --quality)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --tiff-compression)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --tga-bits)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --dpx-bits)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --dds-compression)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --jpeg-format)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        photocraft__subcmd__cli__subcmd__commands)
            opts="-h --json --filter --help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                --filter)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        photocraft__subcmd__cli__subcmd__convert)
            opts="-h --in-place --format --quality --tiff-layers --tiff-compression --tga-bits --dpx-bits --dds-compression --dds-mipmaps --jpeg-format --help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                --format)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --quality)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --tiff-compression)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --tga-bits)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --dpx-bits)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --dds-compression)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --jpeg-format)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        photocraft__subcmd__cli__subcmd__droplet)
            opts="-h --out --help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                --out)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        photocraft__subcmd__cli__subcmd__help)
            opts="convert info run batch droplet commands mcp serve 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
            ;;
        photocraft__subcmd__cli__subcmd__help__subcmd__batch)
            opts=""
            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
            ;;
        photocraft__subcmd__cli__subcmd__help__subcmd__commands)
            opts=""
            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
            ;;
        photocraft__subcmd__cli__subcmd__help__subcmd__convert)
            opts=""
            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
            ;;
        photocraft__subcmd__cli__subcmd__help__subcmd__droplet)
            opts=""
            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
            ;;
        photocraft__subcmd__cli__subcmd__help__subcmd__help)
            opts=""
            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
            ;;
        photocraft__subcmd__cli__subcmd__help__subcmd__info)
            opts=""
            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
            ;;
        photocraft__subcmd__cli__subcmd__help__subcmd__mcp)
            opts=""
            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
            ;;
        photocraft__subcmd__cli__subcmd__help__subcmd__run)
            opts=""
            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
            ;;
        photocraft__subcmd__cli__subcmd__help__subcmd__serve)
            opts=""
            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
            ;;
        photocraft__subcmd__cli__subcmd__info)
            opts="-h --compact --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
            ;;
        photocraft__subcmd__cli__subcmd__mcp)
            opts="-h --bridge --control-token --control-token-file --automation-read-root --automation-write-root --help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                --bridge)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --control-token)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --control-token-file)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --automation-read-root)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --automation-write-root)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        photocraft__subcmd__cli__subcmd__run)
            opts="-h --new --cmd --params --out --in-place --format --quality --tiff-layers --tiff-compression --tga-bits --dpx-bits --dds-compression --dds-mipmaps --jpeg-format --help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                --new)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --cmd)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --params)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --out)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --format)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --quality)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --tiff-compression)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --tga-bits)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --dpx-bits)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --dds-compression)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --jpeg-format)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
        photocraft__subcmd__cli__subcmd__serve)
            opts="-h --port --control-token --control-token-file --automation-read-root --automation-write-root --help"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                --port)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --control-token)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --control-token-file)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --automation-read-root)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --automation-write-root)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                *)
                    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 _photocraft__cli -o nosort -o bashdefault -o default photocraft-cli
else
    complete -F _photocraft__cli -o bashdefault -o default photocraft-cli
fi
