#compdef proto

autoload -U is-at-least

_proto() {
    typeset -A opt_args
    typeset -a _arguments_options
    local ret=1

    if is-at-least 5.2; then
        _arguments_options=(-s -S -C)
    else
        _arguments_options=(-s -C)
    fi

    local context curcontext="$curcontext" state line
    _arguments "${_arguments_options[@]}" : \
'-c+[Mode in which to load configuration]:CONFIG_MODE:(global local upwards upwards-global)' \
'--config-mode=[Mode in which to load configuration]:CONFIG_MODE:(global local upwards upwards-global)' \
'--log=[Lowest log level to output]:LOG:(off error warn info debug trace verbose)' \
'--log-file=[Path to a file to write logs to]:LOG_FILE:_files' \
'--theme=[Terminal theme to print with]:THEME:(dark light)' \
'--dump[Dump a trace profile to the working directory]' \
'--json[Print as JSON (when applicable)]' \
'-y[Avoid all interactive prompts and use defaults]' \
'--yes[Avoid all interactive prompts and use defaults]' \
'-h[Print help]' \
'--help[Print help]' \
'-V[Print version]' \
'--version[Print version]' \
":: :_proto_commands" \
"*::: :->proto" \
&& ret=0
    case $state in
    (proto)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:proto-command-$line[1]:"
        case $line[1] in
            (activate)
_arguments "${_arguments_options[@]}" : \
'-c+[Mode in which to load configuration]:CONFIG_MODE:(global local upwards upwards-global)' \
'--config-mode=[Mode in which to load configuration]:CONFIG_MODE:(global local upwards upwards-global)' \
'--log=[Lowest log level to output]:LOG:(off error warn info debug trace verbose)' \
'--log-file=[Path to a file to write logs to]:LOG_FILE:_files' \
'--theme=[Terminal theme to print with]:THEME:(dark light)' \
'--export[Print the activate instructions in shell specific-syntax]' \
'--no-bin[Don'\''t include ~/.proto/bin in path lookup]' \
'--no-init[Do not run activate hook on initialization]' \
'--no-shim[Don'\''t include ~/.proto/shims in path lookup]' \
'--dump[Dump a trace profile to the working directory]' \
'--json[Print as JSON (when applicable)]' \
'-y[Avoid all interactive prompts and use defaults]' \
'--yes[Avoid all interactive prompts and use defaults]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'-V[Print version]' \
'--version[Print version]' \
'::shell -- Shell to activate for:_default' \
&& ret=0
;;
(alias)
_arguments "${_arguments_options[@]}" : \
'--to=[Location of .prototools to add to]:TO:(global local user)' \
'-c+[Mode in which to load configuration]:CONFIG_MODE:(global local upwards upwards-global)' \
'--config-mode=[Mode in which to load configuration]:CONFIG_MODE:(global local upwards upwards-global)' \
'--log=[Lowest log level to output]:LOG:(off error warn info debug trace verbose)' \
'--log-file=[Path to a file to write logs to]:LOG_FILE:_files' \
'--theme=[Terminal theme to print with]:THEME:(dark light)' \
'--dump[Dump a trace profile to the working directory]' \
'--json[Print as JSON (when applicable)]' \
'-y[Avoid all interactive prompts and use defaults]' \
'--yes[Avoid all interactive prompts and use defaults]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'-V[Print version]' \
'--version[Print version]' \
':context -- Tool to alias:_default' \
':alias -- Alias name:_default' \
':spec -- Version specification to alias:_default' \
&& ret=0
;;
(bin)
_arguments "${_arguments_options[@]}" : \
'--dir=[Display the chosen directory path if available]:DIR:(exes globals)' \
'-c+[Mode in which to load configuration]:CONFIG_MODE:(global local upwards upwards-global)' \
'--config-mode=[Mode in which to load configuration]:CONFIG_MODE:(global local upwards upwards-global)' \
'--log=[Lowest log level to output]:LOG:(off error warn info debug trace verbose)' \
'--log-file=[Path to a file to write logs to]:LOG_FILE:_files' \
'--theme=[Terminal theme to print with]:THEME:(dark light)' \
'--all[List all paths instead of just one]' \
'--bin[Display symlinked binary path when available]' \
'--shim[Display shim path when available]' \
'--dump[Dump a trace profile to the working directory]' \
'--json[Print as JSON (when applicable)]' \
'-y[Avoid all interactive prompts and use defaults]' \
'--yes[Avoid all interactive prompts and use defaults]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'-V[Print version]' \
'--version[Print version]' \
':context -- Tool to inspect:_default' \
'::spec -- Version specification to locate:_default' \
&& ret=0
;;
(clean)
_arguments "${_arguments_options[@]}" : \
'--days=[Clean tools and plugins older than the specified number of days]:DAYS:_default' \
'-c+[Mode in which to load configuration]:CONFIG_MODE:(global local upwards upwards-global)' \
'--config-mode=[Mode in which to load configuration]:CONFIG_MODE:(global local upwards upwards-global)' \
'--log=[Lowest log level to output]:LOG:(off error warn info debug trace verbose)' \
'--log-file=[Path to a file to write logs to]:LOG_FILE:_files' \
'--theme=[Terminal theme to print with]:THEME:(dark light)' \
'--dump[Dump a trace profile to the working directory]' \
'--json[Print as JSON (when applicable)]' \
'-y[Avoid all interactive prompts and use defaults]' \
'--yes[Avoid all interactive prompts and use defaults]' \
'-h[Print help]' \
'--help[Print help]' \
'-V[Print version]' \
'--version[Print version]' \
'::target -- Specific target to clean:(all cache plugins temp tools)' \
&& ret=0
;;
(completions)
_arguments "${_arguments_options[@]}" : \
'--shell=[Shell to generate for]:SHELL:_default' \
'-c+[Mode in which to load configuration]:CONFIG_MODE:(global local upwards upwards-global)' \
'--config-mode=[Mode in which to load configuration]:CONFIG_MODE:(global local upwards upwards-global)' \
'--log=[Lowest log level to output]:LOG:(off error warn info debug trace verbose)' \
'--log-file=[Path to a file to write logs to]:LOG_FILE:_files' \
'--theme=[Terminal theme to print with]:THEME:(dark light)' \
'--dump[Dump a trace profile to the working directory]' \
'--json[Print as JSON (when applicable)]' \
'-y[Avoid all interactive prompts and use defaults]' \
'--yes[Avoid all interactive prompts and use defaults]' \
'-h[Print help]' \
'--help[Print help]' \
'-V[Print version]' \
'--version[Print version]' \
&& ret=0
;;
(debug)
_arguments "${_arguments_options[@]}" : \
'-c+[Mode in which to load configuration]:CONFIG_MODE:(global local upwards upwards-global)' \
'--config-mode=[Mode in which to load configuration]:CONFIG_MODE:(global local upwards upwards-global)' \
'--log=[Lowest log level to output]:LOG:(off error warn info debug trace verbose)' \
'--log-file=[Path to a file to write logs to]:LOG_FILE:_files' \
'--theme=[Terminal theme to print with]:THEME:(dark light)' \
'--dump[Dump a trace profile to the working directory]' \
'--json[Print as JSON (when applicable)]' \
'-y[Avoid all interactive prompts and use defaults]' \
'--yes[Avoid all interactive prompts and use defaults]' \
'-h[Print help]' \
'--help[Print help]' \
'-V[Print version]' \
'--version[Print version]' \
":: :_proto__subcmd__debug_commands" \
"*::: :->debug" \
&& ret=0

    case $state in
    (debug)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:proto-debug-command-$line[1]:"
        case $line[1] in
            (config)
