From fef13aa0a13f5bd909e687dd746a8eec2780ba02 Mon Sep 17 00:00:00 2001 From: Oz Agent Date: Fri, 10 Apr 2026 14:46:26 +0000 Subject: [PATCH] Add completion spec: uv Add comprehensive command completion support for uv, the extremely fast Python package manager by Astral. Includes: - Full JSON spec covering all subcommands: run, init, add, remove, sync, lock, export, tree, version, format, audit, tool (run/install/upgrade/ list/uninstall/update-shell/dir), python (list/install/find/pin/dir/ uninstall), pip (compile/sync/install/uninstall/freeze/list/show/tree/ check), venv, build, publish, cache (clean/prune/dir/size), self (update), auth (login/logout/token/dir), generate-shell-completion, help - 5 Rust generators for dynamic completions: - installed_tools: lists tools installed via uv tool - project_dependencies: parses pyproject.toml for project deps - pip_installed_packages: lists pip-installed packages - python_versions: lists installed Python versions - installed_pythons: lists managed Python versions for uninstall Co-Authored-By: Oz --- command-signatures/json/uv.json | 3095 ++++++++++++++++++++++ command-signatures/src/generators/mod.rs | 2 + command-signatures/src/generators/uv.rs | 132 + 3 files changed, 3229 insertions(+) create mode 100644 command-signatures/json/uv.json create mode 100644 command-signatures/src/generators/uv.rs diff --git a/command-signatures/json/uv.json b/command-signatures/json/uv.json new file mode 100644 index 00000000..a6aa4033 --- /dev/null +++ b/command-signatures/json/uv.json @@ -0,0 +1,3095 @@ +{ + "name": "uv", + "description": "An extremely fast Python package manager", + "subcommands": [ + { + "name": "run", + "description": "Run a command or script", + "args": { + "name": "COMMAND", + "isOptional": true, + "isCommand": true + }, + "options": [ + { + "name": "--extra", + "description": "Include optional dependencies from the specified extra name", + "isRepeatable": true, + "args": { + "name": "EXTRA" + } + }, + { + "name": "--all-extras", + "description": "Include all optional dependencies" + }, + { + "name": "--no-extra", + "description": "Exclude the specified optional dependencies", + "isRepeatable": true, + "args": { + "name": "NO_EXTRA" + } + }, + { + "name": "--no-dev", + "description": "Disable the development dependency group" + }, + { + "name": "--group", + "description": "Include dependencies from the specified dependency group", + "isRepeatable": true, + "args": { + "name": "GROUP" + } + }, + { + "name": "--no-group", + "description": "Disable the specified dependency group", + "isRepeatable": true, + "args": { + "name": "NO_GROUP" + } + }, + { + "name": "--no-default-groups", + "description": "Ignore the default dependency groups" + }, + { + "name": "--only-group", + "description": "Only include dependencies from the specified dependency group", + "isRepeatable": true, + "args": { + "name": "ONLY_GROUP" + } + }, + { + "name": "--all-groups", + "description": "Include dependencies from all dependency groups" + }, + { + "name": [ + "-m", + "--module" + ], + "description": "Run a Python module" + }, + { + "name": "--only-dev", + "description": "Only include the development dependency group" + }, + { + "name": "--no-editable", + "description": "Install editable dependencies as non-editable" + }, + { + "name": "--exact", + "description": "Perform an exact sync, removing extraneous packages" + }, + { + "name": "--env-file", + "description": "Load environment variables from a .env file", + "args": { + "name": "ENV_FILE", + "template": "filepaths" + } + }, + { + "name": "--no-env-file", + "description": "Avoid reading environment variables from a .env file" + }, + { + "name": [ + "-w", + "--with" + ], + "description": "Run with the given packages installed", + "isRepeatable": true, + "args": { + "name": "WITH" + } + }, + { + "name": "--with-editable", + "description": "Run with the given packages installed in editable mode", + "isRepeatable": true, + "args": { + "name": "WITH_EDITABLE", + "template": "filepaths" + } + }, + { + "name": "--with-requirements", + "description": "Run with the packages listed in the given files", + "isRepeatable": true, + "args": { + "name": "WITH_REQUIREMENTS", + "template": "filepaths" + } + }, + { + "name": "--isolated", + "description": "Run the command in an isolated virtual environment" + }, + { + "name": "--active", + "description": "Prefer the active virtual environment over the project's virtual environment" + }, + { + "name": "--no-sync", + "description": "Avoid syncing the virtual environment" + }, + { + "name": "--locked", + "description": "Assert that the uv.lock will remain unchanged" + }, + { + "name": "--frozen", + "description": "Run without updating the uv.lock file" + }, + { + "name": [ + "-s", + "--script" + ], + "description": "Run the given path as a Python script" + }, + { + "name": "--gui-script", + "description": "Run the given path as a Python GUI script" + }, + { + "name": "--all-packages", + "description": "Run the command with all workspace members installed" + }, + { + "name": "--package", + "description": "Run the command in a specific package in the workspace", + "args": { + "name": "PACKAGE" + } + }, + { + "name": "--no-project", + "description": "Avoid discovering the project or workspace" + }, + { + "name": [ + "-p", + "--python" + ], + "description": "The Python interpreter to use for the run environment", + "args": { + "name": "PYTHON", + "generatorName": "python_versions" + } + }, + { + "name": "--index", + "description": "The URLs to use when resolving dependencies", + "isRepeatable": true, + "args": { + "name": "INDEX" + } + }, + { + "name": "--default-index", + "description": "The URL of the default package index", + "args": { + "name": "DEFAULT_INDEX" + } + }, + { + "name": [ + "-i", + "--index-url" + ], + "description": "(Deprecated) The URL of the Python package index", + "args": { + "name": "INDEX_URL" + } + }, + { + "name": "--extra-index-url", + "description": "(Deprecated) Extra URLs of package indexes", + "isRepeatable": true, + "args": { + "name": "EXTRA_INDEX_URL" + } + }, + { + "name": [ + "-f", + "--find-links" + ], + "description": "Locations to search for candidate distributions", + "isRepeatable": true, + "args": { + "name": "FIND_LINKS" + } + }, + { + "name": "--no-index", + "description": "Ignore the registry index" + }, + { + "name": [ + "-U", + "--upgrade" + ], + "description": "Allow package upgrades" + }, + { + "name": [ + "-P", + "--upgrade-package" + ], + "description": "Allow upgrades for a specific package", + "isRepeatable": true, + "args": { + "name": "UPGRADE_PACKAGE" + } + }, + { + "name": "--resolution", + "description": "The strategy to use when selecting between compatible versions", + "args": { + "name": "RESOLUTION", + "suggestions": [ + "highest", + "lowest", + "lowest-direct" + ] + } + }, + { + "name": "--prerelease", + "description": "The strategy to use when considering pre-release versions", + "args": { + "name": "PRERELEASE", + "suggestions": [ + "disallow", + "allow", + "if-necessary", + "explicit", + "if-necessary-or-explicit" + ] + } + }, + { + "name": "--exclude-newer", + "description": "Limit candidate packages to those uploaded prior to the given date", + "args": { + "name": "EXCLUDE_NEWER" + } + }, + { + "name": "--no-sources", + "description": "Ignore the tool.uv.sources table when resolving dependencies" + }, + { + "name": "--reinstall", + "description": "Reinstall all packages" + }, + { + "name": "--reinstall-package", + "description": "Reinstall a specific package", + "isRepeatable": true, + "args": { + "name": "REINSTALL_PACKAGE" + } + }, + { + "name": "--link-mode", + "description": "The method to use when installing packages from the global cache", + "args": { + "name": "LINK_MODE", + "suggestions": [ + "clone", + "copy", + "hardlink", + "symlink" + ] + } + }, + { + "name": "--compile-bytecode", + "description": "Compile Python files to bytecode after installation" + }, + { + "name": [ + "-C", + "--config-setting" + ], + "description": "Settings to pass to the PEP 517 build backend", + "isRepeatable": true, + "args": { + "name": "CONFIG_SETTING" + } + }, + { + "name": "--no-build-isolation", + "description": "Disable isolation when building source distributions" + }, + { + "name": "--no-build", + "description": "Don't build source distributions" + }, + { + "name": "--no-binary", + "description": "Don't install pre-built wheels" + }, + { + "name": [ + "-n", + "--no-cache" + ], + "description": "Avoid reading from or writing to the cache" + }, + { + "name": "--cache-dir", + "description": "Path to the cache directory", + "args": { + "name": "CACHE_DIR", + "template": "folders" + } + }, + { + "name": "--refresh", + "description": "Refresh all cached data" + }, + { + "name": "--refresh-package", + "description": "Refresh cached data for a specific package", + "isRepeatable": true, + "args": { + "name": "REFRESH_PACKAGE" + } + } + ] + }, + { + "name": "init", + "description": "Create a new project", + "args": { + "name": "PATH", + "isOptional": true, + "template": "folders" + }, + "options": [ + { + "name": "--name", + "description": "The name of the project", + "args": { + "name": "NAME" + } + }, + { + "name": "--bare", + "description": "Only create a pyproject.toml" + }, + { + "name": "--package", + "description": "Set up the project to be built as a Python package" + }, + { + "name": "--no-package", + "description": "Do not set up the project to be built as a Python package" + }, + { + "name": "--app", + "description": "Create a project for an application" + }, + { + "name": "--lib", + "description": "Create a project for a library" + }, + { + "name": "--script", + "description": "Create a script" + }, + { + "name": "--description", + "description": "Set the project description", + "args": { + "name": "DESCRIPTION" + } + }, + { + "name": "--no-description", + "description": "Disable the description for the project" + }, + { + "name": "--vcs", + "description": "Initialize a version control system for the project", + "args": { + "name": "VCS", + "suggestions": [ + "git", + "none" + ] + } + }, + { + "name": "--build-backend", + "description": "Initialize a build-backend of choice for the project", + "args": { + "name": "BUILD_BACKEND", + "suggestions": [ + "uv", + "hatch", + "flit", + "pdm", + "poetry", + "setuptools", + "maturin", + "scikit" + ] + } + }, + { + "name": "--no-readme", + "description": "Do not create a README.md file" + }, + { + "name": "--author-from", + "description": "Fill in the authors field in the pyproject.toml", + "args": { + "name": "AUTHOR_FROM", + "suggestions": [ + "auto", + "git", + "none" + ] + } + }, + { + "name": "--no-pin-python", + "description": "Do not create a .python-version file for the project" + }, + { + "name": "--no-workspace", + "description": "Avoid discovering a workspace and create a standalone project" + }, + { + "name": [ + "-p", + "--python" + ], + "description": "The Python interpreter to use to determine the minimum supported Python version", + "args": { + "name": "PYTHON", + "generatorName": "python_versions" + } + } + ] + }, + { + "name": "add", + "description": "Add dependencies to the project", + "args": { + "name": "PACKAGES", + "isOptional": true, + "isVariadic": true + }, + "options": [ + { + "name": [ + "-r", + "--requirements" + ], + "description": "Add the packages listed in the given files", + "isRepeatable": true, + "args": { + "name": "REQUIREMENTS", + "template": "filepaths" + } + }, + { + "name": "--dev", + "description": "Add the requirements to the development dependency group" + }, + { + "name": "--optional", + "description": "Add the requirements to the package's optional dependencies", + "args": { + "name": "OPTIONAL" + } + }, + { + "name": "--group", + "description": "Add the requirements to the specified dependency group", + "args": { + "name": "GROUP" + } + }, + { + "name": "--editable", + "description": "Add the requirements as editable" + }, + { + "name": "--raw", + "description": "Add a dependency as provided" + }, + { + "name": "--bounds", + "description": "The kind of version specifier to use when adding dependencies", + "args": { + "name": "BOUNDS", + "suggestions": [ + "lower", + "major", + "minor", + "exact" + ] + } + }, + { + "name": "--rev", + "description": "Commit to use when adding a dependency from Git", + "args": { + "name": "REV" + } + }, + { + "name": "--tag", + "description": "Tag to use when adding a dependency from Git", + "args": { + "name": "TAG" + } + }, + { + "name": "--branch", + "description": "Branch to use when adding a dependency from Git", + "args": { + "name": "BRANCH" + } + }, + { + "name": "--lfs", + "description": "Whether to use Git LFS when adding a dependency from Git" + }, + { + "name": "--extra", + "description": "Extras to enable for the dependency", + "isRepeatable": true, + "args": { + "name": "EXTRA" + } + }, + { + "name": "--no-sync", + "description": "Avoid syncing the virtual environment" + }, + { + "name": "--locked", + "description": "Assert that the uv.lock will remain unchanged" + }, + { + "name": "--frozen", + "description": "Add dependencies without re-locking the project" + }, + { + "name": "--active", + "description": "Prefer the active virtual environment" + }, + { + "name": "--package", + "description": "Add the dependency to a specific package in the workspace", + "args": { + "name": "PACKAGE" + } + }, + { + "name": "--script", + "description": "Add the dependency to the specified Python script", + "args": { + "name": "SCRIPT", + "template": "filepaths" + } + }, + { + "name": [ + "-p", + "--python" + ], + "description": "The Python interpreter to use for resolving and syncing", + "args": { + "name": "PYTHON", + "generatorName": "python_versions" + } + }, + { + "name": "--index", + "description": "The URLs to use when resolving dependencies", + "isRepeatable": true, + "args": { + "name": "INDEX" + } + }, + { + "name": "--default-index", + "description": "The URL of the default package index", + "args": { + "name": "DEFAULT_INDEX" + } + }, + { + "name": [ + "-U", + "--upgrade" + ], + "description": "Allow package upgrades" + }, + { + "name": [ + "-P", + "--upgrade-package" + ], + "description": "Allow upgrades for a specific package", + "isRepeatable": true, + "args": { + "name": "UPGRADE_PACKAGE" + } + }, + { + "name": "--resolution", + "description": "The strategy to use when selecting between compatible versions", + "args": { + "name": "RESOLUTION", + "suggestions": [ + "highest", + "lowest", + "lowest-direct" + ] + } + }, + { + "name": "--prerelease", + "description": "The strategy to use when considering pre-release versions", + "args": { + "name": "PRERELEASE", + "suggestions": [ + "disallow", + "allow", + "if-necessary", + "explicit", + "if-necessary-or-explicit" + ] + } + }, + { + "name": "--link-mode", + "description": "The method to use when installing packages from the global cache", + "args": { + "name": "LINK_MODE", + "suggestions": [ + "clone", + "copy", + "hardlink", + "symlink" + ] + } + }, + { + "name": [ + "-n", + "--no-cache" + ], + "description": "Avoid reading from or writing to the cache" + }, + { + "name": "--cache-dir", + "description": "Path to the cache directory", + "args": { + "name": "CACHE_DIR", + "template": "folders" + } + } + ] + }, + { + "name": "remove", + "description": "Remove dependencies from the project", + "args": { + "name": "PACKAGES", + "isVariadic": true, + "generatorName": "project_dependencies" + }, + "options": [ + { + "name": "--dev", + "description": "Remove the packages from the development dependency group" + }, + { + "name": "--optional", + "description": "Remove the packages from the project's optional dependencies", + "args": { + "name": "OPTIONAL" + } + }, + { + "name": "--group", + "description": "Remove the packages from the specified dependency group", + "args": { + "name": "GROUP" + } + }, + { + "name": "--no-sync", + "description": "Avoid syncing the virtual environment after re-locking" + }, + { + "name": "--active", + "description": "Prefer the active virtual environment" + }, + { + "name": "--locked", + "description": "Assert that the uv.lock will remain unchanged" + }, + { + "name": "--frozen", + "description": "Remove dependencies without re-locking the project" + }, + { + "name": "--package", + "description": "Remove the dependencies from a specific package in the workspace", + "args": { + "name": "PACKAGE" + } + }, + { + "name": "--script", + "description": "Remove the dependency from the specified Python script", + "args": { + "name": "SCRIPT", + "template": "filepaths" + } + }, + { + "name": [ + "-p", + "--python" + ], + "description": "The Python interpreter to use for resolving and syncing", + "args": { + "name": "PYTHON", + "generatorName": "python_versions" + } + }, + { + "name": [ + "-n", + "--no-cache" + ], + "description": "Avoid reading from or writing to the cache" + }, + { + "name": "--cache-dir", + "description": "Path to the cache directory", + "args": { + "name": "CACHE_DIR", + "template": "folders" + } + } + ] + }, + { + "name": "sync", + "description": "Update the project's environment", + "options": [ + { + "name": "--extra", + "description": "Include optional dependencies from the specified extra name", + "isRepeatable": true, + "args": { + "name": "EXTRA" + } + }, + { + "name": "--all-extras", + "description": "Include all optional dependencies" + }, + { + "name": "--no-extra", + "description": "Exclude the specified optional dependencies", + "isRepeatable": true, + "args": { + "name": "NO_EXTRA" + } + }, + { + "name": "--no-dev", + "description": "Disable the development dependency group" + }, + { + "name": "--only-dev", + "description": "Only include the development dependency group" + }, + { + "name": "--group", + "description": "Include dependencies from the specified dependency group", + "isRepeatable": true, + "args": { + "name": "GROUP" + } + }, + { + "name": "--no-group", + "description": "Disable the specified dependency group", + "isRepeatable": true, + "args": { + "name": "NO_GROUP" + } + }, + { + "name": "--no-default-groups", + "description": "Ignore the default dependency groups" + }, + { + "name": "--only-group", + "description": "Only include dependencies from the specified dependency group", + "isRepeatable": true, + "args": { + "name": "ONLY_GROUP" + } + }, + { + "name": "--all-groups", + "description": "Include dependencies from all dependency groups" + }, + { + "name": "--no-editable", + "description": "Install editable dependencies as non-editable" + }, + { + "name": "--inexact", + "description": "Do not remove extraneous packages present in the environment" + }, + { + "name": "--active", + "description": "Sync dependencies to the active virtual environment" + }, + { + "name": "--no-install-project", + "description": "Do not install the current project" + }, + { + "name": "--no-install-workspace", + "description": "Do not install any workspace members" + }, + { + "name": "--locked", + "description": "Assert that the uv.lock will remain unchanged" + }, + { + "name": "--frozen", + "description": "Sync without updating the uv.lock file" + }, + { + "name": "--dry-run", + "description": "Perform a dry run without modifying the environment" + }, + { + "name": "--all-packages", + "description": "Sync all packages in the workspace" + }, + { + "name": "--package", + "description": "Sync for specific packages in the workspace", + "isRepeatable": true, + "args": { + "name": "PACKAGE" + } + }, + { + "name": "--script", + "description": "Sync the environment for a Python script", + "args": { + "name": "SCRIPT", + "template": "filepaths" + } + }, + { + "name": "--check", + "description": "Check if the Python environment is synchronized with the project" + }, + { + "name": [ + "-p", + "--python" + ], + "description": "The Python interpreter to use for the project environment", + "args": { + "name": "PYTHON", + "generatorName": "python_versions" + } + }, + { + "name": [ + "-U", + "--upgrade" + ], + "description": "Allow package upgrades" + }, + { + "name": [ + "-P", + "--upgrade-package" + ], + "description": "Allow upgrades for a specific package", + "isRepeatable": true, + "args": { + "name": "UPGRADE_PACKAGE" + } + }, + { + "name": "--resolution", + "description": "The strategy to use when selecting between compatible versions", + "args": { + "name": "RESOLUTION", + "suggestions": [ + "highest", + "lowest", + "lowest-direct" + ] + } + }, + { + "name": "--link-mode", + "description": "The method to use when installing packages from the global cache", + "args": { + "name": "LINK_MODE", + "suggestions": [ + "clone", + "copy", + "hardlink", + "symlink" + ] + } + }, + { + "name": [ + "-n", + "--no-cache" + ], + "description": "Avoid reading from or writing to the cache" + }, + { + "name": "--cache-dir", + "description": "Path to the cache directory", + "args": { + "name": "CACHE_DIR", + "template": "folders" + } + } + ] + }, + { + "name": "lock", + "description": "Update the project's lockfile", + "options": [ + { + "name": "--check", + "description": "Check if the lockfile is up-to-date" + }, + { + "name": "--check-exists", + "description": "Assert that a uv.lock exists without checking if it is up-to-date" + }, + { + "name": "--dry-run", + "description": "Perform a dry run, without writing the lockfile" + }, + { + "name": "--script", + "description": "Lock the specified Python script", + "args": { + "name": "SCRIPT", + "template": "filepaths" + } + }, + { + "name": [ + "-p", + "--python" + ], + "description": "The Python interpreter to use during resolution", + "args": { + "name": "PYTHON", + "generatorName": "python_versions" + } + }, + { + "name": [ + "-U", + "--upgrade" + ], + "description": "Allow package upgrades" + }, + { + "name": [ + "-P", + "--upgrade-package" + ], + "description": "Allow upgrades for a specific package", + "isRepeatable": true, + "args": { + "name": "UPGRADE_PACKAGE" + } + }, + { + "name": [ + "-n", + "--no-cache" + ], + "description": "Avoid reading from or writing to the cache" + }, + { + "name": "--cache-dir", + "description": "Path to the cache directory", + "args": { + "name": "CACHE_DIR", + "template": "folders" + } + } + ] + }, + { + "name": "export", + "description": "Export the project's lockfile to an alternate format", + "options": [ + { + "name": "--format", + "description": "The format to export to", + "args": { + "name": "FORMAT", + "suggestions": [ + "requirements.txt", + "pylock.toml", + "cyclonedx1.5" + ] + } + }, + { + "name": "--all-packages", + "description": "Export the entire workspace" + }, + { + "name": "--package", + "description": "Export the dependencies for specific packages in the workspace", + "isRepeatable": true, + "args": { + "name": "PACKAGE" + } + }, + { + "name": "--extra", + "description": "Include optional dependencies from the specified extra name", + "isRepeatable": true, + "args": { + "name": "EXTRA" + } + }, + { + "name": "--all-extras", + "description": "Include all optional dependencies" + }, + { + "name": "--no-dev", + "description": "Disable the development dependency group" + }, + { + "name": "--only-dev", + "description": "Only include the development dependency group" + }, + { + "name": "--group", + "description": "Include dependencies from the specified dependency group", + "isRepeatable": true, + "args": { + "name": "GROUP" + } + }, + { + "name": "--all-groups", + "description": "Include dependencies from all dependency groups" + }, + { + "name": "--no-hashes", + "description": "Omit hashes in the generated output" + }, + { + "name": "--no-annotate", + "description": "Exclude comment annotations" + }, + { + "name": "--no-header", + "description": "Exclude the comment header" + }, + { + "name": "--no-editable", + "description": "Export editable dependencies as non-editable" + }, + { + "name": [ + "-o", + "--output-file" + ], + "description": "Write the exported requirements to the given file", + "args": { + "name": "OUTPUT_FILE", + "template": "filepaths" + } + }, + { + "name": "--locked", + "description": "Assert that the uv.lock will remain unchanged" + }, + { + "name": "--frozen", + "description": "Do not update the uv.lock before exporting" + }, + { + "name": "--script", + "description": "Export dependencies for the specified Python script", + "args": { + "name": "SCRIPT", + "template": "filepaths" + } + }, + { + "name": [ + "-p", + "--python" + ], + "description": "The Python interpreter to use during resolution", + "args": { + "name": "PYTHON", + "generatorName": "python_versions" + } + }, + { + "name": [ + "-n", + "--no-cache" + ], + "description": "Avoid reading from or writing to the cache" + }, + { + "name": "--cache-dir", + "description": "Path to the cache directory", + "args": { + "name": "CACHE_DIR", + "template": "folders" + } + } + ] + }, + { + "name": "tree", + "description": "Display the project's dependency tree", + "options": [ + { + "name": "--universal", + "description": "Show a platform-independent dependency tree" + }, + { + "name": [ + "-d", + "--depth" + ], + "description": "Maximum display depth of the dependency tree", + "args": { + "name": "DEPTH" + } + }, + { + "name": "--prune", + "description": "Prune the given package from the display", + "isRepeatable": true, + "args": { + "name": "PRUNE" + } + }, + { + "name": "--package", + "description": "Display only the specified packages", + "isRepeatable": true, + "args": { + "name": "PACKAGE" + } + }, + { + "name": "--no-dedupe", + "description": "Do not de-duplicate repeated dependencies" + }, + { + "name": "--invert", + "description": "Show the reverse dependencies for the given package" + }, + { + "name": "--outdated", + "description": "Show the latest available version of each package" + }, + { + "name": "--show-sizes", + "description": "Show compressed wheel sizes for packages" + }, + { + "name": "--no-dev", + "description": "Disable the development dependency group" + }, + { + "name": "--only-dev", + "description": "Only include the development dependency group" + }, + { + "name": "--group", + "description": "Include dependencies from the specified dependency group", + "isRepeatable": true, + "args": { + "name": "GROUP" + } + }, + { + "name": "--all-groups", + "description": "Include dependencies from all dependency groups" + }, + { + "name": "--locked", + "description": "Assert that the uv.lock will remain unchanged" + }, + { + "name": "--frozen", + "description": "Display the requirements without locking the project" + }, + { + "name": "--script", + "description": "Show the dependency tree for the specified Python script", + "args": { + "name": "SCRIPT", + "template": "filepaths" + } + }, + { + "name": [ + "-p", + "--python" + ], + "description": "The Python interpreter to use for locking and filtering", + "args": { + "name": "PYTHON", + "generatorName": "python_versions" + } + }, + { + "name": [ + "-n", + "--no-cache" + ], + "description": "Avoid reading from or writing to the cache" + }, + { + "name": "--cache-dir", + "description": "Path to the cache directory", + "args": { + "name": "CACHE_DIR", + "template": "folders" + } + } + ] + }, + { + "name": "version", + "description": "Read or update the project's version", + "args": { + "name": "VALUE", + "isOptional": true + }, + "options": [ + { + "name": "--bump", + "description": "Update the project version using the given semantics", + "args": { + "name": "BUMP", + "suggestions": [ + "major", + "minor", + "patch", + "stable", + "alpha", + "beta", + "rc", + "post", + "dev" + ] + } + }, + { + "name": "--dry-run", + "description": "Don't write a new version to the pyproject.toml" + }, + { + "name": "--short", + "description": "Only show the version" + }, + { + "name": "--output-format", + "description": "The format of the output", + "args": { + "name": "OUTPUT_FORMAT", + "suggestions": [ + "text", + "json" + ] + } + }, + { + "name": "--no-sync", + "description": "Avoid syncing the virtual environment after re-locking" + }, + { + "name": "--locked", + "description": "Assert that the uv.lock will remain unchanged" + }, + { + "name": "--frozen", + "description": "Update the version without re-locking the project" + }, + { + "name": "--package", + "description": "Update the version of a specific package in the workspace", + "args": { + "name": "PACKAGE" + } + } + ] + }, + { + "name": "format", + "description": "Format Python code in the project", + "options": [ + { + "name": "--check", + "description": "Check if files are formatted without applying changes" + }, + { + "name": "--diff", + "description": "Show a diff of formatting changes without applying them" + }, + { + "name": "--version", + "description": "The version of Ruff to use for formatting", + "args": { + "name": "VERSION" + } + }, + { + "name": "--no-project", + "description": "Avoid discovering a project or workspace" + } + ] + }, + { + "name": "audit", + "description": "Audit the project's dependencies", + "options": [ + { + "name": "--no-dev", + "description": "Don't audit the development dependency group" + }, + { + "name": "--only-dev", + "description": "Only audit the development dependency group" + }, + { + "name": "--group", + "description": "Include dependencies from the specified dependency group", + "isRepeatable": true, + "args": { + "name": "GROUP" + } + }, + { + "name": "--only-group", + "description": "Only audit dependencies from the specified dependency group", + "isRepeatable": true, + "args": { + "name": "ONLY_GROUP" + } + }, + { + "name": "--locked", + "description": "Assert that the uv.lock will remain unchanged" + }, + { + "name": "--frozen", + "description": "Audit the requirements without locking the project" + }, + { + "name": "--script", + "description": "Audit the specified Python script", + "args": { + "name": "SCRIPT", + "template": "filepaths" + } + }, + { + "name": "--ignore", + "description": "Ignore a vulnerability by ID", + "isRepeatable": true, + "args": { + "name": "IGNORE" + } + }, + { + "name": [ + "-n", + "--no-cache" + ], + "description": "Avoid reading from or writing to the cache" + }, + { + "name": "--cache-dir", + "description": "Path to the cache directory", + "args": { + "name": "CACHE_DIR", + "template": "folders" + } + } + ] + }, + { + "name": "tool", + "description": "Run and install commands provided by Python packages", + "subcommands": [ + { + "name": "run", + "description": "Run a command provided by a Python package", + "args": { + "name": "COMMAND", + "isOptional": true, + "isCommand": true + }, + "options": [ + { + "name": "--from", + "description": "Use the given package to provide the command", + "args": { + "name": "FROM" + } + }, + { + "name": [ + "-w", + "--with" + ], + "description": "Run with the given packages installed", + "isRepeatable": true, + "args": { + "name": "WITH" + } + }, + { + "name": "--with-editable", + "description": "Run with the given packages installed in editable mode", + "isRepeatable": true, + "args": { + "name": "WITH_EDITABLE", + "template": "filepaths" + } + }, + { + "name": "--with-requirements", + "description": "Run with the packages listed in the given files", + "isRepeatable": true, + "args": { + "name": "WITH_REQUIREMENTS", + "template": "filepaths" + } + }, + { + "name": "--isolated", + "description": "Run the tool in an isolated virtual environment" + }, + { + "name": [ + "-p", + "--python" + ], + "description": "The Python interpreter to use", + "args": { + "name": "PYTHON", + "generatorName": "python_versions" + } + }, + { + "name": [ + "-n", + "--no-cache" + ], + "description": "Avoid reading from or writing to the cache" + }, + { + "name": "--cache-dir", + "description": "Path to the cache directory", + "args": { + "name": "CACHE_DIR", + "template": "folders" + } + } + ] + }, + { + "name": "install", + "description": "Install commands provided by a Python package", + "args": { + "name": "PACKAGE" + }, + "options": [ + { + "name": [ + "-w", + "--with" + ], + "description": "Include the following additional requirements", + "isRepeatable": true, + "args": { + "name": "WITH" + } + }, + { + "name": [ + "-e", + "--editable" + ], + "description": "Install the target package in editable mode" + }, + { + "name": "--with-editable", + "description": "Include the given packages in editable mode", + "isRepeatable": true, + "args": { + "name": "WITH_EDITABLE", + "template": "filepaths" + } + }, + { + "name": "--force", + "description": "Force installation of the tool" + }, + { + "name": [ + "-p", + "--python" + ], + "description": "The Python interpreter to use", + "args": { + "name": "PYTHON", + "generatorName": "python_versions" + } + }, + { + "name": [ + "-n", + "--no-cache" + ], + "description": "Avoid reading from or writing to the cache" + }, + { + "name": "--cache-dir", + "description": "Path to the cache directory", + "args": { + "name": "CACHE_DIR", + "template": "folders" + } + } + ] + }, + { + "name": "upgrade", + "description": "Upgrade installed tools", + "args": { + "name": "NAME", + "isVariadic": true, + "generatorName": "installed_tools" + }, + "options": [ + { + "name": "--all", + "description": "Upgrade all tools" + }, + { + "name": [ + "-p", + "--python" + ], + "description": "The Python interpreter to use", + "args": { + "name": "PYTHON", + "generatorName": "python_versions" + } + }, + { + "name": [ + "-n", + "--no-cache" + ], + "description": "Avoid reading from or writing to the cache" + }, + { + "name": "--cache-dir", + "description": "Path to the cache directory", + "args": { + "name": "CACHE_DIR", + "template": "folders" + } + } + ] + }, + { + "name": "list", + "description": "List installed tools", + "options": [ + { + "name": "--show-paths", + "description": "Display the path to each tool environment and installed executable" + }, + { + "name": "--show-version-specifiers", + "description": "Display the version specifier(s) used to install each tool" + }, + { + "name": "--show-with", + "description": "Display the additional requirements installed with each tool" + }, + { + "name": "--show-extras", + "description": "Display the extra requirements installed with each tool" + }, + { + "name": "--show-python", + "description": "Display the Python version associated with each tool" + }, + { + "name": "--outdated", + "description": "List outdated tools" + } + ] + }, + { + "name": "uninstall", + "description": "Uninstall a tool", + "args": { + "name": "NAME", + "isVariadic": true, + "generatorName": "installed_tools" + }, + "options": [ + { + "name": "--all", + "description": "Uninstall all tools" + } + ] + }, + { + "name": "update-shell", + "description": "Ensure that the tool executable directory is on the PATH" + }, + { + "name": "dir", + "description": "Show the path to the uv tools directory", + "options": [ + { + "name": "--bin", + "description": "Show the directory into which uv tool will install executables" + } + ] + } + ] + }, + { + "name": "python", + "description": "Manage Python versions and installations", + "subcommands": [ + { + "name": "list", + "description": "List the available Python installations", + "args": { + "name": "REQUEST", + "isOptional": true + }, + "options": [ + { + "name": "--all-versions", + "description": "List all Python versions, including old patch versions" + }, + { + "name": "--all-platforms", + "description": "List Python downloads for all platforms" + }, + { + "name": "--all-arches", + "description": "List Python downloads for all architectures" + }, + { + "name": "--only-installed", + "description": "Only show installed Python versions" + }, + { + "name": "--only-downloads", + "description": "Only show available Python downloads" + }, + { + "name": "--show-urls", + "description": "Show the URLs of available Python downloads" + }, + { + "name": "--output-format", + "description": "Select the output format", + "args": { + "name": "OUTPUT_FORMAT", + "suggestions": [ + "text", + "json" + ] + } + } + ] + }, + { + "name": "install", + "description": "Download and install Python versions", + "args": { + "name": "TARGETS", + "isOptional": true, + "isVariadic": true, + "generatorName": "python_versions" + }, + "options": [ + { + "name": [ + "-i", + "--install-dir" + ], + "description": "The directory to store the Python installation in", + "args": { + "name": "INSTALL_DIR", + "template": "folders" + } + }, + { + "name": "--no-bin", + "description": "Do not install a Python executable into the bin directory" + }, + { + "name": [ + "-r", + "--reinstall" + ], + "description": "Reinstall the requested Python version" + }, + { + "name": [ + "-f", + "--force" + ], + "description": "Replace existing Python executables during installation" + }, + { + "name": [ + "-U", + "--upgrade" + ], + "description": "Upgrade existing Python installations to the latest patch version" + }, + { + "name": "--default", + "description": "Use as the default Python version" + } + ] + }, + { + "name": "find", + "description": "Search for a Python installation", + "args": { + "name": "REQUEST", + "isOptional": true + }, + "options": [ + { + "name": "--no-project", + "description": "Avoid discovering a project or workspace" + }, + { + "name": "--system", + "description": "Only find system Python interpreters" + }, + { + "name": "--script", + "description": "Find the environment for a Python script", + "args": { + "name": "SCRIPT", + "template": "filepaths" + } + }, + { + "name": "--show-version", + "description": "Show the Python version instead of the path" + } + ] + }, + { + "name": "pin", + "description": "Pin to a specific Python version", + "args": { + "name": "REQUEST", + "isOptional": true, + "generatorName": "python_versions" + }, + "options": [ + { + "name": "--resolved", + "description": "Write the resolved Python interpreter path instead of the request" + }, + { + "name": "--no-project", + "description": "Avoid validating the Python pin is compatible with the project" + }, + { + "name": "--global", + "description": "Update the global Python version pin" + }, + { + "name": "--rm", + "description": "Remove the Python version pin" + } + ] + }, + { + "name": "dir", + "description": "Show the uv Python installation directory", + "options": [ + { + "name": "--bin", + "description": "Show the directory into which uv python will install Python executables" + } + ] + }, + { + "name": "uninstall", + "description": "Uninstall Python versions", + "args": { + "name": "TARGETS", + "isVariadic": true, + "generatorName": "installed_pythons" + }, + "options": [ + { + "name": [ + "-i", + "--install-dir" + ], + "description": "The directory where the Python was installed", + "args": { + "name": "INSTALL_DIR", + "template": "folders" + } + }, + { + "name": "--all", + "description": "Uninstall all managed Python versions" + } + ] + } + ] + }, + { + "name": "pip", + "description": "Manage Python packages with a pip-compatible interface", + "subcommands": [ + { + "name": "compile", + "description": "Compile a requirements.in file to a requirements.txt or pylock.toml file", + "args": { + "name": "SRC_FILE", + "isOptional": true, + "isVariadic": true, + "template": "filepaths" + }, + "options": [ + { + "name": [ + "-c", + "--constraints" + ], + "description": "Constrain versions using the given requirements files", + "isRepeatable": true, + "args": { + "name": "CONSTRAINTS", + "template": "filepaths" + } + }, + { + "name": "--extra", + "description": "Include optional dependencies from the specified extra name", + "isRepeatable": true, + "args": { + "name": "EXTRA" + } + }, + { + "name": "--all-extras", + "description": "Include all optional dependencies" + }, + { + "name": "--no-deps", + "description": "Ignore package dependencies" + }, + { + "name": [ + "-o", + "--output-file" + ], + "description": "Write the compiled requirements to the given file", + "args": { + "name": "OUTPUT_FILE", + "template": "filepaths" + } + }, + { + "name": "--format", + "description": "The format in which the resolution should be output", + "args": { + "name": "FORMAT", + "suggestions": [ + "requirements.txt", + "pylock.toml" + ] + } + }, + { + "name": "--no-annotate", + "description": "Exclude comment annotations" + }, + { + "name": "--no-header", + "description": "Exclude the comment header" + }, + { + "name": "--system", + "description": "Install packages into the system Python environment" + }, + { + "name": "--generate-hashes", + "description": "Include distribution hashes in the output file" + }, + { + "name": "--universal", + "description": "Perform a universal resolution" + }, + { + "name": [ + "-p", + "--python" + ], + "description": "The Python interpreter to use during resolution", + "args": { + "name": "PYTHON", + "generatorName": "python_versions" + } + }, + { + "name": [ + "-U", + "--upgrade" + ], + "description": "Allow package upgrades" + }, + { + "name": [ + "-n", + "--no-cache" + ], + "description": "Avoid reading from or writing to the cache" + }, + { + "name": "--cache-dir", + "description": "Path to the cache directory", + "args": { + "name": "CACHE_DIR", + "template": "folders" + } + } + ] + }, + { + "name": "sync", + "description": "Sync an environment with a requirements.txt or pylock.toml file", + "args": { + "name": "SRC_FILE", + "isVariadic": true, + "template": "filepaths" + }, + "options": [ + { + "name": [ + "-c", + "--constraints" + ], + "description": "Constrain versions using the given requirements files", + "isRepeatable": true, + "args": { + "name": "CONSTRAINTS", + "template": "filepaths" + } + }, + { + "name": "--require-hashes", + "description": "Require a matching hash for each requirement" + }, + { + "name": "--system", + "description": "Install packages into the system Python environment" + }, + { + "name": "--strict", + "description": "Validate the Python environment after installation" + }, + { + "name": "--dry-run", + "description": "Perform a dry run" + }, + { + "name": [ + "-p", + "--python" + ], + "description": "The Python interpreter into which packages should be installed", + "args": { + "name": "PYTHON", + "generatorName": "python_versions" + } + }, + { + "name": "--reinstall", + "description": "Reinstall all packages" + }, + { + "name": [ + "-n", + "--no-cache" + ], + "description": "Avoid reading from or writing to the cache" + }, + { + "name": "--cache-dir", + "description": "Path to the cache directory", + "args": { + "name": "CACHE_DIR", + "template": "folders" + } + } + ] + }, + { + "name": "install", + "description": "Install packages into an environment", + "args": { + "name": "PACKAGE", + "isOptional": true, + "isVariadic": true + }, + "options": [ + { + "name": [ + "-r", + "--requirements" + ], + "description": "Install the packages listed in the given files", + "isRepeatable": true, + "args": { + "name": "REQUIREMENTS", + "template": "filepaths" + } + }, + { + "name": [ + "-e", + "--editable" + ], + "description": "Install the editable package based on the provided local file path", + "isRepeatable": true, + "args": { + "name": "EDITABLE", + "template": "folders" + } + }, + { + "name": [ + "-c", + "--constraints" + ], + "description": "Constrain versions using the given requirements files", + "isRepeatable": true, + "args": { + "name": "CONSTRAINTS", + "template": "filepaths" + } + }, + { + "name": "--no-deps", + "description": "Ignore package dependencies" + }, + { + "name": "--require-hashes", + "description": "Require a matching hash for each requirement" + }, + { + "name": "--system", + "description": "Install packages into the system Python environment" + }, + { + "name": "--exact", + "description": "Perform an exact sync, removing extraneous packages" + }, + { + "name": "--strict", + "description": "Validate the Python environment after installation" + }, + { + "name": "--dry-run", + "description": "Perform a dry run" + }, + { + "name": [ + "-p", + "--python" + ], + "description": "The Python interpreter into which packages should be installed", + "args": { + "name": "PYTHON", + "generatorName": "python_versions" + } + }, + { + "name": [ + "-U", + "--upgrade" + ], + "description": "Allow package upgrades" + }, + { + "name": [ + "-P", + "--upgrade-package" + ], + "description": "Allow upgrades for a specific package", + "isRepeatable": true, + "args": { + "name": "UPGRADE_PACKAGE" + } + }, + { + "name": "--reinstall", + "description": "Reinstall all packages" + }, + { + "name": [ + "-n", + "--no-cache" + ], + "description": "Avoid reading from or writing to the cache" + }, + { + "name": "--cache-dir", + "description": "Path to the cache directory", + "args": { + "name": "CACHE_DIR", + "template": "folders" + } + } + ] + }, + { + "name": "uninstall", + "description": "Uninstall packages from an environment", + "args": { + "name": "PACKAGE", + "isOptional": true, + "isVariadic": true, + "generatorName": "pip_installed_packages" + }, + "options": [ + { + "name": [ + "-r", + "--requirements" + ], + "description": "Uninstall the packages listed in the given files", + "isRepeatable": true, + "args": { + "name": "REQUIREMENTS", + "template": "filepaths" + } + }, + { + "name": "--system", + "description": "Use the system Python to uninstall packages" + }, + { + "name": "--dry-run", + "description": "Perform a dry run" + }, + { + "name": [ + "-p", + "--python" + ], + "description": "The Python interpreter from which packages should be uninstalled", + "args": { + "name": "PYTHON", + "generatorName": "python_versions" + } + } + ] + }, + { + "name": "freeze", + "description": "List, in requirements format, packages installed in an environment", + "options": [ + { + "name": "--exclude-editable", + "description": "Exclude any editable packages from output" + }, + { + "name": "--exclude", + "description": "Exclude the specified package(s) from the output", + "isRepeatable": true, + "args": { + "name": "EXCLUDE" + } + }, + { + "name": "--strict", + "description": "Validate the Python environment" + }, + { + "name": "--system", + "description": "List packages in the system Python environment" + }, + { + "name": [ + "-p", + "--python" + ], + "description": "The Python interpreter for which packages should be listed", + "args": { + "name": "PYTHON", + "generatorName": "python_versions" + } + } + ] + }, + { + "name": "list", + "description": "List, in tabular format, packages installed in an environment", + "options": [ + { + "name": [ + "-e", + "--editable" + ], + "description": "Only include editable projects" + }, + { + "name": "--exclude-editable", + "description": "Exclude any editable packages from output" + }, + { + "name": "--exclude", + "description": "Exclude the specified package(s) from the output", + "isRepeatable": true, + "args": { + "name": "EXCLUDE" + } + }, + { + "name": "--format", + "description": "Select the output format", + "args": { + "name": "FORMAT", + "suggestions": [ + "columns", + "freeze", + "json" + ] + } + }, + { + "name": "--outdated", + "description": "List outdated packages" + }, + { + "name": "--strict", + "description": "Validate the Python environment" + }, + { + "name": "--system", + "description": "List packages in the system Python environment" + }, + { + "name": [ + "-p", + "--python" + ], + "description": "The Python interpreter for which packages should be listed", + "args": { + "name": "PYTHON", + "generatorName": "python_versions" + } + } + ] + }, + { + "name": "show", + "description": "Show information about one or more installed packages", + "args": { + "name": "PACKAGE", + "isOptional": true, + "isVariadic": true, + "generatorName": "pip_installed_packages" + }, + "options": [ + { + "name": "--strict", + "description": "Validate the Python environment" + }, + { + "name": [ + "-f", + "--files" + ], + "description": "Show the full list of installed files for each package" + }, + { + "name": "--system", + "description": "Show a package in the system Python environment" + }, + { + "name": [ + "-p", + "--python" + ], + "description": "The Python interpreter to find the package in", + "args": { + "name": "PYTHON", + "generatorName": "python_versions" + } + } + ] + }, + { + "name": "tree", + "description": "Display the dependency tree for an environment", + "options": [ + { + "name": "--show-version-specifiers", + "description": "Show the version constraint(s) imposed on each package" + }, + { + "name": [ + "-d", + "--depth" + ], + "description": "Maximum display depth of the dependency tree", + "args": { + "name": "DEPTH" + } + }, + { + "name": "--prune", + "description": "Prune the given package from the display", + "isRepeatable": true, + "args": { + "name": "PRUNE" + } + }, + { + "name": "--package", + "description": "Display only the specified packages", + "isRepeatable": true, + "args": { + "name": "PACKAGE" + } + }, + { + "name": "--no-dedupe", + "description": "Do not de-duplicate repeated dependencies" + }, + { + "name": "--invert", + "description": "Show the reverse dependencies" + }, + { + "name": "--outdated", + "description": "Show the latest available version of each package" + }, + { + "name": "--strict", + "description": "Validate the Python environment" + }, + { + "name": "--system", + "description": "List packages in the system Python environment" + }, + { + "name": [ + "-p", + "--python" + ], + "description": "The Python interpreter for which packages should be listed", + "args": { + "name": "PYTHON", + "generatorName": "python_versions" + } + } + ] + }, + { + "name": "check", + "description": "Verify installed packages have compatible dependencies", + "options": [ + { + "name": "--system", + "description": "Check packages in the system Python environment" + }, + { + "name": [ + "-p", + "--python" + ], + "description": "The Python interpreter for which packages should be checked", + "args": { + "name": "PYTHON", + "generatorName": "python_versions" + } + } + ] + } + ] + }, + { + "name": "venv", + "description": "Create a virtual environment", + "args": { + "name": "PATH", + "isOptional": true, + "template": "folders" + }, + "options": [ + { + "name": "--no-project", + "description": "Avoid discovering a project or workspace" + }, + { + "name": "--seed", + "description": "Install seed packages into the virtual environment" + }, + { + "name": [ + "-c", + "--clear" + ], + "description": "Remove any existing files or directories at the target path" + }, + { + "name": "--allow-existing", + "description": "Preserve any existing files or directories at the target path" + }, + { + "name": "--prompt", + "description": "Provide an alternative prompt prefix for the virtual environment", + "args": { + "name": "PROMPT" + } + }, + { + "name": "--system-site-packages", + "description": "Give the virtual environment access to the system site packages directory" + }, + { + "name": "--relocatable", + "description": "Make the virtual environment relocatable" + }, + { + "name": [ + "-p", + "--python" + ], + "description": "The Python interpreter to use for the virtual environment", + "args": { + "name": "PYTHON", + "generatorName": "python_versions" + } + }, + { + "name": "--link-mode", + "description": "The method to use when installing packages from the global cache", + "args": { + "name": "LINK_MODE", + "suggestions": [ + "clone", + "copy", + "hardlink", + "symlink" + ] + } + }, + { + "name": [ + "-n", + "--no-cache" + ], + "description": "Avoid reading from or writing to the cache" + }, + { + "name": "--cache-dir", + "description": "Path to the cache directory", + "args": { + "name": "CACHE_DIR", + "template": "folders" + } + } + ] + }, + { + "name": "build", + "description": "Build Python packages into source distributions and wheels", + "args": { + "name": "SRC", + "isOptional": true, + "template": "folders" + }, + "options": [ + { + "name": "--package", + "description": "Build a specific package in the workspace", + "args": { + "name": "PACKAGE" + } + }, + { + "name": "--all-packages", + "description": "Builds all packages in the workspace" + }, + { + "name": [ + "-o", + "--out-dir" + ], + "description": "The output directory to which distributions should be written", + "args": { + "name": "OUT_DIR", + "template": "folders" + } + }, + { + "name": "--sdist", + "description": "Build a source distribution" + }, + { + "name": "--wheel", + "description": "Build a binary distribution (wheel)" + }, + { + "name": "--no-build-logs", + "description": "Hide logs from the build backend" + }, + { + "name": "--clear", + "description": "Clear the output directory before the build" + }, + { + "name": [ + "-p", + "--python" + ], + "description": "The Python interpreter to use for the build environment", + "args": { + "name": "PYTHON", + "generatorName": "python_versions" + } + }, + { + "name": [ + "-n", + "--no-cache" + ], + "description": "Avoid reading from or writing to the cache" + }, + { + "name": "--cache-dir", + "description": "Path to the cache directory", + "args": { + "name": "CACHE_DIR", + "template": "folders" + } + } + ] + }, + { + "name": "publish", + "description": "Upload distributions to an index", + "args": { + "name": "FILES", + "isOptional": true, + "isVariadic": true, + "template": "filepaths" + }, + "options": [ + { + "name": "--index", + "description": "The name of an index in the configuration to use for publishing", + "args": { + "name": "INDEX" + } + }, + { + "name": [ + "-u", + "--username" + ], + "description": "The username for the upload", + "args": { + "name": "USERNAME" + } + }, + { + "name": [ + "-p", + "--password" + ], + "description": "The password for the upload", + "args": { + "name": "PASSWORD" + } + }, + { + "name": [ + "-t", + "--token" + ], + "description": "The token for the upload", + "args": { + "name": "TOKEN" + } + }, + { + "name": "--trusted-publishing", + "description": "Configure trusted publishing", + "args": { + "name": "TRUSTED_PUBLISHING", + "suggestions": [ + "automatic", + "always", + "never" + ] + } + }, + { + "name": "--publish-url", + "description": "The URL of the upload endpoint", + "args": { + "name": "PUBLISH_URL" + } + }, + { + "name": "--check-url", + "description": "Check an index URL for existing files to skip duplicate uploads", + "args": { + "name": "CHECK_URL" + } + }, + { + "name": "--dry-run", + "description": "Perform a dry run without uploading files" + }, + { + "name": "--no-attestations", + "description": "Do not upload attestations for the published files" + } + ] + }, + { + "name": "cache", + "description": "Manage uv's cache", + "subcommands": [ + { + "name": "clean", + "description": "Clear the cache, removing all entries or those linked to specific packages", + "args": { + "name": "PACKAGE", + "isOptional": true, + "isVariadic": true + }, + "options": [ + { + "name": "--force", + "description": "Force removal of the cache, ignoring in-use checks" + } + ] + }, + { + "name": "prune", + "description": "Prune all unreachable objects from the cache", + "options": [ + { + "name": "--ci", + "description": "Optimize the cache for persistence in a continuous integration environment" + }, + { + "name": "--force", + "description": "Force removal of the cache, ignoring in-use checks" + } + ] + }, + { + "name": "dir", + "description": "Show the cache directory" + }, + { + "name": "size", + "description": "Show the cache size", + "options": [ + { + "name": [ + "-H", + "--human" + ], + "description": "Display the cache size in human-readable format" + } + ] + } + ] + }, + { + "name": "self", + "description": "Manage the uv executable", + "subcommands": [ + { + "name": "update", + "description": "Update uv", + "args": { + "name": "TARGET_VERSION", + "isOptional": true + }, + "options": [ + { + "name": "--token", + "description": "A GitHub token for authentication", + "args": { + "name": "TOKEN" + } + }, + { + "name": "--dry-run", + "description": "Run without performing the update" + } + ] + } + ] + }, + { + "name": "auth", + "description": "Manage authentication", + "subcommands": [ + { + "name": "login", + "description": "Login to a service", + "args": { + "name": "SERVICE" + }, + "options": [ + { + "name": [ + "-u", + "--username" + ], + "description": "The username to use for the service", + "args": { + "name": "USERNAME" + } + }, + { + "name": "--password", + "description": "The password to use for the service", + "args": { + "name": "PASSWORD" + } + }, + { + "name": [ + "-t", + "--token" + ], + "description": "The token to use for the service", + "args": { + "name": "TOKEN" + } + }, + { + "name": "--keyring-provider", + "description": "The keyring provider to use for storage of credentials", + "args": { + "name": "KEYRING_PROVIDER", + "suggestions": [ + "disabled", + "subprocess" + ] + } + } + ] + }, + { + "name": "logout", + "description": "Logout of a service", + "args": { + "name": "SERVICE" + }, + "options": [ + { + "name": [ + "-u", + "--username" + ], + "description": "The username to logout", + "args": { + "name": "USERNAME" + } + }, + { + "name": "--keyring-provider", + "description": "The keyring provider to use for storage of credentials", + "args": { + "name": "KEYRING_PROVIDER", + "suggestions": [ + "disabled", + "subprocess" + ] + } + } + ] + }, + { + "name": "token", + "description": "Show the authentication token for a service", + "args": { + "name": "SERVICE" + }, + "options": [ + { + "name": [ + "-u", + "--username" + ], + "description": "The username to lookup", + "args": { + "name": "USERNAME" + } + }, + { + "name": "--keyring-provider", + "description": "The keyring provider to use for reading credentials", + "args": { + "name": "KEYRING_PROVIDER", + "suggestions": [ + "disabled", + "subprocess" + ] + } + } + ] + }, + { + "name": "dir", + "description": "Show the path to the uv credentials directory", + "args": { + "name": "SERVICE", + "isOptional": true + } + } + ] + }, + { + "name": "generate-shell-completion", + "description": "Generate shell completion", + "args": { + "name": "SHELL", + "suggestions": [ + "bash", + "elvish", + "fish", + "nushell", + "powershell", + "zsh" + ] + } + }, + { + "name": "help", + "description": "Display documentation for a command", + "args": { + "name": "COMMAND", + "isOptional": true, + "isVariadic": true, + "suggestions": [ + "run", + "init", + "add", + "remove", + "sync", + "lock", + "export", + "tree", + "version", + "format", + "audit", + "tool", + "python", + "pip", + "venv", + "build", + "publish", + "cache", + "self", + "auth", + "generate-shell-completion" + ] + } + } + ], + "options": [ + { + "name": [ + "-q", + "--quiet" + ], + "description": "Use quiet output" + }, + { + "name": [ + "-v", + "--verbose" + ], + "description": "Use verbose output" + }, + { + "name": "--color", + "description": "Control the use of color in output", + "args": { + "name": "COLOR_CHOICE", + "suggestions": [ + "auto", + "always", + "never" + ] + } + }, + { + "name": "--system-certs", + "description": "Whether to load TLS certificates from the platform's native certificate store" + }, + { + "name": "--offline", + "description": "Disable network access" + }, + { + "name": "--allow-insecure-host", + "description": "Allow insecure connections to a host", + "isRepeatable": true, + "args": { + "name": "ALLOW_INSECURE_HOST" + } + }, + { + "name": "--no-progress", + "description": "Hide all progress outputs" + }, + { + "name": "--directory", + "description": "Change to the given directory prior to running the command", + "args": { + "name": "DIRECTORY", + "template": "folders" + } + }, + { + "name": "--project", + "description": "Discover a project in the given directory", + "args": { + "name": "PROJECT", + "template": "folders" + } + }, + { + "name": "--config-file", + "description": "The path to a uv.toml file to use for configuration", + "args": { + "name": "CONFIG_FILE", + "template": "filepaths" + } + }, + { + "name": "--no-config", + "description": "Avoid discovering configuration files" + }, + { + "name": [ + "-h", + "--help" + ], + "description": "Display the concise help for this command" + }, + { + "name": [ + "-V", + "--version" + ], + "description": "Display the uv version" + }, + { + "name": [ + "-n", + "--no-cache" + ], + "description": "Avoid reading from or writing to the cache", + "isPersistent": true + }, + { + "name": "--cache-dir", + "description": "Path to the cache directory", + "isPersistent": true, + "args": { + "name": "CACHE_DIR", + "template": "folders" + } + }, + { + "name": "--managed-python", + "description": "Require use of uv-managed Python versions", + "isPersistent": true + }, + { + "name": "--no-managed-python", + "description": "Disable use of uv-managed Python versions", + "isPersistent": true + }, + { + "name": "--no-python-downloads", + "description": "Disable automatic downloads of Python", + "isPersistent": true + } + ] +} diff --git a/command-signatures/src/generators/mod.rs b/command-signatures/src/generators/mod.rs index e97e1426..501da2a2 100644 --- a/command-signatures/src/generators/mod.rs +++ b/command-signatures/src/generators/mod.rs @@ -64,6 +64,7 @@ mod timedatectl; mod tmux; mod tmuxinator; mod tsh; +mod uv; /// Used for gcloud and gsutil completions. mod gcloud; @@ -140,6 +141,7 @@ pub fn dynamic_command_signature_data() -> HashMap CommandSignatureGenerators { + CommandSignatureGenerators::new("uv") + .add_generator("installed_tools", installed_tools_generator()) + .add_generator("project_dependencies", project_dependencies_generator()) + .add_generator("pip_installed_packages", pip_installed_packages_generator()) + .add_generator("python_versions", python_versions_generator()) + .add_generator("installed_pythons", installed_pythons_generator()) +} + +/// Lists tools installed via `uv tool list`. +/// Output format: "toolname v1.2.3\n- executable1\n..." +/// We extract only the tool name lines (those starting with a non-whitespace character). +fn installed_tools_generator() -> Generator { + Generator::script( + CommandBuilder::single_command("uv tool list 2>/dev/null"), + |output| { + output + .lines() + .filter_map(|line| { + let trimmed = line.trim(); + // Skip empty lines and indented lines (executables are prefixed with "- ") + if trimmed.is_empty() || line.starts_with(' ') || line.starts_with('-') { + return None; + } + // Format: "toolname v1.2.3" — extract the tool name and version + let mut parts = trimmed.splitn(2, ' '); + let name = parts.next()?; + let version = parts.next().unwrap_or(""); + Some(Suggestion::with_description(name, version)) + }) + .collect_unordered_results() + }, + ) +} + +/// Lists project dependencies from pyproject.toml using Python to parse the TOML. +/// Falls back gracefully if no pyproject.toml exists. +fn project_dependencies_generator() -> Generator { + Generator::script( + CommandBuilder::single_command( + "python3 -c \"import tomllib,sys,pathlib; \ + p=pathlib.Path('pyproject.toml'); \ + d=tomllib.loads(p.read_text()) if p.exists() else {}; \ + deps=d.get('project',{}).get('dependencies',[]); \ + [print(dep.split('>')[0].split('<')[0].split('=')[0].split('!')[0].split('~')[0].split('[')[0].split(';')[0].strip()) for dep in deps]\" 2>/dev/null", + ), + |output| { + output + .lines() + .filter(|line| !line.trim().is_empty()) + .map(|line| Suggestion::new(line.trim())) + .collect_unordered_results() + }, + ) +} + +/// Lists pip-installed packages using `uv pip list --format freeze`. +fn pip_installed_packages_generator() -> Generator { + Generator::script( + CommandBuilder::single_command("uv pip list --format freeze 2>/dev/null"), + |output| { + output + .lines() + .filter_map(|line| { + let trimmed = line.trim(); + if trimmed.is_empty() { + return None; + } + // Format: "package==version" + let mut parts = trimmed.splitn(2, "=="); + let name = parts.next()?.trim(); + let version = parts.next().map(|v| v.trim()).unwrap_or(""); + if name.is_empty() { + return None; + } + Some(Suggestion::with_description(name, version)) + }) + .collect_unordered_results() + }, + ) +} + +/// Lists available Python versions from `uv python list --only-installed`. +/// Output format: "cpython-3.12.3-linux-x86_64-gnu /path/to/python" +fn python_versions_generator() -> Generator { + Generator::script( + CommandBuilder::single_command("uv python list --only-installed 2>/dev/null"), + |output| { + output + .lines() + .filter_map(|line| { + let trimmed = line.trim(); + if trimmed.is_empty() { + return None; + } + // Format: "cpython-3.12.3-linux-x86_64-gnu /path/to/python" + let mut parts = trimmed.split_whitespace(); + let version_str = parts.next()?; + let path = parts.next().unwrap_or(""); + Some(Suggestion::with_description(version_str, path)) + }) + .collect_unordered_results() + }, + ) +} + +/// Lists installed (managed) Python versions for uninstallation. +/// Same source as python_versions but specifically for `uv python uninstall`. +fn installed_pythons_generator() -> Generator { + Generator::script( + CommandBuilder::single_command("uv python list --only-installed 2>/dev/null"), + |output| { + output + .lines() + .filter_map(|line| { + let trimmed = line.trim(); + if trimmed.is_empty() { + return None; + } + let mut parts = trimmed.split_whitespace(); + let version_str = parts.next()?; + let path = parts.next().unwrap_or(""); + Some(Suggestion::with_description(version_str, path)) + }) + .collect_unordered_results() + }, + ) +}