#compdef uvx

autoload -U is-at-least

_uvx() {
    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[@]}" : \
'--from=[Use the given package to provide the command]:FROM:' \
'*-w+[Run with the given packages installed]:WITH:' \
'*--with=[Run with the given packages installed]:WITH:' \
'*--with-editable=[Run with the given packages installed in editable mode]:WITH_EDITABLE:_files -/' \
'*--with-requirements=[Run with the packages listed in the given files]:WITH_REQUIREMENTS:_files' \
'*-c+[Constrain versions using the given requirements files \[env\: \`UV_CONSTRAINT\`=\]]:CONSTRAINTS:_files' \
'*--constraints=[Constrain versions using the given requirements files \[env\: \`UV_CONSTRAINT\`=\]]:CONSTRAINTS:_files' \
'*-b+[Constrain build dependencies using the given requirements files when building source distributions \[env\: \`UV_BUILD_CONSTRAINT\`=\]]:BUILD_CONSTRAINTS:_files' \
'*--build-constraints=[Constrain build dependencies using the given requirements files when building source distributions \[env\: \`UV_BUILD_CONSTRAINT\`=\]]:BUILD_CONSTRAINTS:_files' \
'*--overrides=[Override versions using the given requirements files \[env\: \`UV_OVERRIDE\`=\]]:OVERRIDES:_files' \
'*--env-file=[Load environment variables from a \`.env\` file]:ENV_FILE:_files' \
'*--index=[The indexes to use when resolving dependencies, in addition to the default index]:INDEX:_default' \
'--default-index=[The default package index (by default\: <https\://pypi.org/simple>)]:DEFAULT_INDEX:_default' \
'-i+[(Deprecated\: use \`--default-index\` instead) The URL of the Python package index (by default\: <https\://pypi.org/simple>)]:INDEX_URL:_default' \
'--index-url=[(Deprecated\: use \`--default-index\` instead) The URL of the Python package index (by default\: <https\://pypi.org/simple>)]:INDEX_URL:_default' \
'*--extra-index-url=[(Deprecated\: use \`--index\` instead) Extra URLs of package indexes to use, in addition to \`--index-url\`]:EXTRA_INDEX_URL:_default' \
'*-f+[Locations to search for candidate distributions, in addition to those found in the registry indexes]:FIND_LINKS:_default' \
'*--find-links=[Locations to search for candidate distributions, in addition to those found in the registry indexes]:FIND_LINKS:_default' \
'*-P+[Allow upgrades for a specific package, ignoring pinned versions in any existing output file. Implies \`--refresh-package\`]:UPGRADE_PACKAGE:' \
'*--upgrade-package=[Allow upgrades for a specific package, ignoring pinned versions in any existing output file. Implies \`--refresh-package\`]:UPGRADE_PACKAGE:' \
'*--upgrade-group=[Allow upgrades for all packages in a dependency group, ignoring pinned versions in any existing output file]:UPGRADE_GROUP:_default' \
'*--reinstall-package=[Reinstall a specific package, regardless of whether it'\''s already installed. Implies \`--refresh-package\`]:REINSTALL_PACKAGE:' \
'--index-strategy=[The strategy to use when resolving against multiple index URLs]:INDEX_STRATEGY:((first-index\:"Only use results from the first index that returns a match for a given package name"
unsafe-first-match\:"Search for every package name across all indexes, exhausting the versions from the first index before moving on to the next"
unsafe-best-match\:"Search for every package name across all indexes, preferring the "best" version found. If a package version is in multiple indexes, only look at the entry for the first index"))' \
'--keyring-provider=[Attempt to use \`keyring\` for authentication for index URLs]:KEYRING_PROVIDER:((disabled\:"Do not use keyring for credential lookup"
subprocess\:"Use the \`keyring\` command for credential lookup"))' \
'--resolution=[The strategy to use when selecting between the different compatible versions for a given package requirement]:RESOLUTION:((highest\:"Resolve the highest compatible version of each package"
lowest\:"Resolve the lowest compatible version of each package"
lowest-direct\:"Resolve the lowest compatible version of any direct dependencies, and the highest compatible version of any transitive dependencies"))' \
'--prerelease=[The strategy to use when considering pre-release versions]:PRERELEASE:((disallow\:"Disallow all pre-release versions"
allow\:"Allow all pre-release versions"
if-necessary\:"Prefer stable versions, falling back to pre-release versions when necessary"
explicit\:"Prefer stable versions for first-party packages with explicit pre-release specifiers, falling back to pre-release versions when necessary. Disallow pre-release versions for all other packages"
if-necessary-or-explicit\:"Deprecated alias for \`if-necessary\`"))' \
'*--prerelease-package=[The strategy to use when considering pre-release versions for a specific package]:PRERELEASE_PACKAGE:' \
'--fork-strategy=[The strategy to use when selecting multiple versions of a given package across Python versions and platforms]:FORK_STRATEGY:((fewest\:"Optimize for selecting the fewest number of versions for each package. Older versions may be preferred if they are compatible with a wider range of supported Python versions or platforms"
requires-python\:"Optimize for selecting latest supported version of each package, for each supported Python version"))' \
'*-C+[Settings to pass to the PEP 517 build backend, specified as \`KEY=VALUE\` pairs]:CONFIG_SETTING:' \
'*--config-setting=[Settings to pass to the PEP 517 build backend, specified as \`KEY=VALUE\` pairs]:CONFIG_SETTING:' \
'*--config-settings-package=[Settings to pass to the PEP 517 build backend for a specific package, specified as \`PACKAGE\:KEY=VALUE\` pairs]:CONFIG_SETTINGS_PACKAGE:' \
'*--no-build-isolation-package=[Disable isolation when building source distributions for a specific package]:NO_BUILD_ISOLATION_PACKAGE:' \
'--exclude-newer=[Limit candidate packages to those that were uploaded prior to the given date]:EXCLUDE_NEWER:' \
'*--exclude-newer-package=[Limit candidate packages for specific packages to those that were uploaded prior to the given date]:EXCLUDE_NEWER_PACKAGE:' \
'--link-mode=[The method to use when installing packages from the global cache]:LINK_MODE:((clone\:"Clone (i.e., copy-on-write) packages from the source into the destination"
copy\:"Copy packages from the source into the destination"
hardlink\:"Hard link packages from the source into the destination"
symlink\:"Symbolically link packages from the source into the destination"))' \
'*--no-sources-package=[Don'\''t use sources from the \`tool.uv.sources\` table for the specified packages \[env\: \`UV_NO_SOURCES_PACKAGE\`=\]]:NO_SOURCES_PACKAGE:_default' \
'*--no-build-package=[Don'\''t build source distributions for a specific package \[env\: \`UV_NO_BUILD_PACKAGE\`=\]]:NO_BUILD_PACKAGE:' \
'*--no-binary-package=[Don'\''t install pre-built wheels for a specific package \[env\: \`UV_NO_BINARY_PACKAGE\`=\]]:NO_BINARY_PACKAGE:' \
'*--refresh-package=[Refresh cached data for a specific package]:REFRESH_PACKAGE:' \
'-p+[The Python interpreter to use to build the run environment.]:PYTHON:' \
'--python=[The Python interpreter to use to build the run environment.]:PYTHON:' \
'--python-platform=[The platform for which requirements should be installed]:PYTHON_PLATFORM:((windows\:"An alias for \`x86_64-pc-windows-msvc\`, the default target for Windows"
linux\:"An alias for \`x86_64-unknown-linux-gnu\`, the default target for Linux"
macos\:"An alias for \`aarch64-apple-darwin\`, the default target for macOS"
x86_64-pc-windows-msvc\:"A 64-bit x86 Windows target"
aarch64-pc-windows-msvc\:"An ARM64 Windows target"
i686-pc-windows-msvc\:"A 32-bit x86 Windows target"
x86_64-unknown-linux-gnu\:"An x86 Linux target. Equivalent to \`x86_64-manylinux_2_28\`"
aarch64-apple-darwin\:"An ARM-based macOS target, as seen on Apple Silicon devices"
x86_64-apple-darwin\:"An x86 macOS target"
aarch64-unknown-linux-gnu\:"An ARM64 Linux target. Equivalent to \`aarch64-manylinux_2_28\`"
aarch64-unknown-linux-musl\:"An ARM64 Linux target"
x86_64-unknown-linux-musl\:"An \`x86_64\` Linux target"
riscv64-unknown-linux\:"A RISCV64 Linux target"
x86_64-manylinux2014\:"An \`x86_64\` target for the \`manylinux2014\` platform. Equivalent to \`x86_64-manylinux_2_17\`"
x86_64-manylinux_2_17\:"An \`x86_64\` target for the \`manylinux_2_17\` platform"
x86_64-manylinux_2_28\:"An \`x86_64\` target for the \`manylinux_2_28\` platform"
x86_64-manylinux_2_31\:"An \`x86_64\` target for the \`manylinux_2_31\` platform"
x86_64-manylinux_2_32\:"An \`x86_64\` target for the \`manylinux_2_32\` platform"
x86_64-manylinux_2_33\:"An \`x86_64\` target for the \`manylinux_2_33\` platform"
x86_64-manylinux_2_34\:"An \`x86_64\` target for the \`manylinux_2_34\` platform"
x86_64-manylinux_2_35\:"An \`x86_64\` target for the \`manylinux_2_35\` platform"
x86_64-manylinux_2_36\:"An \`x86_64\` target for the \`manylinux_2_36\` platform"
x86_64-manylinux_2_37\:"An \`x86_64\` target for the \`manylinux_2_37\` platform"
x86_64-manylinux_2_38\:"An \`x86_64\` target for the \`manylinux_2_38\` platform"
x86_64-manylinux_2_39\:"An \`x86_64\` target for the \`manylinux_2_39\` platform"
x86_64-manylinux_2_40\:"An \`x86_64\` target for the \`manylinux_2_40\` platform"
aarch64-manylinux2014\:"An ARM64 target for the \`manylinux2014\` platform. Equivalent to \`aarch64-manylinux_2_17\`"
aarch64-manylinux_2_17\:"An ARM64 target for the \`manylinux_2_17\` platform"
aarch64-manylinux_2_28\:"An ARM64 target for the \`manylinux_2_28\` platform"
aarch64-manylinux_2_31\:"An ARM64 target for the \`manylinux_2_31\` platform"
aarch64-manylinux_2_32\:"An ARM64 target for the \`manylinux_2_32\` platform"
aarch64-manylinux_2_33\:"An ARM64 target for the \`manylinux_2_33\` platform"
aarch64-manylinux_2_34\:"An ARM64 target for the \`manylinux_2_34\` platform"
aarch64-manylinux_2_35\:"An ARM64 target for the \`manylinux_2_35\`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 