_arguments "${_arguments_options[@]}" : \
'-c+[Mode in which to load configuration]:CONFIG_MODE:(global local upwards upwards-global)' \
'--config-mode=[Mode in which to load configuration]:CONFIG_MODE:(global local upwards upwards-global)' \
'--log=[Lowest log level to output]:LOG:(off error warn info debug trace verbose)' \
'--log-file=[Path to a file to write logs to]:LOG_FILE:_files' \
'--theme=[Terminal theme to print with]:THEME:(dark light)' \
'--raw[Dump raw configuration objects]' \
'--dump[Dump a trace profile to the working directory]' \
'--json[Print as JSON (when applicable)]' \
'-y[Avoid all interactive prompts and use defaults]' \
'--yes[Avoid all interactive prompts and use defaults]' \
'-h[Print help]' \
'--help[Print help]' \
'-V[Print version]' \
'--version[Print version]' \
&& ret=0
;;
(env)
_arguments "${_arguments_options[@]}" : \
'-c+[Mode in which to load configuration]:CONFIG_MODE:(global local upwards upwards-global)' \
'--config-mode=[Mode in which to load configuration]:CONFIG_MODE:(global local upwards upwards-global)' \
'--log=[Lowest log level to output]:LOG:(off error warn info debug trace verbose)' \
'--log-file=[Path to a file to write logs to]:LOG_FILE:_files' \
'--theme=[Terminal theme to print with]:THEME:(dark light)' \
'--raw[Dump raw environment objects]' \
'--dump[Dump a trace profile to the working directory]' \
'--json[Print as JSON (when applicable)]' \
'-y[Avoid all interactive prompts and use defaults]' \
'--yes[Avoid all interactive prompts and use defaults]' \
'-h[Print help]' \
'--help[Print help]' \
'-V[Print version]' \
'--version[Print version]' \
&& ret=0
;;
        esac
    ;;
esac
;;
(diagnose)
_arguments "${_arguments_options[@]}" : \
'--shell=[Shell to diagnose for]:SHELL:_default' \
'-c+[Mode in which to load configuration]:CONFIG_MODE:(global local upwards upwards-global)' \
'--config-mode=[Mode in which to load configuration]:CONFIG_MODE:(global local upwards upwards-global)' \
'--log=[Lowest log level to output]:LOG:(off error warn info debug trace verbose)' \
'--log-file=[Path to a file to write logs to]:LOG_FILE:_files' \
'--theme=[Terminal theme to print with]:THEME:(dark light)' \
'--dump[Dump a trace profile to the working directory]' \
'--json[Print as JSON (when applicable)]' \
'-y[Avoid all interactive prompts and use defaults]' \
'--yes[Avoid all interactive prompts and use defaults]' \
'-h[Print help]' \
'--help[Print help]' \
'-V[Print version]' \
'--version[Print version]' \
&& ret=0
;;
(exec)
_arguments "${_arguments_options[@]}" : \
'--shell=[Shell to execute the command with]:SHELL:_default' \
'-c+[Mode in which to load configuration]:CONFIG_MODE:(global local upwards upwards-global)' \
'--config-mode=[Mode in which to load configuration]:CONFIG_MODE:(global local upwards upwards-global)' \
'--log=[Lowest log level to output]:LOG:(off error warn info debug trace verbose)' \
'--log-file=[Path to a file to write logs to]:LOG_FILE:_files' \
'--theme=[Terminal theme to print with]:THEME:(dark light)' \
'--tools-from-config[Inherit tools to initialize from .prototools configs]' \
'--raw[Execute the command as-is without quoting or escaping]' \
'--dump[Dump a trace profile to the working directory]' \
'--json[Print as JSON (when applicable)]' \
'-y[Avoid all interactive prompts and use defaults]' \
'--yes[Avoid all interactive prompts and use defaults]' \
'-h[Print help]' \
'--help[Print help]' \
'-V[Print version]' \
'--version[Print version]' \
'*::tools -- Tools to initialize:_default' \
&& ret=0
;;
(install)
_arguments "${_arguments_options[@]}" : \
'--pin=[Pin the resolved version to .prototools]::PIN:(global local user)' \
'-c+[Mode in which to load configuration]:CONFIG_MODE:(global local upwards upwards-global)' \
'--config-mode=[Mode in which to load configuration]:CONFIG_MODE:(global local upwards upwards-global)' \
'--log=[Lowest log level to output]:LOG:(off error warn info debug trace verbose)' \
'--log-file=[Path to a file to write logs to]:LOG_FILE:_files' \
'--theme=[Terminal theme to print with]:THEME:(dark light)' \
'--build[Build from source instead of downloading a pre-built]' \
'--no-build[Download a pre-built instead of building from source]' \
'--force[Force reinstallation even if already installed]' \
'--quiet[Hide install progress output excluding errors]' \
'--update-lockfile[Don'\''t inherit a version from the lockfile and update the record]' \
'--internal[]' \
'--dump[Dump a trace profile to the working directory]' \
'--json[Print as JSON (when applicable)]' \
'-y[Avoid all interactive prompts and use defaults]' \
'--yes[Avoid all interactive prompts and use defaults]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'-V[Print version]' \
'--version[Print version]' \
'::context -- Single tool to install:_default' \
'::spec -- When installing one tool, the version specification to install:_default' \
'*::passthrough -- When installing one tool, additional arguments to pass to the tool:_default' \
&& ret=0
;;
(mcp)
_arguments "${_arguments_options[@]}" : \
'-c+[Mode in which to load configuration]:CONFIG_MODE:(global local upwards upwards-global)' \
'--config-mode=[Mode in which to load configuration]:CONFIG_MODE:(global local upwards upwards-global)' \
'--log=[Lowest log level to output]:LOG:(off error warn info debug trace verbose)' \
'--log-file=[Path to a file to write logs to]:LOG_FILE:_files' \
'--theme=[Terminal theme to print with]:THEME:(dark light)' \
'--info[Display server information and list available tools and resources]' \
'--dump[Dump a trace profile to the working directory]' \
'--json[Print as JSON (when applicable)]' \
'-y[Avoid all interactive prompts and use defaults]' \
'--yes[Avoid all interactive prompts and use defaults]' \
'-h[Print help]' \
'--help[Print help]' \
'-V[Print version]' \
'--version[Print version]' \
&& ret=0
;;
(migrate)
_arguments "${_arguments_options[@]}" : \
'-c+[Mode in which to load configuration]:CONFIG_MODE:(global local upwards upwards-global)' \
'--config-mode=[Mode in which to load configuration]:CONFIG_MODE:(global local upwards upwards-global)' \
'--log=[Lowest log level to output]:LOG:(off error warn info debug trace verbose)' \
'--log-file=[Path to a file to write logs to]:LOG_FILE:_files' \
'--theme=[Terminal theme to print with]:THEME:(dark light)' \
'--dump[Dump a trace profile to the working directory]' \
'--json[Print as JSON (when applicable)]' \
'-y[Avoid all interactive prompts and use defaults]' \
'--yes[Avoid all interactive prompts and use defaults]' \
'-h[Print help]' \
'--help[Print help]' \
'-V[Print version]' \
'--version[Print version]' \
':operation -- Operation to migrate:_default' \
&& ret=0
;;
(outdated)
_arguments "${_arguments_options[@]}" : \
'-c+[Mode in which to load configuration]:CONFIG_MODE:(global local upwards upwards-global)' \
'--config-mode=[Mode in which to load configuration]:CONFIG_MODE:(global local upwards upwards-global)' \
'--log=[Lowest log level to output]:LOG:(off error warn info debug trace verbose)' \
'--log-file=[Path to a file to write logs to]:LOG_FILE:_files' \
'--theme=[Terminal theme to print with]:THEME:(dark light)' \
'--latest[When updating versions, use the latest version instead of newest]' \
'--update[Update and write the versions to their respective configuration]' \
'--dump[Dump a trace profile to the working directory]' \
'--json[Print as JSON (when applicable)]' \
'-y[Avoid all interactive prompts and use defaults]' \
'--yes[Avoid all interactive prompts and use defaults]' \
'-h[Print help]' \
'--help[Print help]' \
'-V[Print version]' \
'--version[Print version]' \
&& ret=0
;;
(pin)
_arguments "${_arguments_options[@]}" : \
'--to=[Directory location to pin to]:TO:(global local user)' \
'-c+[Mode in which to load configuration]:CONFIG_MODE:(global local upwards upwards-global)' \
'--config-mode=[Mode in which to load configuration]:CONFIG_MODE:(global local upwards upwards-global)' \
'--log=[Lowest log level to output]:LOG:(off error warn info debug trace verbose)' \
'--log-file=[Path to a file to write logs to]:LOG_FILE:_files' \
'--theme=[Terminal theme to print with]:THEME:(dark light)' \
'--resolve[Resolve the version before pinning]' \
'--tool-native[Pin to the tool'\''s native file instead of .prototools]' \
'--dump[Dump a trace profile to the working directory]' \
'--json[Print as JSON (when applicable)]' \
'-y[Avoid all interactive prompts and use defaults]' \
'--yes[Avoid all interactive prompts and use defaults]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'-V[Print version]' \
'--version[Print version]' \
':context -- Tool to pin:_default' \
':spec -- Version specification to pin:_default' \
&& ret=0
;;
(plugin)
_arguments "${_arguments_options[@]}" : \
'-c+[Mode in which to load configuration]:CONFIG_MODE:(global local upwards upwards-global)' \
'--config-mode=[Mode in which to load configuration]:CONFIG_MODE:(global local upwards upwards-global)' \
'--log=[Lowest log level to output]:LOG:(off error warn info debug trace verbose)' \
'--log-file=[Path to a file to write logs to]:LOG_FILE:_files' \
'--theme=[Terminal theme to print with]:THEME:(dark light)' \
'--dump[Dump a trace profile to the working directory]' \
'--json[Print as JSON (when applicable)]' \
'-y[Avoid all interactive prompts and use defaults]' \
'--yes[Avoid all interactive prompts and use defaults]' \
'-h[Print help]' \
'--help[Print help]' \
'-V[Print version]' \
'--version[Print version]' \
":: :_proto__subcmd__plugin_commands" \
"*::: :->plugin" \
&& ret=0

    case $state in
    (plugin)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:proto-plugin-command-$line[1]:"
        case $line[1] in
            (add)
_arguments "${_arguments_options[@]}" : \
'--to=[Location of .prototools to add to]:TO:(global local user)' \
'--type=[The type of plugin to add]:TY:_default' \
'-c+[Mode in which to load configuration]:CONFIG_MODE:(global local upwards upwards-global)' \
'--config-mode=[Mode in which to load configuration]:CONFIG_MODE:(global local upwards upwards-global)' \
'--log=[Lowest log level to output]:LOG:(off error warn info debug trace verbose)' \
'--log-file=[Path to a file to write logs to]:LOG_FILE:_files' \
'--theme=[Terminal theme to print with]:THEME:(dark light)' \
'--dump[Dump a trace profile to the working directory]' \
'--json[Print as JSON (when applicable)]' \
'-y[Avoid all interactive prompts and use defaults]' \
'--yes[Avoid all interactive prompts and use defaults]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'-V[Print version]' \
'--version[Print version]' \
':id -- ID of plugin:_default' \
':plugin -- Locator string to find and load the plugin:_default' \
&& ret=0
;;
(info)
_arguments "${_arguments_options[@]}" : \
'-c+[Mode in which to load configuration]:CONFIG_MODE:(global local upwards upwards-global)' \
'--config-mode=[Mode in which to load configuration]:CONFIG_MODE:(global local upwards upwards-global)' \
'--log=[Lowest log level to output]:LOG:(off error warn info debug trace verbose)' \
'--log-file=[Path to a file to write logs to]:LOG_FILE:_files' \
'--theme=[Terminal theme to print with]:THEME:(dark light)' \
'--dump[Dump a trace profile to the working directory]' \
'--json[Print as JSON (when applicable)]' \
'-y[Avoid all interactive prompts and use defaults]' \
'--yes[Avoid all interactive prompts and use defaults]' \
'-h[Print help]' \
'--help[Print help]' \
'-V[Print version]' \
'--version[Print version]' \
':id -- ID of plugin:_default' \
&& ret=0
;;
(list)
_arguments "${_arguments_options[@]}" : \
'-c+[Mode in which to load configuration]:CONFIG_MODE:(global local upwards upwards-global)' \
'--config-mode=[Mode in which to load configuration]:CONFIG_MODE:(global local upwards upwards-global)' \
'--log=[Lowest log level to output]:LOG:(off error warn info debug trace verbose)' \
'--log-file=[Path to a file to write logs to]:LOG_FILE:_files' \
'--theme=[Terminal theme to print with]:THEME:(dark light)' \
'--aliases[Include resolved aliases in the output]' \
'--versions[Include installed versions in the output]' \
'--dump[Dump a trace profile to the working directory]' \
'--json[Print as JSON (when applicable)]' \
'-y[Avoid all interactive prompts and use defaults]' \
'--yes[Avoid all interactive prompts and use defaults]' \
'-h[Print help]' \
'--help[Print help]' \
'-V[Print version]' \
'--version[Print version]' \
'*::ids -- ID of plugins to list:_default' \
&& ret=0
;;
(remove)
_arguments "${_arguments_options[@]}" : \
'--from=[Location of .prototools to remove from]:FROM:(global local user)' \
'--type=[The type of plugin to remove]:TY:_default' \
'-c+[Mode in which to load configuration]:CONFIG_MODE:(global local upwards upwards-global)' \
'--config-mode=[Mode in which to load configuration]:CONFIG_MODE:(global local upwards upwards-global)' \
'--log=[Lowest log level to output]:LOG:(off error warn info debug trace verbose)' \
'--log-file=[Path to a file to write logs to]:LOG_FILE:_files' \
'--theme=[Terminal theme to print with]:THEME:(dark light)' \
'--dump[Dump a trace profile to the working directory]' \
'--json[Print as JSON (when applicable)]' \
'-y[Avoid all interactive prompts and use defaults]' \
'--yes[Avoid all interactive prompts and use defaults]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'-V[Print version]' \
'--version[Print version]' \
':id -- ID of plugin:_default' \
&& ret=0
;;
(search)
_arguments "${_arguments_options[@]}" : \
'-c+[Mode in which to load configuration]:CONFIG_MODE:(global local upwards upwards-global)' \
'--config-mode=[Mode in which to load configuration]:CONFIG_MODE:(global local upwards upwards-global)' \
'--log=[Lowest log level to output]:LOG:(off error warn info debug trace verbose)' \
'--log-file=[Path to a file to write logs to]:LOG_FILE:_files' \
'--theme=[Terminal theme to print with]:THEME:(dark light)' \
'--dump[Dump a trace profile to the working directory]' \
'--json[Print as JSON (when applicable)]' \
'-y[Avoid all interactive prompts and use defaults]' \
'--yes[Avoid all interactive prompts and use defaults]' \
'-h[Print help]' \
'--help[Print help]' \
'-V[Print version]' \
'--version[Print version]' \
':query -- Query to search available plugins:_default' \
&& ret=0
;;
        esac
    ;;
esac
;;
(regen)
_arguments "${_arguments_options[@]}" : \
'-c+[Mode in which to load configuration]:CONFIG_MODE:(global local upwards upwards-global)' \
'--config-mode=[Mode in which to load configuration]:CONFIG_MODE:(global local upwards upwards-global)' \
'--log=[Lowest log level to output]:LOG:(off error warn info debug trace verbose)' \
'--log-file=[Path to a file to write logs to]:LOG_FILE:_files' \
'--theme=[Terminal theme to print with]:THEME:(dark light)' \
'--bin[Also recreate binary symlinks]' \
'--dump[Dump a trace profile to the working directory]' \
'--json[Print as JSON (when applicable)]' \
'-y[Avoid all interactive prompts and use defaults]' \
'--yes[Avoid all interactive prompts and use defaults]' \
'-h[Print help]' \
'--help[Print help]' \
'-V[Print version]' \
'--version[Print version]' \
&& ret=0
;;
(run)
_arguments "${_arguments_options[@]}" : \
'--exe=[File name of an alternate (secondary) executable to run]:EXE:_default' \
'-c+[Mode in which to load configuration]:CONFIG_MODE:(global local upwards upwards-global)' \
'--config-mode=[Mode in which to load configuration]:CONFIG_MODE:(global local upwards upwards-global)' \
'--log=[Lowest log level to output]:LOG:(off error warn info debug trace verbose)' \
'--log-file=[Path to a file to write logs to]:LOG_FILE:_files' \
'--theme=[Terminal theme to print with]:THEME:(dark light)' \
'--dump[Dump a trace profile to the working directory]' \
'--json[Print as JSON (when applicable)]' \
'-y[Avoid all interactive prompts and use defaults]' \
'--yes[Avoid all interactive prompts and use defaults]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'-V[Print version]' \
'--version[Print version]' \
':context -- Tool to run:_default' \
'::spec -- Version specification to run:_default' \
'*::passthrough -- Arguments to pass through to the underlying command:_default' \
&& ret=0
;;
(setup)
_arguments "${_arguments_options[@]}" : \
'--shell=[Shell to setup for]:SHELL:_default' \
'-c+[Mode in which to load configuration]:CONFIG_MODE:(global local upwards upwards-global)' \
'--config-mode=[Mode in which to load configuration]:CONFIG_MODE:(global local upwards upwards-global)' \
'--log=[Lowest log level to output]:LOG:(off error warn info debug trace verbose)' \
'--log-file=[Path to a file to write logs to]:LOG_FILE:_files' \
'--theme=[Terminal theme to print with]:THEME:(dark light)' \
'--no-modify-profile[Don'\''t update a shell profile]' \
'--no-modify-path[Don'\''t update the system path]' \
'--dump[Dump a trace profile to the working directory]' \
'--json[Print as JSON (when applicable)]' \
'-y[Avoid all interactive prompts and use defaults]' \
'--yes[Avoid all interactive prompts and use defaults]' \
'-h[Print help]' \
'--help[Print help]' \
'-V[Print version]' \
'--version[Print version]' \
&& ret=0
;;
(shell)
_arguments "${_arguments_options[@]}" : \
'--shell=[Shell to start a session for]:SHELL:_default' \
'-c+[Mode in which to load configuration]:CONFIG_MODE:(global local upwards upwards-global)' \
'--config-mode=[Mode in which to load configuration]:CONFIG_MODE:(global local upwards upwards-global)' \
'--log=[Lowest log level to output]:LOG:(off error warn info debug trace verbose)' \
'--log-file=[Path to a file to write logs to]:LOG_FILE:_files' \
'--theme=[Terminal theme to print with]:THEME:(dark light)' \
'--dump[Dump a trace profile to the working directory]' \
'--json[Print as JSON (when applicable)]' \
'-y[Avoid all interactive prompts and use defaults]' \
'--yes[Avoid all interactive prompts and use defaults]' \
'-h[Print help]' \
'--help[Print help]' \
'-V[Print version]' \
'--version[Print version]' \
'*::tools -- Tools to initialize:_default' \
&& ret=0
;;
(status)
_arguments "${_arguments_options[@]}" : \
'-c+[Mode in which to load configuration]:CONFIG_MODE:(global local upwards upwards-global)' \
'--config-mode=[Mode in which to load configuration]:CONFIG_MODE:(global local upwards upwards-global)' \
'--log=[Lowest log level to output]:LOG:(off error warn info debug trace verbose)' \
'--log-file=[Path to a file to write logs to]:LOG_FILE:_files' \
'--theme=[Terminal theme to print with]:THEME:(dark light)' \
'--dump[Dump a trace profile to the working directory]' \
'--json[Print as JSON (when applicable)]' \
'-y[Avoid all interactive prompts and use defaults]' \
'--yes[Avoid all interactive prompts and use defaults]' \
'-h[Print help]' \
'--help[Print help]' \
'-V[Print version]' \
'--version[Print version]' \
&& ret=0
;;
(unalias)
_arguments "${_arguments_options[@]}" : \
'--from=[Location of .prototools to remove from]:FROM:(global local user)' \
'-c+[Mode in which to load configuration]:CONFIG_MODE:(global local upwards upwards-global)' \
'--config-mode=[Mode in which to load configuration]:CONFIG_MODE:(global local upwards upwards-global)' \
'--log=[Lowest log level to output]:LOG:(off error warn info debug trace verbose)' \
'--log-file=[Path to a file to write logs to]:LOG_FILE:_files' \
'--theme=[Terminal theme to print with]:THEME:(dark light)' \
'--dump[Dump a trace profile to the working directory]' \
'--json[Print as JSON (when applicable)]' \
'-y[Avoid all interactive prompts and use defaults]' \
'--yes[Avoid all interactive prompts and use defaults]' \
'-h[Print help]' \
'--help[Print help]' \
'-V[Print version]' \
'--version[Print version]' \
':context -- Tool to unalias:_default' \
':alias -- Alias name:_default' \
&& ret=0
;;
(uninstall)
_arguments "${_arguments_options[@]}" : \
'-c+[Mode in which to load configuration]:CONFIG_MODE:(global local upwards upwards-global)' \
'--config-mode=[Mode in which to load configuration]:CONFIG_MODE:(global local upwards upwards-global)' \
'--log=[Lowest log level to output]:LOG:(off error warn info debug trace verbose)' \
'--log-file=[Path to a file to write logs to]:LOG_FILE:_files' \
'--theme=[Terminal theme to print with]:THEME:(dark light)' \
'--quiet[Hide uninstall progress output excluding errors]' \
'--dump[Dump a trace profile to the working directory]' \
'--json[Print as JSON (when applicable)]' \
'-y[Avoid all interactive prompts and use defaults]' \
'--yes[Avoid all interactive prompts and use defaults]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'-V[Print version]' \
'--version[Print version]' \
':context -- Tool to uninstall:_default' \
'::spec -- Version specification to uninstall:_default' \
&& ret=0
;;
(unpin)
_arguments "${_arguments_options[@]}" : \
'--from=[Directory location to unpin from]:FROM:(global local user)' \
'-c+[Mode in which to load configuration]:CONFIG_MODE:(global local upwards upwards-global)' \
'--config-mode=[Mode in which to load configuration]:CONFIG_MODE:(global local upwards upwards-global)' \
'--log=[Lowest log level to output]:LOG:(off error warn info debug trace verbose)' \
'--log-file=[Path to a file to write logs to]:LOG_FILE:_files' \
'--theme=[Terminal theme to print with]:THEME:(dark light)' \
'--tool-native[Unpin from the tool'\''s native file instead of .prototools]' \
'--dump[Dump a trace profile to the working directory]' \
'--json[Print as JSON (when applicable)]' \
'-y[Avoid all interactive prompts and use defaults]' \
'--yes[Avoid all interactive prompts and use defaults]' \
'-h[Print help]' \
'--help[Print help]' \
'-V[Print version]' \
'--version[Print version]' \
':context -- ID of tool:_default' \
&& ret=0
;;
(upgrade)
_arguments "${_arguments_options[@]}" : \
'-c+[Mode in which to load configuration]:CONFIG_MODE:(global local upwards upwards-global)' \
'--config-mode=[Mode in which to load configuration]:CONFIG_MODE:(global local upwards upwards-global)' \
'--log=[Lowest log level to output]:LOG:(off error warn info debug trace verbose)' \
'--log-file=[Path to a file to write logs to]:LOG_FILE:_files' \
'--theme=[Terminal theme to print with]:THEME:(dark light)' \
'--check[Check versions only and avoid upgrading]' \
'--dump[Dump a trace profile to the working directory]' \
'--json[Print as JSON (when applicable)]' \
'-y[Avoid all interactive prompts and use defaults]' \
'--yes[Avoid all interactive prompts and use defaults]' \
'-h[Print help]' \
'--help[Print help]' \
'-V[Print version]' \
'--version[Print version]' \
'::target -- Explicit version to upgrade or downgrade to:_default' \
&& ret=0
;;
(versions)
_arguments "${_arguments_options[@]}" : \
'-c+[Mode in which to load configuration]:CONFIG_MODE:(global local upwards upwards-global)' \
'--config-mode=[Mode in which to load configuration]:CONFIG_MODE:(global local upwards upwards-global)' \
'--log=[Lowest log level to output]:LOG:(off error warn info debug trace verbose)' \
'--log-file=[Path to a file to write logs to]:LOG_FILE:_files' \
'--theme=[Terminal theme to print with]:THEME:(dark light)' \
'--aliases[Include aliases in the output]' \
'--installed[Only display installed versions]' \
'--dump[Dump a trace profile to the working directory]' \
'--json[Print as JSON (when applicable)]' \
'-y[Avoid all interactive prompts and use defaults]' \
'--yes[Avoid all interactive prompts and use defaults]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'-V[Print version]' \
'--version[Print version]' \
':context -- Tool to list for:_default' \
&& ret=0
;;
        esac
    ;;
esac
}

(( $+functions[_proto_commands] )) ||
_proto_commands() {
    local commands; commands=(
'activate:Activate proto for the current shell session by prepending tool directories to PATH and setting environment variables.' \
'alias:Add an alias to a tool.' \
'bin:Display the absolute path to a tool'\''s executable(s).' \
'clean:Clean the ~/.proto directory by removing stale tools, plugins, and files.' \
'completions:Generate command completions for your current shell.' \
'debug:Debug the current proto environment.' \
'diagnose:Diagnose potential issues with your proto installation.' \
'exec:Initialize a list of tools into the environment and execute an arbitrary command.' \
'install:Download and install one or many tools.' \
'mcp:Start an MCP server to handle tool, resource, and prompt requests for AI agents.' \
'migrate:Migrate breaking changes for the proto installation.' \
'outdated:Check if configured tool versions are out of date.' \
'pin:Pin a global or local version of a tool.' \
'plugin:Operations for managing tool plugins.' \
'regen:Regenerate shims and optionally relink bins.' \
'run:Run a tool after detecting a version from the environment.' \
'setup:Setup proto for your current shell by injecting exports and updating PATH.' \
'shell:Initialize a list of tools into the environment and start an interactive shell session.' \
'status:List all configured tools and their current installation status.' \
'unalias:Remove an alias from a tool.' \
'uninstall:Uninstall a tool.' \
'unpin:Unpin a global or local version of a tool.' \
'upgrade:Upgrade proto to the latest version.' \
'versions:List available versions for a tool.' \
    )
    _describe -t commands 'proto commands' commands "$@"
}
(( $+functions[_proto__subcmd__activate_commands] )) ||
_proto__subcmd__activate_commands() {
    local commands; commands=()
    _describe -t commands 'proto activate commands' commands "$@"
}
(( $+functions[_proto__subcmd__alias_commands] )) ||
_proto__subcmd__alias_commands() {
    local commands; commands=()
    _describe -t commands 'proto alias commands' commands "$@"
}
(( $+functions[_proto__subcmd__bin_commands] )) ||
_proto__subcmd__bin_commands() {
    local commands; commands=()
    _describe -t commands 'proto bin commands' commands "$@"
}
(( $+functions[_proto__subcmd__clean_commands] )) ||
_proto__subcmd__clean_commands() {
    local commands; commands=()
    _describe -t commands 'proto clean commands' commands "$@"
}
(( $+functions[_proto__subcmd__completions_commands] )) ||
_proto__subcmd__completions_commands() {
    local commands; commands=()
    _describe -t commands 'proto completions commands' commands "$@"
}
(( $+functions[_proto__subcmd__debug_commands] )) ||
_proto__subcmd__debug_commands() {
    local commands; commands=(
'config:Debug all loaded .prototools config'\''s for the current directory.' \
'env:Debug the current proto environment and store.' \
    )
    _describe -t commands 'proto debug commands' commands "$@"
}
(( $+functions[_proto__subcmd__debug__subcmd__config_commands] )) ||
_proto__subcmd__debug__subcmd__config_commands() {
    local commands; commands=()
    _describe -t commands 'proto debug config commands' commands "$@"
}
(( $+functions[_proto__subcmd__debug__subcmd__env_commands] )) ||
_proto__subcmd__debug__subcmd__env_commands() {
    local commands; commands=()
    _describe -t commands 'proto debug env commands' commands "$@"
}
(( $+functions[_proto__subcmd__diagnose_commands] )) ||
_proto__subcmd__diagnose_commands() {
    local commands; commands=()
    _describe -t commands 'proto diagnose commands' commands "$@"
}
(( $+functions[_proto__subcmd__exec_commands] )) ||
_proto__subcmd__exec_commands() {
    local commands; commands=()
    _describe -t commands 'proto exec commands' commands "$@"
}
(( $+functions[_proto__subcmd__install_commands] )) ||
_proto__subcmd__install_commands() {
    local commands; commands=()
    _describe -t commands 'proto install commands' commands "$@"
}
(( $+functions[_proto__subcmd__mcp_commands] )) ||
_proto__subcmd__mcp_commands() {
    local commands; commands=()
    _describe -t commands 'proto mcp commands' commands "$@"
}
(( $+functions[_proto__subcmd__migrate_commands] )) ||
_proto__subcmd__migrate_commands() {
    local commands; commands=()
    _describe -t commands 'proto migrate commands' commands "$@"
}
(( $+functions[_proto__subcmd__outdated_commands] )) ||
_proto__subcmd__outdated_commands() {
    local commands; commands=()
    _describe -t commands 'proto outdated commands' commands "$@"
}
(( $+functions[_proto__subcmd__pin_commands] )) ||
_proto__subcmd__pin_commands() {
    local commands; commands=()
    _describe -t commands 'proto pin commands' commands "$@"
}
(( $+functions[_proto__subcmd__plugin_commands] )) ||
_proto__subcmd__plugin_commands() {
    local commands; commands=(
'add:Add a plugin to manage a tool.' \
'info:Display information about an installed plugin and its inventory.' \
'list:List all configured and built-in plugins, and optionally include inventory.' \
'remove:Remove a plugin and unmanage a tool.' \
'search:Search for available plugins provided by the community.' \
    )
    _describe -t commands 'proto plugin commands' commands "$@"
}
(( $+functions[_proto__subcmd__plugin__subcmd__add_commands] )) ||
_proto__subcmd__plugin__subcmd__add_commands() {
    local commands; commands=()
    _describe -t commands 'proto plugin add commands' commands "$@"
}
(( $+functions[_proto__subcmd__plugin__subcmd__info_commands] )) ||
_proto__subcmd__plugin__subcmd__info_commands() {
    local commands; commands=()
    _describe -t commands 'proto plugin info commands' commands "$@"
}
(( $+functions[_proto__subcmd__plugin__subcmd__list_commands] )) ||
_proto__subcmd__plugin__subcmd__list_commands() {
    local commands; commands=()
    _describe -t commands 'proto plugin list commands' commands "$@"
}
(( $+functions[_proto__subcmd__plugin__subcmd__remove_commands] )) ||
_proto__subcmd__plugin__subcmd__remove_commands() {
    local commands; commands=()
    _describe -t commands 'proto plugin remove commands' commands "$@"
}
(( $+functions[_proto__subcmd__plugin__subcmd__search_commands] )) ||
_proto__subcmd__plugin__subcmd__search_commands() {
    local commands; commands=()
    _describe -t commands 'proto plugin search commands' commands "$@"
}
(( $+functions[_proto__subcmd__regen_commands] )) ||
_proto__subcmd__regen_commands() {
    local commands; commands=()
    _describe -t commands 'proto regen commands' commands "$@"
}
(( $+functions[_proto__subcmd__run_commands] )) ||
_proto__subcmd__run_commands() {
    local commands; commands=()
    _describe -t commands 'proto run commands' commands "$@"
}
(( $+functions[_proto__subcmd__setup_commands] )) ||
_proto__subcmd__setup_commands() {
    local commands; commands=()
    _describe -t commands 'proto setup commands' commands "$@"
}
(( $+functions[_proto__subcmd__shell_commands] )) ||
_proto__subcmd__shell_commands() {
    local commands; commands=()
    _describe -t commands 'proto shell commands' commands "$@"
}
(( $+functions[_proto__subcmd__status_commands] )) ||
_proto__subcmd__status_commands() {
    local commands; commands=()
    _describe -t commands 'proto status commands' commands "$@"
}
(( $+functions[_proto__subcmd__unalias_commands] )) ||
_proto__subcmd__unalias_commands() {
    local commands; commands=()
    _describe -t commands 'proto unalias commands' commands "$@"
}
(( $+functions[_proto__subcmd__uninstall_commands] )) ||
_proto__subcmd__uninstall_commands() {
    local commands; commands=()
    _describe -t commands 'proto uninstall commands' commands "$@"
}
(( $+functions[_proto__subcmd__unpin_commands] )) ||
_proto__subcmd__unpin_commands() {
    local commands; commands=()
    _describe -t commands 'proto unpin commands' commands "$@"
}
(( $+functions[_proto__subcmd__upgrade_commands] )) ||
_proto__subcmd__upgrade_commands() {
    local commands; commands=()
    _describe -t commands 'proto upgrade commands' commands "$@"
}
(( $+functions[_proto__subcmd__versions_commands] )) ||
_proto__subcmd__versions_commands() {
    local commands; commands=()
    _describe -t commands 'proto versions commands' commands "$@"
}

if [ "$funcstack[1]" = "_proto" ]; then
    _proto "$@"
else
    compdef _proto proto
fi
