From f2c4b9c752431f7238d7db87f858c67072e7c564 Mon Sep 17 00:00:00 2001 From: eth3lbert Date: Fri, 2 Aug 2024 20:55:50 +0800 Subject: [PATCH] Show default and possible options in CLI reference documentation (#5720) ## Summary Closes #5692 . --- crates/uv-dev/src/generate_cli_reference.rs | 45 + docs/reference/cli.md | 1627 +++++++++++++++++++ 2 files changed, 1672 insertions(+) diff --git a/crates/uv-dev/src/generate_cli_reference.rs b/crates/uv-dev/src/generate_cli_reference.rs index 5dfcfe75e..eec835e27 100644 --- a/crates/uv-dev/src/generate_cli_reference.rs +++ b/crates/uv-dev/src/generate_cli_reference.rs @@ -220,6 +220,8 @@ fn generate_command<'a>(output: &mut String, command: &'a Command, parents: &mut if let Some(help) = opt.get_long_help().or_else(|| opt.get_help()) { output.push_str("
"); output.push_str(&format!("{}\n", markdown::to_html(&help.to_string()))); + emit_default_option(opt, output); + emit_possible_options(opt, output); output.push_str("
"); } } @@ -240,6 +242,49 @@ fn generate_command<'a>(output: &mut String, command: &'a Command, parents: &mut parents.pop(); } +fn emit_default_option(opt: &clap::Arg, output: &mut String) { + if opt.is_hide_default_value_set() || !opt.get_num_args().expect("built").takes_values() { + return; + } + + let values = opt.get_default_values(); + if !values.is_empty() { + let value = format!( + "\n[default: {}]", + opt.get_default_values() + .iter() + .map(|s| s.to_string_lossy()) + .join(",") + ); + output.push_str(&markdown::to_html(&value)); + } +} + +fn emit_possible_options(opt: &clap::Arg, output: &mut String) { + if opt.is_hide_possible_values_set() { + return; + } + + let values = opt.get_possible_values(); + if !values.is_empty() { + let value = format!( + "\nPossible values:\n{}", + values + .into_iter() + .map(|value| { + let name = value.get_name(); + value.get_help().map_or_else( + || format!(" - `{name}`"), + |help| format!(" - `{name}`: {help}"), + ) + }) + .collect_vec() + .join("\n"), + ); + output.push_str(&markdown::to_html(&value)); + } +} + #[cfg(test)] mod tests { use std::env; diff --git a/docs/reference/cli.md b/docs/reference/cli.md index 55979ea40..f7051bcfe 100644 --- a/docs/reference/cli.md +++ b/docs/reference/cli.md @@ -140,20 +140,58 @@ uv pip compile [OPTIONS] ...

By default, uv will stop at the first index on which a given package is available, and limit resolutions to those present on that first index (first-match). This prevents "dependency confusion" attacks, whereby an attack can upload a malicious package under the same name to a secondary.

+

Possible values:

+ +
--keyring-provider keyring-provider

Attempt to use keyring for authentication for index URLs.

At present, only --keyring-provider subprocess is supported, which configures uv to use the keyring CLI to handle authentication.

Defaults to disabled.

+

Possible values:

+ +
    +
  • disabled: Do not use keyring for credential lookup
  • + +
  • subprocess: Use the keyring command for credential lookup
  • +
--resolution resolution

The strategy to use when selecting between the different compatible versions for a given package requirement.

By default, uv will use the latest compatible version of each package (highest).

+

Possible values:

+ +
    +
  • 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 prerelease

The strategy to use when considering pre-release versions.

By default, uv will accept pre-releases for packages that only publish pre-releases, along with first-party requirements that contain an explicit pre-release marker in the declared specifiers (if-necessary-or-explicit).

+

Possible values:

+ +
    +
  • disallow: Disallow all pre-release versions
  • + +
  • allow: Allow all pre-release versions
  • + +
  • if-necessary: Allow pre-release versions if all versions of a package are pre-release
  • + +
  • explicit: Allow pre-release versions for first-party packages with explicit pre-release markers in their version requirements
  • + +
  • if-necessary-or-explicit: Allow pre-release versions if all versions of a package are pre-release, or if the package has an explicit pre-release marker in its version requirements
  • +
--config-setting, -C config-setting

Settings to pass to the PEP 517 build backend, specified as KEY=VALUE pairs

--exclude-newer exclude-newer

Limit candidate packages to those that were uploaded prior to the given date.

@@ -166,6 +204,17 @@ uv pip compile [OPTIONS] ...

Defaults to clone (also known as Copy-on-Write) on macOS, and hardlink on Linux and Windows.

+

Possible values:

+ +
    +
  • clone: Clone (i.e., copy-on-write) packages from the wheel into the site-packages directory
  • + +
  • copy: Copy packages from the wheel into the site-packages directory
  • + +
  • hardlink: Hard link packages from the wheel into the site-packages directory
  • + +
  • symlink: Symbolically link packages from the wheel into the site-packages directory
  • +
--refresh-package refresh-package

Refresh cached data for a specific package

--output-file, -o output-file

Write the compiled requirements to the given requirements.txt file.

@@ -176,6 +225,13 @@ uv pip compile [OPTIONS] ...

Defaults to split.

+

Possible values:

+ +
    +
  • line: Render the annotations on a single, comma-separated line
  • + +
  • split: Render each annotation on its own line
  • +
--custom-compile-command custom-compile-command

The header comment to include at the top of the output file generated by uv pip compile.

Used to reflect custom build scripts and commands that wrap uv pip compile.

@@ -214,6 +270,41 @@ uv pip compile [OPTIONS] ...

Represented as a "target triple", a string that describes the target platform in terms of its CPU, vendor, and operating system name, like x86_64-unknown-linux-gnu or aaarch64-apple-darwin.

+

Possible values:

+ +
    +
  • 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: An x86 Windows target
  • + +
  • x86_64-unknown-linux-gnu: An x86 Linux target. Equivalent to x86_64-manylinux_2_17
  • + +
  • 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_17
  • + +
  • aarch64-unknown-linux-musl: An ARM64 Linux target
  • + +
  • x86_64-unknown-linux-musl: An x86_64 Linux target
  • + +
  • 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
  • + +
  • 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
  • +
--no-emit-package no-emit-package

Specify a package to omit from the output resolution. Its dependencies will still be included in the resolution. Equivalent to pip-compile’s --unsafe-package option

--cache-dir cache-dir

Path to the cache directory.

@@ -222,10 +313,38 @@ uv pip compile [OPTIONS] ...
--python-preference python-preference

Whether to prefer using Python installations that are already present on the system, or those that are downloaded and installed by uv

+

Possible values:

+ +
    +
  • only-managed: Only use managed Python installations; never use system Python installations
  • + +
  • managed: Prefer managed Python installations over system Python installations
  • + +
  • system: Prefer system Python installations over managed Python installations
  • + +
  • only-system: Only use system Python installations; never use managed Python installations
  • +
--python-fetch python-fetch

Whether to automatically download Python when required

+

Possible values:

+ +
    +
  • automatic: Automatically fetch managed Python installations when needed
  • + +
  • manual: Do not automatically fetch managed Python installations; require explicit installation
  • +
--color color-choice

Control colors in output

+

[default: auto]

+

Possible values:

+ +
    +
  • auto: Enables colored output only when the output is going to a terminal or TTY with support
  • + +
  • always: Enables colored output regardless of the detected environment
  • + +
  • never: Disables colored output
  • +
--config-file config-file

The path to a uv.toml file to use for configuration

@@ -286,12 +405,28 @@ uv pip sync [OPTIONS] ...

By default, uv will stop at the first index on which a given package is available, and limit resolutions to those present on that first index (first-match). This prevents "dependency confusion" attacks, whereby an attack can upload a malicious package under the same name to a secondary.

+

Possible values:

+ +
    +
  • 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 keyring-provider

Attempt to use keyring for authentication for index URLs.

At present, only --keyring-provider subprocess is supported, which configures uv to use the keyring CLI to handle authentication.

Defaults to disabled.

+

Possible values:

+ +
    +
  • disabled: Do not use keyring for credential lookup
  • + +
  • subprocess: Use the keyring command for credential lookup
  • +
--config-setting, -C config-setting

Settings to pass to the PEP 517 build backend, specified as KEY=VALUE pairs

--exclude-newer exclude-newer

Limit candidate packages to those that were uploaded prior to the given date.

@@ -302,6 +437,17 @@ uv pip sync [OPTIONS] ...

Defaults to clone (also known as Copy-on-Write) on macOS, and hardlink on Linux and Windows.

+

Possible values:

+ +
    +
  • clone: Clone (i.e., copy-on-write) packages from the wheel into the site-packages directory
  • + +
  • copy: Copy packages from the wheel into the site-packages directory
  • + +
  • hardlink: Hard link packages from the wheel into the site-packages directory
  • + +
  • symlink: Symbolically link packages from the wheel into the site-packages directory
  • +
--refresh-package refresh-package

Refresh cached data for a specific package

--python, -p python

The Python interpreter into which packages should be installed.

@@ -346,16 +492,79 @@ uv pip sync [OPTIONS] ...

WARNING: When specified, uv will select wheels that are compatible with the target platform; as a result, the installed distributions may not be compatible with the current platform. Conversely, any distributions that are built from source may be incompatible with the target platform, as they will be built for the current platform. The --python-platform option is intended for advanced use cases.

+

Possible values:

+ +
    +
  • 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: An x86 Windows target
  • + +
  • x86_64-unknown-linux-gnu: An x86 Linux target. Equivalent to x86_64-manylinux_2_17
  • + +
  • 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_17
  • + +
  • aarch64-unknown-linux-musl: An ARM64 Linux target
  • + +
  • x86_64-unknown-linux-musl: An x86_64 Linux target
  • + +
  • 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
  • + +
  • 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
  • +
--cache-dir cache-dir

Path to the cache directory.

Defaults to $HOME/Library/Caches/uv on macOS, $XDG_CACHE_HOME/uv or $HOME/.cache/uv on Linux, and {FOLDERID_LocalAppData}\uv\cache on Windows.

--python-preference python-preference

Whether to prefer using Python installations that are already present on the system, or those that are downloaded and installed by uv

+

Possible values:

+ +
    +
  • only-managed: Only use managed Python installations; never use system Python installations
  • + +
  • managed: Prefer managed Python installations over system Python installations
  • + +
  • system: Prefer system Python installations over managed Python installations
  • + +
  • only-system: Only use system Python installations; never use managed Python installations
  • +
--python-fetch python-fetch

Whether to automatically download Python when required

+

Possible values:

+ +
    +
  • automatic: Automatically fetch managed Python installations when needed
  • + +
  • manual: Do not automatically fetch managed Python installations; require explicit installation
  • +
--color color-choice

Control colors in output

+

[default: auto]

+

Possible values:

+ +
    +
  • auto: Enables colored output only when the output is going to a terminal or TTY with support
  • + +
  • always: Enables colored output regardless of the detected environment
  • + +
  • never: Disables colored output
  • +
--config-file config-file

The path to a uv.toml file to use for configuration

@@ -432,20 +641,58 @@ uv pip install [OPTIONS] |--editable By default, uv will stop at the first index on which a given package is available, and limit resolutions to those present on that first index (first-match). This prevents "dependency confusion" attacks, whereby an attack can upload a malicious package under the same name to a secondary.

+

Possible values:

+ +
    +
  • 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 keyring-provider

Attempt to use keyring for authentication for index URLs.

At present, only --keyring-provider subprocess is supported, which configures uv to use the keyring CLI to handle authentication.

Defaults to disabled.

+

Possible values:

+ +
    +
  • disabled: Do not use keyring for credential lookup
  • + +
  • subprocess: Use the keyring command for credential lookup
  • +
--resolution resolution

The strategy to use when selecting between the different compatible versions for a given package requirement.

By default, uv will use the latest compatible version of each package (highest).

+

Possible values:

+ +
    +
  • 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 prerelease

The strategy to use when considering pre-release versions.

By default, uv will accept pre-releases for packages that only publish pre-releases, along with first-party requirements that contain an explicit pre-release marker in the declared specifiers (if-necessary-or-explicit).

+

Possible values:

+ +
    +
  • disallow: Disallow all pre-release versions
  • + +
  • allow: Allow all pre-release versions
  • + +
  • if-necessary: Allow pre-release versions if all versions of a package are pre-release
  • + +
  • explicit: Allow pre-release versions for first-party packages with explicit pre-release markers in their version requirements
  • + +
  • if-necessary-or-explicit: Allow pre-release versions if all versions of a package are pre-release, or if the package has an explicit pre-release marker in its version requirements
  • +
--config-setting, -C config-setting

Settings to pass to the PEP 517 build backend, specified as KEY=VALUE pairs

--exclude-newer exclude-newer

Limit candidate packages to those that were uploaded prior to the given date.

@@ -456,6 +703,17 @@ uv pip install [OPTIONS] |--editable Defaults to clone (also known as Copy-on-Write) on macOS, and hardlink on Linux and Windows.

+

Possible values:

+ +
    +
  • clone: Clone (i.e., copy-on-write) packages from the wheel into the site-packages directory
  • + +
  • copy: Copy packages from the wheel into the site-packages directory
  • + +
  • hardlink: Hard link packages from the wheel into the site-packages directory
  • + +
  • symlink: Symbolically link packages from the wheel into the site-packages directory
  • +
--refresh-package refresh-package

Refresh cached data for a specific package

--python, -p python

The Python interpreter into which packages should be installed.

@@ -500,16 +758,79 @@ uv pip install [OPTIONS] |--editable WARNING: When specified, uv will select wheels that are compatible with the target platform; as a result, the installed distributions may not be compatible with the current platform. Conversely, any distributions that are built from source may be incompatible with the target platform, as they will be built for the current platform. The --python-platform option is intended for advanced use cases.

+

Possible values:

+ +
    +
  • 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: An x86 Windows target
  • + +
  • x86_64-unknown-linux-gnu: An x86 Linux target. Equivalent to x86_64-manylinux_2_17
  • + +
  • 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_17
  • + +
  • aarch64-unknown-linux-musl: An ARM64 Linux target
  • + +
  • x86_64-unknown-linux-musl: An x86_64 Linux target
  • + +
  • 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
  • + +
  • 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
  • +
--cache-dir cache-dir

Path to the cache directory.

Defaults to $HOME/Library/Caches/uv on macOS, $XDG_CACHE_HOME/uv or $HOME/.cache/uv on Linux, and {FOLDERID_LocalAppData}\uv\cache on Windows.

--python-preference python-preference

Whether to prefer using Python installations that are already present on the system, or those that are downloaded and installed by uv

+

Possible values:

+ +
    +
  • only-managed: Only use managed Python installations; never use system Python installations
  • + +
  • managed: Prefer managed Python installations over system Python installations
  • + +
  • system: Prefer system Python installations over managed Python installations
  • + +
  • only-system: Only use system Python installations; never use managed Python installations
  • +
--python-fetch python-fetch

Whether to automatically download Python when required

+

Possible values:

+ +
    +
  • automatic: Automatically fetch managed Python installations when needed
  • + +
  • manual: Do not automatically fetch managed Python installations; require explicit installation
  • +
--color color-choice

Control colors in output

+

[default: auto]

+

Possible values:

+ +
    +
  • auto: Enables colored output only when the output is going to a terminal or TTY with support
  • + +
  • always: Enables colored output regardless of the detected environment
  • + +
  • never: Disables colored output
  • +
--config-file config-file

The path to a uv.toml file to use for configuration

@@ -554,6 +875,13 @@ uv pip uninstall [OPTIONS] >

Defaults to disabled.

+

Possible values:

+ +
    +
  • disabled: Do not use keyring for credential lookup
  • + +
  • subprocess: Use the keyring command for credential lookup
  • +
--target target

Uninstall packages from the specified --target directory

--prefix prefix

Uninstall packages from the specified --prefix directory

@@ -564,10 +892,38 @@ uv pip uninstall [OPTIONS] >
--python-preference python-preference

Whether to prefer using Python installations that are already present on the system, or those that are downloaded and installed by uv

+

Possible values:

+ +
    +
  • only-managed: Only use managed Python installations; never use system Python installations
  • + +
  • managed: Prefer managed Python installations over system Python installations
  • + +
  • system: Prefer system Python installations over managed Python installations
  • + +
  • only-system: Only use system Python installations; never use managed Python installations
  • +
--python-fetch python-fetch

Whether to automatically download Python when required

+

Possible values:

+ +
    +
  • automatic: Automatically fetch managed Python installations when needed
  • + +
  • manual: Do not automatically fetch managed Python installations; require explicit installation
  • +
--color color-choice

Control colors in output

+

[default: auto]

+

Possible values:

+ +
    +
  • auto: Enables colored output only when the output is going to a terminal or TTY with support
  • + +
  • always: Enables colored output regardless of the detected environment
  • + +
  • never: Disables colored output
  • +
--config-file config-file

The path to a uv.toml file to use for configuration

@@ -604,10 +960,38 @@ uv pip freeze [OPTIONS]
--python-preference python-preference

Whether to prefer using Python installations that are already present on the system, or those that are downloaded and installed by uv

+

Possible values:

+ +
    +
  • only-managed: Only use managed Python installations; never use system Python installations
  • + +
  • managed: Prefer managed Python installations over system Python installations
  • + +
  • system: Prefer system Python installations over managed Python installations
  • + +
  • only-system: Only use system Python installations; never use managed Python installations
  • +
--python-fetch python-fetch

Whether to automatically download Python when required

+

Possible values:

+ +
    +
  • automatic: Automatically fetch managed Python installations when needed
  • + +
  • manual: Do not automatically fetch managed Python installations; require explicit installation
  • +
--color color-choice

Control colors in output

+

[default: auto]

+

Possible values:

+ +
    +
  • auto: Enables colored output only when the output is going to a terminal or TTY with support
  • + +
  • always: Enables colored output regardless of the detected environment
  • + +
  • never: Disables colored output
  • +
--config-file config-file

The path to a uv.toml file to use for configuration

@@ -628,6 +1012,16 @@ uv pip list [OPTIONS]
--format format

Select the output format between: columns (default), freeze, or json

+

[default: columns]

+

Possible values:

+ +
    +
  • columns: Display the list of packages in a human-readable table
  • + +
  • freeze: Display the list of packages in a pip freeze-like format, with one package per line alongside its version
  • + +
  • json: Display the list of packages in a machine-readable JSON format
  • +
--python, -p python

The Python interpreter for which packages should be listed.

By default, uv lists packages in the currently activated virtual environment, or a virtual environment (.venv) located in the current working directory or any parent directory, falling back to the system Python if no virtual environment is found.

@@ -648,10 +1042,38 @@ uv pip list [OPTIONS]
--python-preference python-preference

Whether to prefer using Python installations that are already present on the system, or those that are downloaded and installed by uv

+

Possible values:

+ +
    +
  • only-managed: Only use managed Python installations; never use system Python installations
  • + +
  • managed: Prefer managed Python installations over system Python installations
  • + +
  • system: Prefer system Python installations over managed Python installations
  • + +
  • only-system: Only use system Python installations; never use managed Python installations
  • +
--python-fetch python-fetch

Whether to automatically download Python when required

+

Possible values:

+ +
    +
  • automatic: Automatically fetch managed Python installations when needed
  • + +
  • manual: Do not automatically fetch managed Python installations; require explicit installation
  • +
--color color-choice

Control colors in output

+

[default: auto]

+

Possible values:

+ +
    +
  • auto: Enables colored output only when the output is going to a terminal or TTY with support
  • + +
  • always: Enables colored output regardless of the detected environment
  • + +
  • never: Disables colored output
  • +
--config-file config-file

The path to a uv.toml file to use for configuration

@@ -694,10 +1116,38 @@ uv pip show [OPTIONS] [PACKAGE]...
--python-preference python-preference

Whether to prefer using Python installations that are already present on the system, or those that are downloaded and installed by uv

+

Possible values:

+ +
    +
  • only-managed: Only use managed Python installations; never use system Python installations
  • + +
  • managed: Prefer managed Python installations over system Python installations
  • + +
  • system: Prefer system Python installations over managed Python installations
  • + +
  • only-system: Only use system Python installations; never use managed Python installations
  • +
--python-fetch python-fetch

Whether to automatically download Python when required

+

Possible values:

+ +
    +
  • automatic: Automatically fetch managed Python installations when needed
  • + +
  • manual: Do not automatically fetch managed Python installations; require explicit installation
  • +
--color color-choice

Control colors in output

+

[default: auto]

+

Possible values:

+ +
    +
  • auto: Enables colored output only when the output is going to a terminal or TTY with support
  • + +
  • always: Enables colored output regardless of the detected environment
  • + +
  • never: Disables colored output
  • +
--config-file config-file

The path to a uv.toml file to use for configuration

@@ -716,6 +1166,7 @@ uv pip tree [OPTIONS]
--depth, -d depth

Maximum display depth of the dependency tree

+

[default: 255]

--prune prune

Prune the given package from the display of the dependency tree

--package package

Display only the specified packages

@@ -740,10 +1191,38 @@ uv pip tree [OPTIONS]
--python-preference python-preference

Whether to prefer using Python installations that are already present on the system, or those that are downloaded and installed by uv

+

Possible values:

+ +
    +
  • only-managed: Only use managed Python installations; never use system Python installations
  • + +
  • managed: Prefer managed Python installations over system Python installations
  • + +
  • system: Prefer system Python installations over managed Python installations
  • + +
  • only-system: Only use system Python installations; never use managed Python installations
  • +
--python-fetch python-fetch

Whether to automatically download Python when required

+

Possible values:

+ +
    +
  • automatic: Automatically fetch managed Python installations when needed
  • + +
  • manual: Do not automatically fetch managed Python installations; require explicit installation
  • +
--color color-choice

Control colors in output

+

[default: auto]

+

Possible values:

+ +
    +
  • auto: Enables colored output only when the output is going to a terminal or TTY with support
  • + +
  • always: Enables colored output regardless of the detected environment
  • + +
  • never: Disables colored output
  • +
--config-file config-file

The path to a uv.toml file to use for configuration

@@ -780,10 +1259,38 @@ uv pip check [OPTIONS]
--python-preference python-preference

Whether to prefer using Python installations that are already present on the system, or those that are downloaded and installed by uv

+

Possible values:

+ +
    +
  • only-managed: Only use managed Python installations; never use system Python installations
  • + +
  • managed: Prefer managed Python installations over system Python installations
  • + +
  • system: Prefer system Python installations over managed Python installations
  • + +
  • only-system: Only use system Python installations; never use managed Python installations
  • +
--python-fetch python-fetch

Whether to automatically download Python when required

+

Possible values:

+ +
    +
  • automatic: Automatically fetch managed Python installations when needed
  • + +
  • manual: Do not automatically fetch managed Python installations; require explicit installation
  • +
--color color-choice

Control colors in output

+

[default: auto]

+

Possible values:

+ +
    +
  • auto: Enables colored output only when the output is going to a terminal or TTY with support
  • + +
  • always: Enables colored output regardless of the detected environment
  • + +
  • never: Disables colored output
  • +
--config-file config-file

The path to a uv.toml file to use for configuration

@@ -860,20 +1367,58 @@ uv tool run [OPTIONS] [COMMAND]

By default, uv will stop at the first index on which a given package is available, and limit resolutions to those present on that first index (first-match). This prevents "dependency confusion" attacks, whereby an attack can upload a malicious package under the same name to a secondary.

+

Possible values:

+ +
    +
  • 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 keyring-provider

Attempt to use keyring for authentication for index URLs.

At present, only --keyring-provider subprocess is supported, which configures uv to use the keyring CLI to handle authentication.

Defaults to disabled.

+

Possible values:

+ +
    +
  • disabled: Do not use keyring for credential lookup
  • + +
  • subprocess: Use the keyring command for credential lookup
  • +
--resolution resolution

The strategy to use when selecting between the different compatible versions for a given package requirement.

By default, uv will use the latest compatible version of each package (highest).

+

Possible values:

+ +
    +
  • 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 prerelease

The strategy to use when considering pre-release versions.

By default, uv will accept pre-releases for packages that only publish pre-releases, along with first-party requirements that contain an explicit pre-release marker in the declared specifiers (if-necessary-or-explicit).

+

Possible values:

+ +
    +
  • disallow: Disallow all pre-release versions
  • + +
  • allow: Allow all pre-release versions
  • + +
  • if-necessary: Allow pre-release versions if all versions of a package are pre-release
  • + +
  • explicit: Allow pre-release versions for first-party packages with explicit pre-release markers in their version requirements
  • + +
  • if-necessary-or-explicit: Allow pre-release versions if all versions of a package are pre-release, or if the package has an explicit pre-release marker in its version requirements
  • +
--config-setting, -C config-setting

Settings to pass to the PEP 517 build backend, specified as KEY=VALUE pairs

--exclude-newer exclude-newer

Limit candidate packages to those that were uploaded prior to the given date.

@@ -884,6 +1429,17 @@ uv tool run [OPTIONS] [COMMAND]

Defaults to clone (also known as Copy-on-Write) on macOS, and hardlink on Linux and Windows.

+

Possible values:

+ +
    +
  • clone: Clone (i.e., copy-on-write) packages from the wheel into the site-packages directory
  • + +
  • copy: Copy packages from the wheel into the site-packages directory
  • + +
  • hardlink: Hard link packages from the wheel into the site-packages directory
  • + +
  • symlink: Symbolically link packages from the wheel into the site-packages directory
  • +
--no-build-package no-build-package

Don’t build source distributions for a specific package

--no-binary-package no-binary-package

Don’t install pre-built wheels for a specific package

@@ -910,10 +1466,38 @@ uv tool run [OPTIONS] [COMMAND]
--python-preference python-preference

Whether to prefer using Python installations that are already present on the system, or those that are downloaded and installed by uv

+

Possible values:

+ +
    +
  • only-managed: Only use managed Python installations; never use system Python installations
  • + +
  • managed: Prefer managed Python installations over system Python installations
  • + +
  • system: Prefer system Python installations over managed Python installations
  • + +
  • only-system: Only use system Python installations; never use managed Python installations
  • +
--python-fetch python-fetch

Whether to automatically download Python when required

+

Possible values:

+ +
    +
  • automatic: Automatically fetch managed Python installations when needed
  • + +
  • manual: Do not automatically fetch managed Python installations; require explicit installation
  • +
--color color-choice

Control colors in output

+

[default: auto]

+

Possible values:

+ +
    +
  • auto: Enables colored output only when the output is going to a terminal or TTY with support
  • + +
  • always: Enables colored output regardless of the detected environment
  • + +
  • never: Disables colored output
  • +
--config-file config-file

The path to a uv.toml file to use for configuration

@@ -966,20 +1550,58 @@ uv tool install [OPTIONS]

By default, uv will stop at the first index on which a given package is available, and limit resolutions to those present on that first index (first-match). This prevents "dependency confusion" attacks, whereby an attack can upload a malicious package under the same name to a secondary.

+

Possible values:

+ +
    +
  • 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 keyring-provider

Attempt to use keyring for authentication for index URLs.

At present, only --keyring-provider subprocess is supported, which configures uv to use the keyring CLI to handle authentication.

Defaults to disabled.

+

Possible values:

+ +
    +
  • disabled: Do not use keyring for credential lookup
  • + +
  • subprocess: Use the keyring command for credential lookup
  • +
--resolution resolution

The strategy to use when selecting between the different compatible versions for a given package requirement.

By default, uv will use the latest compatible version of each package (highest).

+

Possible values:

+ +
    +
  • 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 prerelease

The strategy to use when considering pre-release versions.

By default, uv will accept pre-releases for packages that only publish pre-releases, along with first-party requirements that contain an explicit pre-release marker in the declared specifiers (if-necessary-or-explicit).

+

Possible values:

+ +
    +
  • disallow: Disallow all pre-release versions
  • + +
  • allow: Allow all pre-release versions
  • + +
  • if-necessary: Allow pre-release versions if all versions of a package are pre-release
  • + +
  • explicit: Allow pre-release versions for first-party packages with explicit pre-release markers in their version requirements
  • + +
  • if-necessary-or-explicit: Allow pre-release versions if all versions of a package are pre-release, or if the package has an explicit pre-release marker in its version requirements
  • +
--config-setting, -C config-setting

Settings to pass to the PEP 517 build backend, specified as KEY=VALUE pairs

--exclude-newer exclude-newer

Limit candidate packages to those that were uploaded prior to the given date.

@@ -990,6 +1612,17 @@ uv tool install [OPTIONS]

Defaults to clone (also known as Copy-on-Write) on macOS, and hardlink on Linux and Windows.

+

Possible values:

+ +
    +
  • clone: Clone (i.e., copy-on-write) packages from the wheel into the site-packages directory
  • + +
  • copy: Copy packages from the wheel into the site-packages directory
  • + +
  • hardlink: Hard link packages from the wheel into the site-packages directory
  • + +
  • symlink: Symbolically link packages from the wheel into the site-packages directory
  • +
--no-build-package no-build-package

Don’t build source distributions for a specific package

--no-binary-package no-binary-package

Don’t install pre-built wheels for a specific package

@@ -1016,10 +1649,38 @@ uv tool install [OPTIONS]
--python-preference python-preference

Whether to prefer using Python installations that are already present on the system, or those that are downloaded and installed by uv

+

Possible values:

+ +
    +
  • only-managed: Only use managed Python installations; never use system Python installations
  • + +
  • managed: Prefer managed Python installations over system Python installations
  • + +
  • system: Prefer system Python installations over managed Python installations
  • + +
  • only-system: Only use system Python installations; never use managed Python installations
  • +
--python-fetch python-fetch

Whether to automatically download Python when required

+

Possible values:

+ +
    +
  • automatic: Automatically fetch managed Python installations when needed
  • + +
  • manual: Do not automatically fetch managed Python installations; require explicit installation
  • +
--color color-choice

Control colors in output

+

[default: auto]

+

Possible values:

+ +
    +
  • auto: Enables colored output only when the output is going to a terminal or TTY with support
  • + +
  • always: Enables colored output regardless of the detected environment
  • + +
  • never: Disables colored output
  • +
--config-file config-file

The path to a uv.toml file to use for configuration

@@ -1042,10 +1703,38 @@ uv tool list [OPTIONS]
--python-preference python-preference

Whether to prefer using Python installations that are already present on the system, or those that are downloaded and installed by uv

+

Possible values:

+ +
    +
  • only-managed: Only use managed Python installations; never use system Python installations
  • + +
  • managed: Prefer managed Python installations over system Python installations
  • + +
  • system: Prefer system Python installations over managed Python installations
  • + +
  • only-system: Only use system Python installations; never use managed Python installations
  • +
--python-fetch python-fetch

Whether to automatically download Python when required

+

Possible values:

+ +
    +
  • automatic: Automatically fetch managed Python installations when needed
  • + +
  • manual: Do not automatically fetch managed Python installations; require explicit installation
  • +
--color color-choice

Control colors in output

+

[default: auto]

+

Possible values:

+ +
    +
  • auto: Enables colored output only when the output is going to a terminal or TTY with support
  • + +
  • always: Enables colored output regardless of the detected environment
  • + +
  • never: Disables colored output
  • +
--config-file config-file

The path to a uv.toml file to use for configuration

@@ -1074,10 +1763,38 @@ uv tool uninstall [OPTIONS]
--python-preference python-preference

Whether to prefer using Python installations that are already present on the system, or those that are downloaded and installed by uv

+

Possible values:

+ +
    +
  • only-managed: Only use managed Python installations; never use system Python installations
  • + +
  • managed: Prefer managed Python installations over system Python installations
  • + +
  • system: Prefer system Python installations over managed Python installations
  • + +
  • only-system: Only use system Python installations; never use managed Python installations
  • +
--python-fetch python-fetch

Whether to automatically download Python when required

+

Possible values:

+ +
    +
  • automatic: Automatically fetch managed Python installations when needed
  • + +
  • manual: Do not automatically fetch managed Python installations; require explicit installation
  • +
--color color-choice

Control colors in output

+

[default: auto]

+

Possible values:

+ +
    +
  • auto: Enables colored output only when the output is going to a terminal or TTY with support
  • + +
  • always: Enables colored output regardless of the detected environment
  • + +
  • never: Disables colored output
  • +
--config-file config-file

The path to a uv.toml file to use for configuration

@@ -1100,10 +1817,38 @@ uv tool update-shell [OPTIONS]
--python-preference python-preference

Whether to prefer using Python installations that are already present on the system, or those that are downloaded and installed by uv

+

Possible values:

+ +
    +
  • only-managed: Only use managed Python installations; never use system Python installations
  • + +
  • managed: Prefer managed Python installations over system Python installations
  • + +
  • system: Prefer system Python installations over managed Python installations
  • + +
  • only-system: Only use system Python installations; never use managed Python installations
  • +
--python-fetch python-fetch

Whether to automatically download Python when required

+

Possible values:

+ +
    +
  • automatic: Automatically fetch managed Python installations when needed
  • + +
  • manual: Do not automatically fetch managed Python installations; require explicit installation
  • +
--color color-choice

Control colors in output

+

[default: auto]

+

Possible values:

+ +
    +
  • auto: Enables colored output only when the output is going to a terminal or TTY with support
  • + +
  • always: Enables colored output regardless of the detected environment
  • + +
  • never: Disables colored output
  • +
--config-file config-file

The path to a uv.toml file to use for configuration

@@ -1126,10 +1871,38 @@ uv tool dir [OPTIONS]
--python-preference python-preference

Whether to prefer using Python installations that are already present on the system, or those that are downloaded and installed by uv

+

Possible values:

+ +
    +
  • only-managed: Only use managed Python installations; never use system Python installations
  • + +
  • managed: Prefer managed Python installations over system Python installations
  • + +
  • system: Prefer system Python installations over managed Python installations
  • + +
  • only-system: Only use system Python installations; never use managed Python installations
  • +
--python-fetch python-fetch

Whether to automatically download Python when required

+

Possible values:

+ +
    +
  • automatic: Automatically fetch managed Python installations when needed
  • + +
  • manual: Do not automatically fetch managed Python installations; require explicit installation
  • +
--color color-choice

Control colors in output

+

[default: auto]

+

Possible values:

+ +
    +
  • auto: Enables colored output only when the output is going to a terminal or TTY with support
  • + +
  • always: Enables colored output regardless of the detected environment
  • + +
  • never: Disables colored output
  • +
--config-file config-file

The path to a uv.toml file to use for configuration

@@ -1178,10 +1951,38 @@ uv python list [OPTIONS]
--python-preference python-preference

Whether to prefer using Python installations that are already present on the system, or those that are downloaded and installed by uv

+

Possible values:

+ +
    +
  • only-managed: Only use managed Python installations; never use system Python installations
  • + +
  • managed: Prefer managed Python installations over system Python installations
  • + +
  • system: Prefer system Python installations over managed Python installations
  • + +
  • only-system: Only use system Python installations; never use managed Python installations
  • +
--python-fetch python-fetch

Whether to automatically download Python when required

+

Possible values:

+ +
    +
  • automatic: Automatically fetch managed Python installations when needed
  • + +
  • manual: Do not automatically fetch managed Python installations; require explicit installation
  • +
--color color-choice

Control colors in output

+

[default: auto]

+

Possible values:

+ +
    +
  • auto: Enables colored output only when the output is going to a terminal or TTY with support
  • + +
  • always: Enables colored output regardless of the detected environment
  • + +
  • never: Disables colored output
  • +
--config-file config-file

The path to a uv.toml file to use for configuration

@@ -1212,10 +2013,38 @@ uv python install [OPTIONS] [TARGETS]...
--python-preference python-preference

Whether to prefer using Python installations that are already present on the system, or those that are downloaded and installed by uv

+

Possible values:

+ +
    +
  • only-managed: Only use managed Python installations; never use system Python installations
  • + +
  • managed: Prefer managed Python installations over system Python installations
  • + +
  • system: Prefer system Python installations over managed Python installations
  • + +
  • only-system: Only use system Python installations; never use managed Python installations
  • +
--python-fetch python-fetch

Whether to automatically download Python when required

+

Possible values:

+ +
    +
  • automatic: Automatically fetch managed Python installations when needed
  • + +
  • manual: Do not automatically fetch managed Python installations; require explicit installation
  • +
--color color-choice

Control colors in output

+

[default: auto]

+

Possible values:

+ +
    +
  • auto: Enables colored output only when the output is going to a terminal or TTY with support
  • + +
  • always: Enables colored output regardless of the detected environment
  • + +
  • never: Disables colored output
  • +
--config-file config-file

The path to a uv.toml file to use for configuration

@@ -1244,10 +2073,38 @@ uv python find [OPTIONS] [REQUEST]
--python-preference python-preference

Whether to prefer using Python installations that are already present on the system, or those that are downloaded and installed by uv

+

Possible values:

+ +
    +
  • only-managed: Only use managed Python installations; never use system Python installations
  • + +
  • managed: Prefer managed Python installations over system Python installations
  • + +
  • system: Prefer system Python installations over managed Python installations
  • + +
  • only-system: Only use system Python installations; never use managed Python installations
  • +
--python-fetch python-fetch

Whether to automatically download Python when required

+

Possible values:

+ +
    +
  • automatic: Automatically fetch managed Python installations when needed
  • + +
  • manual: Do not automatically fetch managed Python installations; require explicit installation
  • +
--color color-choice

Control colors in output

+

[default: auto]

+

Possible values:

+ +
    +
  • auto: Enables colored output only when the output is going to a terminal or TTY with support
  • + +
  • always: Enables colored output regardless of the detected environment
  • + +
  • never: Disables colored output
  • +
--config-file config-file

The path to a uv.toml file to use for configuration

@@ -1276,10 +2133,38 @@ uv python pin [OPTIONS] [REQUEST]
--python-preference python-preference

Whether to prefer using Python installations that are already present on the system, or those that are downloaded and installed by uv

+

Possible values:

+ +
    +
  • only-managed: Only use managed Python installations; never use system Python installations
  • + +
  • managed: Prefer managed Python installations over system Python installations
  • + +
  • system: Prefer system Python installations over managed Python installations
  • + +
  • only-system: Only use system Python installations; never use managed Python installations
  • +
--python-fetch python-fetch

Whether to automatically download Python when required

+

Possible values:

+ +
    +
  • automatic: Automatically fetch managed Python installations when needed
  • + +
  • manual: Do not automatically fetch managed Python installations; require explicit installation
  • +
--color color-choice

Control colors in output

+

[default: auto]

+

Possible values:

+ +
    +
  • auto: Enables colored output only when the output is going to a terminal or TTY with support
  • + +
  • always: Enables colored output regardless of the detected environment
  • + +
  • never: Disables colored output
  • +
--config-file config-file

The path to a uv.toml file to use for configuration

@@ -1302,10 +2187,38 @@ uv python dir [OPTIONS]
--python-preference python-preference

Whether to prefer using Python installations that are already present on the system, or those that are downloaded and installed by uv

+

Possible values:

+ +
    +
  • only-managed: Only use managed Python installations; never use system Python installations
  • + +
  • managed: Prefer managed Python installations over system Python installations
  • + +
  • system: Prefer system Python installations over managed Python installations
  • + +
  • only-system: Only use system Python installations; never use managed Python installations
  • +
--python-fetch python-fetch

Whether to automatically download Python when required

+

Possible values:

+ +
    +
  • automatic: Automatically fetch managed Python installations when needed
  • + +
  • manual: Do not automatically fetch managed Python installations; require explicit installation
  • +
--color color-choice

Control colors in output

+

[default: auto]

+

Possible values:

+ +
    +
  • auto: Enables colored output only when the output is going to a terminal or TTY with support
  • + +
  • always: Enables colored output regardless of the detected environment
  • + +
  • never: Disables colored output
  • +
--config-file config-file

The path to a uv.toml file to use for configuration

@@ -1334,10 +2247,38 @@ uv python uninstall [OPTIONS] ...
--python-preference python-preference

Whether to prefer using Python installations that are already present on the system, or those that are downloaded and installed by uv

+

Possible values:

+ +
    +
  • only-managed: Only use managed Python installations; never use system Python installations
  • + +
  • managed: Prefer managed Python installations over system Python installations
  • + +
  • system: Prefer system Python installations over managed Python installations
  • + +
  • only-system: Only use system Python installations; never use managed Python installations
  • +
--python-fetch python-fetch

Whether to automatically download Python when required

+

Possible values:

+ +
    +
  • automatic: Automatically fetch managed Python installations when needed
  • + +
  • manual: Do not automatically fetch managed Python installations; require explicit installation
  • +
--color color-choice

Control colors in output

+

[default: auto]

+

Possible values:

+ +
    +
  • auto: Enables colored output only when the output is going to a terminal or TTY with support
  • + +
  • always: Enables colored output regardless of the detected environment
  • + +
  • never: Disables colored output
  • +
--config-file config-file

The path to a uv.toml file to use for configuration

@@ -1382,10 +2323,38 @@ uv init [OPTIONS] [PATH]
--python-preference python-preference

Whether to prefer using Python installations that are already present on the system, or those that are downloaded and installed by uv

+

Possible values:

+ +
    +
  • only-managed: Only use managed Python installations; never use system Python installations
  • + +
  • managed: Prefer managed Python installations over system Python installations
  • + +
  • system: Prefer system Python installations over managed Python installations
  • + +
  • only-system: Only use system Python installations; never use managed Python installations
  • +
--python-fetch python-fetch

Whether to automatically download Python when required

+

Possible values:

+ +
    +
  • automatic: Automatically fetch managed Python installations when needed
  • + +
  • manual: Do not automatically fetch managed Python installations; require explicit installation
  • +
--color color-choice

Control colors in output

+

[default: auto]

+

Possible values:

+ +
    +
  • auto: Enables colored output only when the output is going to a terminal or TTY with support
  • + +
  • always: Enables colored output regardless of the detected environment
  • + +
  • never: Disables colored output
  • +
--config-file config-file

The path to a uv.toml file to use for configuration

@@ -1438,20 +2407,58 @@ uv run [OPTIONS]

By default, uv will stop at the first index on which a given package is available, and limit resolutions to those present on that first index (first-match). This prevents "dependency confusion" attacks, whereby an attack can upload a malicious package under the same name to a secondary.

+

Possible values:

+ +
    +
  • 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 keyring-provider

Attempt to use keyring for authentication for index URLs.

At present, only --keyring-provider subprocess is supported, which configures uv to use the keyring CLI to handle authentication.

Defaults to disabled.

+

Possible values:

+ +
    +
  • disabled: Do not use keyring for credential lookup
  • + +
  • subprocess: Use the keyring command for credential lookup
  • +
--resolution resolution

The strategy to use when selecting between the different compatible versions for a given package requirement.

By default, uv will use the latest compatible version of each package (highest).

+

Possible values:

+ +
    +
  • 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 prerelease

The strategy to use when considering pre-release versions.

By default, uv will accept pre-releases for packages that only publish pre-releases, along with first-party requirements that contain an explicit pre-release marker in the declared specifiers (if-necessary-or-explicit).

+

Possible values:

+ +
    +
  • disallow: Disallow all pre-release versions
  • + +
  • allow: Allow all pre-release versions
  • + +
  • if-necessary: Allow pre-release versions if all versions of a package are pre-release
  • + +
  • explicit: Allow pre-release versions for first-party packages with explicit pre-release markers in their version requirements
  • + +
  • if-necessary-or-explicit: Allow pre-release versions if all versions of a package are pre-release, or if the package has an explicit pre-release marker in its version requirements
  • +
--config-setting, -C config-setting

Settings to pass to the PEP 517 build backend, specified as KEY=VALUE pairs

--exclude-newer exclude-newer

Limit candidate packages to those that were uploaded prior to the given date.

@@ -1462,6 +2469,17 @@ uv run [OPTIONS]

Defaults to clone (also known as Copy-on-Write) on macOS, and hardlink on Linux and Windows.

+

Possible values:

+ +
    +
  • clone: Clone (i.e., copy-on-write) packages from the wheel into the site-packages directory
  • + +
  • copy: Copy packages from the wheel into the site-packages directory
  • + +
  • hardlink: Hard link packages from the wheel into the site-packages directory
  • + +
  • symlink: Symbolically link packages from the wheel into the site-packages directory
  • +
--no-build-package no-build-package

Don’t build source distributions for a specific package

--no-binary-package no-binary-package

Don’t install pre-built wheels for a specific package

@@ -1490,10 +2508,38 @@ uv run [OPTIONS]
--python-preference python-preference

Whether to prefer using Python installations that are already present on the system, or those that are downloaded and installed by uv

+

Possible values:

+ +
    +
  • only-managed: Only use managed Python installations; never use system Python installations
  • + +
  • managed: Prefer managed Python installations over system Python installations
  • + +
  • system: Prefer system Python installations over managed Python installations
  • + +
  • only-system: Only use system Python installations; never use managed Python installations
  • +
--python-fetch python-fetch

Whether to automatically download Python when required

+

Possible values:

+ +
    +
  • automatic: Automatically fetch managed Python installations when needed
  • + +
  • manual: Do not automatically fetch managed Python installations; require explicit installation
  • +
--color color-choice

Control colors in output

+

[default: auto]

+

Possible values:

+ +
    +
  • auto: Enables colored output only when the output is going to a terminal or TTY with support
  • + +
  • always: Enables colored output regardless of the detected environment
  • + +
  • never: Disables colored output
  • +
--config-file config-file

The path to a uv.toml file to use for configuration

@@ -1540,20 +2586,58 @@ uv sync [OPTIONS]

By default, uv will stop at the first index on which a given package is available, and limit resolutions to those present on that first index (first-match). This prevents "dependency confusion" attacks, whereby an attack can upload a malicious package under the same name to a secondary.

+

Possible values:

+ +
    +
  • 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 keyring-provider

Attempt to use keyring for authentication for index URLs.

At present, only --keyring-provider subprocess is supported, which configures uv to use the keyring CLI to handle authentication.

Defaults to disabled.

+

Possible values:

+ +
    +
  • disabled: Do not use keyring for credential lookup
  • + +
  • subprocess: Use the keyring command for credential lookup
  • +
--resolution resolution

The strategy to use when selecting between the different compatible versions for a given package requirement.

By default, uv will use the latest compatible version of each package (highest).

+

Possible values:

+ +
    +
  • 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 prerelease

The strategy to use when considering pre-release versions.

By default, uv will accept pre-releases for packages that only publish pre-releases, along with first-party requirements that contain an explicit pre-release marker in the declared specifiers (if-necessary-or-explicit).

+

Possible values:

+ +
    +
  • disallow: Disallow all pre-release versions
  • + +
  • allow: Allow all pre-release versions
  • + +
  • if-necessary: Allow pre-release versions if all versions of a package are pre-release
  • + +
  • explicit: Allow pre-release versions for first-party packages with explicit pre-release markers in their version requirements
  • + +
  • if-necessary-or-explicit: Allow pre-release versions if all versions of a package are pre-release, or if the package has an explicit pre-release marker in its version requirements
  • +
--config-setting, -C config-setting

Settings to pass to the PEP 517 build backend, specified as KEY=VALUE pairs

--exclude-newer exclude-newer

Limit candidate packages to those that were uploaded prior to the given date.

@@ -1564,6 +2648,17 @@ uv sync [OPTIONS]

Defaults to clone (also known as Copy-on-Write) on macOS, and hardlink on Linux and Windows.

+

Possible values:

+ +
    +
  • clone: Clone (i.e., copy-on-write) packages from the wheel into the site-packages directory
  • + +
  • copy: Copy packages from the wheel into the site-packages directory
  • + +
  • hardlink: Hard link packages from the wheel into the site-packages directory
  • + +
  • symlink: Symbolically link packages from the wheel into the site-packages directory
  • +
--no-build-package no-build-package

Don’t build source distributions for a specific package

--no-binary-package no-binary-package

Don’t install pre-built wheels for a specific package

@@ -1592,10 +2687,38 @@ uv sync [OPTIONS]
--python-preference python-preference

Whether to prefer using Python installations that are already present on the system, or those that are downloaded and installed by uv

+

Possible values:

+ +
    +
  • only-managed: Only use managed Python installations; never use system Python installations
  • + +
  • managed: Prefer managed Python installations over system Python installations
  • + +
  • system: Prefer system Python installations over managed Python installations
  • + +
  • only-system: Only use system Python installations; never use managed Python installations
  • +
--python-fetch python-fetch

Whether to automatically download Python when required

+

Possible values:

+ +
    +
  • automatic: Automatically fetch managed Python installations when needed
  • + +
  • manual: Do not automatically fetch managed Python installations; require explicit installation
  • +
--color color-choice

Control colors in output

+

[default: auto]

+

Possible values:

+ +
    +
  • auto: Enables colored output only when the output is going to a terminal or TTY with support
  • + +
  • always: Enables colored output regardless of the detected environment
  • + +
  • never: Disables colored output
  • +
--config-file config-file

The path to a uv.toml file to use for configuration

@@ -1636,20 +2759,58 @@ uv lock [OPTIONS]

By default, uv will stop at the first index on which a given package is available, and limit resolutions to those present on that first index (first-match). This prevents "dependency confusion" attacks, whereby an attack can upload a malicious package under the same name to a secondary.

+

Possible values:

+ +
    +
  • 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 keyring-provider

Attempt to use keyring for authentication for index URLs.

At present, only --keyring-provider subprocess is supported, which configures uv to use the keyring CLI to handle authentication.

Defaults to disabled.

+

Possible values:

+ +
    +
  • disabled: Do not use keyring for credential lookup
  • + +
  • subprocess: Use the keyring command for credential lookup
  • +
--resolution resolution

The strategy to use when selecting between the different compatible versions for a given package requirement.

By default, uv will use the latest compatible version of each package (highest).

+

Possible values:

+ +
    +
  • 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 prerelease

The strategy to use when considering pre-release versions.

By default, uv will accept pre-releases for packages that only publish pre-releases, along with first-party requirements that contain an explicit pre-release marker in the declared specifiers (if-necessary-or-explicit).

+

Possible values:

+ +
    +
  • disallow: Disallow all pre-release versions
  • + +
  • allow: Allow all pre-release versions
  • + +
  • if-necessary: Allow pre-release versions if all versions of a package are pre-release
  • + +
  • explicit: Allow pre-release versions for first-party packages with explicit pre-release markers in their version requirements
  • + +
  • if-necessary-or-explicit: Allow pre-release versions if all versions of a package are pre-release, or if the package has an explicit pre-release marker in its version requirements
  • +
--config-setting, -C config-setting

Settings to pass to the PEP 517 build backend, specified as KEY=VALUE pairs

--exclude-newer exclude-newer

Limit candidate packages to those that were uploaded prior to the given date.

@@ -1662,6 +2823,17 @@ uv lock [OPTIONS]

Defaults to clone (also known as Copy-on-Write) on macOS, and hardlink on Linux and Windows.

+

Possible values:

+ +
    +
  • clone: Clone (i.e., copy-on-write) packages from the wheel into the site-packages directory
  • + +
  • copy: Copy packages from the wheel into the site-packages directory
  • + +
  • hardlink: Hard link packages from the wheel into the site-packages directory
  • + +
  • symlink: Symbolically link packages from the wheel into the site-packages directory
  • +
--no-build-package no-build-package

Don’t build source distributions for a specific package

--no-binary-package no-binary-package

Don’t install pre-built wheels for a specific package

@@ -1688,10 +2860,38 @@ uv lock [OPTIONS]
--python-preference python-preference

Whether to prefer using Python installations that are already present on the system, or those that are downloaded and installed by uv

+

Possible values:

+ +
    +
  • only-managed: Only use managed Python installations; never use system Python installations
  • + +
  • managed: Prefer managed Python installations over system Python installations
  • + +
  • system: Prefer system Python installations over managed Python installations
  • + +
  • only-system: Only use system Python installations; never use managed Python installations
  • +
--python-fetch python-fetch

Whether to automatically download Python when required

+

Possible values:

+ +
    +
  • automatic: Automatically fetch managed Python installations when needed
  • + +
  • manual: Do not automatically fetch managed Python installations; require explicit installation
  • +
--color color-choice

Control colors in output

+

[default: auto]

+

Possible values:

+ +
    +
  • auto: Enables colored output only when the output is going to a terminal or TTY with support
  • + +
  • always: Enables colored output regardless of the detected environment
  • + +
  • never: Disables colored output
  • +
--config-file config-file

The path to a uv.toml file to use for configuration

@@ -1750,20 +2950,58 @@ uv add [OPTIONS] ...

By default, uv will stop at the first index on which a given package is available, and limit resolutions to those present on that first index (first-match). This prevents "dependency confusion" attacks, whereby an attack can upload a malicious package under the same name to a secondary.

+

Possible values:

+ +
    +
  • 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 keyring-provider

Attempt to use keyring for authentication for index URLs.

At present, only --keyring-provider subprocess is supported, which configures uv to use the keyring CLI to handle authentication.

Defaults to disabled.

+

Possible values:

+ +
    +
  • disabled: Do not use keyring for credential lookup
  • + +
  • subprocess: Use the keyring command for credential lookup
  • +
--resolution resolution

The strategy to use when selecting between the different compatible versions for a given package requirement.

By default, uv will use the latest compatible version of each package (highest).

+

Possible values:

+ +
    +
  • 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 prerelease

The strategy to use when considering pre-release versions.

By default, uv will accept pre-releases for packages that only publish pre-releases, along with first-party requirements that contain an explicit pre-release marker in the declared specifiers (if-necessary-or-explicit).

+

Possible values:

+ +
    +
  • disallow: Disallow all pre-release versions
  • + +
  • allow: Allow all pre-release versions
  • + +
  • if-necessary: Allow pre-release versions if all versions of a package are pre-release
  • + +
  • explicit: Allow pre-release versions for first-party packages with explicit pre-release markers in their version requirements
  • + +
  • if-necessary-or-explicit: Allow pre-release versions if all versions of a package are pre-release, or if the package has an explicit pre-release marker in its version requirements
  • +
--config-setting, -C config-setting

Settings to pass to the PEP 517 build backend, specified as KEY=VALUE pairs

--exclude-newer exclude-newer

Limit candidate packages to those that were uploaded prior to the given date.

@@ -1774,6 +3012,17 @@ uv add [OPTIONS] ...

Defaults to clone (also known as Copy-on-Write) on macOS, and hardlink on Linux and Windows.

+

Possible values:

+ +
    +
  • clone: Clone (i.e., copy-on-write) packages from the wheel into the site-packages directory
  • + +
  • copy: Copy packages from the wheel into the site-packages directory
  • + +
  • hardlink: Hard link packages from the wheel into the site-packages directory
  • + +
  • symlink: Symbolically link packages from the wheel into the site-packages directory
  • +
--no-build-package no-build-package

Don’t build source distributions for a specific package

--no-binary-package no-binary-package

Don’t install pre-built wheels for a specific package

@@ -1802,10 +3051,38 @@ uv add [OPTIONS] ...
--python-preference python-preference

Whether to prefer using Python installations that are already present on the system, or those that are downloaded and installed by uv

+

Possible values:

+ +
    +
  • only-managed: Only use managed Python installations; never use system Python installations
  • + +
  • managed: Prefer managed Python installations over system Python installations
  • + +
  • system: Prefer system Python installations over managed Python installations
  • + +
  • only-system: Only use system Python installations; never use managed Python installations
  • +
--python-fetch python-fetch

Whether to automatically download Python when required

+

Possible values:

+ +
    +
  • automatic: Automatically fetch managed Python installations when needed
  • + +
  • manual: Do not automatically fetch managed Python installations; require explicit installation
  • +
--color color-choice

Control colors in output

+

[default: auto]

+

Possible values:

+ +
    +
  • auto: Enables colored output only when the output is going to a terminal or TTY with support
  • + +
  • always: Enables colored output regardless of the detected environment
  • + +
  • never: Disables colored output
  • +
--config-file config-file

The path to a uv.toml file to use for configuration

@@ -1856,20 +3133,58 @@ uv remove [OPTIONS] ...

By default, uv will stop at the first index on which a given package is available, and limit resolutions to those present on that first index (first-match). This prevents "dependency confusion" attacks, whereby an attack can upload a malicious package under the same name to a secondary.

+

Possible values:

+ +
    +
  • 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 keyring-provider

Attempt to use keyring for authentication for index URLs.

At present, only --keyring-provider subprocess is supported, which configures uv to use the keyring CLI to handle authentication.

Defaults to disabled.

+

Possible values:

+ +
    +
  • disabled: Do not use keyring for credential lookup
  • + +
  • subprocess: Use the keyring command for credential lookup
  • +
--resolution resolution

The strategy to use when selecting between the different compatible versions for a given package requirement.

By default, uv will use the latest compatible version of each package (highest).

+

Possible values:

+ +
    +
  • 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 prerelease

The strategy to use when considering pre-release versions.

By default, uv will accept pre-releases for packages that only publish pre-releases, along with first-party requirements that contain an explicit pre-release marker in the declared specifiers (if-necessary-or-explicit).

+

Possible values:

+ +
    +
  • disallow: Disallow all pre-release versions
  • + +
  • allow: Allow all pre-release versions
  • + +
  • if-necessary: Allow pre-release versions if all versions of a package are pre-release
  • + +
  • explicit: Allow pre-release versions for first-party packages with explicit pre-release markers in their version requirements
  • + +
  • if-necessary-or-explicit: Allow pre-release versions if all versions of a package are pre-release, or if the package has an explicit pre-release marker in its version requirements
  • +
--config-setting, -C config-setting

Settings to pass to the PEP 517 build backend, specified as KEY=VALUE pairs

--exclude-newer exclude-newer

Limit candidate packages to those that were uploaded prior to the given date.

@@ -1880,6 +3195,17 @@ uv remove [OPTIONS] ...

Defaults to clone (also known as Copy-on-Write) on macOS, and hardlink on Linux and Windows.

+

Possible values:

+ +
    +
  • clone: Clone (i.e., copy-on-write) packages from the wheel into the site-packages directory
  • + +
  • copy: Copy packages from the wheel into the site-packages directory
  • + +
  • hardlink: Hard link packages from the wheel into the site-packages directory
  • + +
  • symlink: Symbolically link packages from the wheel into the site-packages directory
  • +
--no-build-package no-build-package

Don’t build source distributions for a specific package

--no-binary-package no-binary-package

Don’t install pre-built wheels for a specific package

@@ -1908,10 +3234,38 @@ uv remove [OPTIONS] ...
--python-preference python-preference

Whether to prefer using Python installations that are already present on the system, or those that are downloaded and installed by uv

+

Possible values:

+ +
    +
  • only-managed: Only use managed Python installations; never use system Python installations
  • + +
  • managed: Prefer managed Python installations over system Python installations
  • + +
  • system: Prefer system Python installations over managed Python installations
  • + +
  • only-system: Only use system Python installations; never use managed Python installations
  • +
--python-fetch python-fetch

Whether to automatically download Python when required

+

Possible values:

+ +
    +
  • automatic: Automatically fetch managed Python installations when needed
  • + +
  • manual: Do not automatically fetch managed Python installations; require explicit installation
  • +
--color color-choice

Control colors in output

+

[default: auto]

+

Possible values:

+ +
    +
  • auto: Enables colored output only when the output is going to a terminal or TTY with support
  • + +
  • always: Enables colored output regardless of the detected environment
  • + +
  • never: Disables colored output
  • +
--config-file config-file

The path to a uv.toml file to use for configuration

@@ -1930,6 +3284,7 @@ uv tree [OPTIONS]
--depth, -d depth

Maximum display depth of the dependency tree

+

[default: 255]

--prune prune

Prune the given package from the display of the dependency tree

--package package

Display only the specified packages

@@ -1962,20 +3317,58 @@ uv tree [OPTIONS]

By default, uv will stop at the first index on which a given package is available, and limit resolutions to those present on that first index (first-match). This prevents "dependency confusion" attacks, whereby an attack can upload a malicious package under the same name to a secondary.

+

Possible values:

+ +
    +
  • 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 keyring-provider

Attempt to use keyring for authentication for index URLs.

At present, only --keyring-provider subprocess is supported, which configures uv to use the keyring CLI to handle authentication.

Defaults to disabled.

+

Possible values:

+ +
    +
  • disabled: Do not use keyring for credential lookup
  • + +
  • subprocess: Use the keyring command for credential lookup
  • +
--resolution resolution

The strategy to use when selecting between the different compatible versions for a given package requirement.

By default, uv will use the latest compatible version of each package (highest).

+

Possible values:

+ +
    +
  • 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 prerelease

The strategy to use when considering pre-release versions.

By default, uv will accept pre-releases for packages that only publish pre-releases, along with first-party requirements that contain an explicit pre-release marker in the declared specifiers (if-necessary-or-explicit).

+

Possible values:

+ +
    +
  • disallow: Disallow all pre-release versions
  • + +
  • allow: Allow all pre-release versions
  • + +
  • if-necessary: Allow pre-release versions if all versions of a package are pre-release
  • + +
  • explicit: Allow pre-release versions for first-party packages with explicit pre-release markers in their version requirements
  • + +
  • if-necessary-or-explicit: Allow pre-release versions if all versions of a package are pre-release, or if the package has an explicit pre-release marker in its version requirements
  • +
--config-setting, -C config-setting

Settings to pass to the PEP 517 build backend, specified as KEY=VALUE pairs

--exclude-newer exclude-newer

Limit candidate packages to those that were uploaded prior to the given date.

@@ -1988,6 +3381,17 @@ uv tree [OPTIONS]

Defaults to clone (also known as Copy-on-Write) on macOS, and hardlink on Linux and Windows.

+

Possible values:

+ +
    +
  • clone: Clone (i.e., copy-on-write) packages from the wheel into the site-packages directory
  • + +
  • copy: Copy packages from the wheel into the site-packages directory
  • + +
  • hardlink: Hard link packages from the wheel into the site-packages directory
  • + +
  • symlink: Symbolically link packages from the wheel into the site-packages directory
  • +
--python, -p python

The Python interpreter for which packages should be listed.

By default, uv installs into the virtual environment in the current working directory or any parent directory. The --python option allows you to specify a different interpreter, which is intended for use in continuous integration (CI) environments or other automated workflows.

@@ -2008,10 +3412,38 @@ uv tree [OPTIONS]
--python-preference python-preference

Whether to prefer using Python installations that are already present on the system, or those that are downloaded and installed by uv

+

Possible values:

+ +
    +
  • only-managed: Only use managed Python installations; never use system Python installations
  • + +
  • managed: Prefer managed Python installations over system Python installations
  • + +
  • system: Prefer system Python installations over managed Python installations
  • + +
  • only-system: Only use system Python installations; never use managed Python installations
  • +
--python-fetch python-fetch

Whether to automatically download Python when required

+

Possible values:

+ +
    +
  • automatic: Automatically fetch managed Python installations when needed
  • + +
  • manual: Do not automatically fetch managed Python installations; require explicit installation
  • +
--color color-choice

Control colors in output

+

[default: auto]

+

Possible values:

+ +
    +
  • auto: Enables colored output only when the output is going to a terminal or TTY with support
  • + +
  • always: Enables colored output regardless of the detected environment
  • + +
  • never: Disables colored output
  • +
--config-file config-file

The path to a uv.toml file to use for configuration

@@ -2088,12 +3520,28 @@ uv venv [OPTIONS] [NAME]

By default, uv will stop at the first index on which a given package is available, and limit resolutions to those present on that first index (first-match). This prevents "dependency confusion" attacks, whereby an attack can upload a malicious package under the same name to a secondary.

+

Possible values:

+ +
    +
  • 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 keyring-provider

Attempt to use keyring for authentication for index URLs.

At present, only --keyring-provider subprocess is supported, which configures uv to use the keyring CLI to handle authentication.

Defaults to disabled.

+

Possible values:

+ +
    +
  • disabled: Do not use keyring for credential lookup
  • + +
  • subprocess: Use the keyring command for credential lookup
  • +
--exclude-newer exclude-newer

Limit candidate packages to those that were uploaded prior to the given date.

Accepts both RFC 3339 timestamps (e.g., 2006-12-02T02:07:43Z) and UTC dates in the same format (e.g., 2006-12-02).

@@ -2104,16 +3552,55 @@ uv venv [OPTIONS] [NAME]

Defaults to clone (also known as Copy-on-Write) on macOS, and hardlink on Linux and Windows.

+

Possible values:

+ +
    +
  • clone: Clone (i.e., copy-on-write) packages from the wheel into the site-packages directory
  • + +
  • copy: Copy packages from the wheel into the site-packages directory
  • + +
  • hardlink: Hard link packages from the wheel into the site-packages directory
  • + +
  • symlink: Symbolically link packages from the wheel into the site-packages directory
  • +
--cache-dir cache-dir

Path to the cache directory.

Defaults to $HOME/Library/Caches/uv on macOS, $XDG_CACHE_HOME/uv or $HOME/.cache/uv on Linux, and {FOLDERID_LocalAppData}\uv\cache on Windows.

--python-preference python-preference

Whether to prefer using Python installations that are already present on the system, or those that are downloaded and installed by uv

+

Possible values:

+ +
    +
  • only-managed: Only use managed Python installations; never use system Python installations
  • + +
  • managed: Prefer managed Python installations over system Python installations
  • + +
  • system: Prefer system Python installations over managed Python installations
  • + +
  • only-system: Only use system Python installations; never use managed Python installations
  • +
--python-fetch python-fetch

Whether to automatically download Python when required

+

Possible values:

+ +
    +
  • automatic: Automatically fetch managed Python installations when needed
  • + +
  • manual: Do not automatically fetch managed Python installations; require explicit installation
  • +
--color color-choice

Control colors in output

+

[default: auto]

+

Possible values:

+ +
    +
  • auto: Enables colored output only when the output is going to a terminal or TTY with support
  • + +
  • always: Enables colored output regardless of the detected environment
  • + +
  • never: Disables colored output
  • +
--config-file config-file

The path to a uv.toml file to use for configuration

@@ -2162,10 +3649,38 @@ uv cache clean [OPTIONS] [PACKAGE]...
--python-preference python-preference

Whether to prefer using Python installations that are already present on the system, or those that are downloaded and installed by uv

+

Possible values:

+ +
    +
  • only-managed: Only use managed Python installations; never use system Python installations
  • + +
  • managed: Prefer managed Python installations over system Python installations
  • + +
  • system: Prefer system Python installations over managed Python installations
  • + +
  • only-system: Only use system Python installations; never use managed Python installations
  • +
--python-fetch python-fetch

Whether to automatically download Python when required

+

Possible values:

+ +
    +
  • automatic: Automatically fetch managed Python installations when needed
  • + +
  • manual: Do not automatically fetch managed Python installations; require explicit installation
  • +
--color color-choice

Control colors in output

+

[default: auto]

+

Possible values:

+ +
    +
  • auto: Enables colored output only when the output is going to a terminal or TTY with support
  • + +
  • always: Enables colored output regardless of the detected environment
  • + +
  • never: Disables colored output
  • +
--config-file config-file

The path to a uv.toml file to use for configuration

@@ -2188,10 +3703,38 @@ uv cache prune [OPTIONS]
--python-preference python-preference

Whether to prefer using Python installations that are already present on the system, or those that are downloaded and installed by uv

+

Possible values:

+ +
    +
  • only-managed: Only use managed Python installations; never use system Python installations
  • + +
  • managed: Prefer managed Python installations over system Python installations
  • + +
  • system: Prefer system Python installations over managed Python installations
  • + +
  • only-system: Only use system Python installations; never use managed Python installations
  • +
--python-fetch python-fetch

Whether to automatically download Python when required

+

Possible values:

+ +
    +
  • automatic: Automatically fetch managed Python installations when needed
  • + +
  • manual: Do not automatically fetch managed Python installations; require explicit installation
  • +
--color color-choice

Control colors in output

+

[default: auto]

+

Possible values:

+ +
    +
  • auto: Enables colored output only when the output is going to a terminal or TTY with support
  • + +
  • always: Enables colored output regardless of the detected environment
  • + +
  • never: Disables colored output
  • +
--config-file config-file

The path to a uv.toml file to use for configuration

@@ -2214,10 +3757,38 @@ uv cache dir [OPTIONS]
--python-preference python-preference

Whether to prefer using Python installations that are already present on the system, or those that are downloaded and installed by uv

+

Possible values:

+ +
    +
  • only-managed: Only use managed Python installations; never use system Python installations
  • + +
  • managed: Prefer managed Python installations over system Python installations
  • + +
  • system: Prefer system Python installations over managed Python installations
  • + +
  • only-system: Only use system Python installations; never use managed Python installations
  • +
--python-fetch python-fetch

Whether to automatically download Python when required

+

Possible values:

+ +
    +
  • automatic: Automatically fetch managed Python installations when needed
  • + +
  • manual: Do not automatically fetch managed Python installations; require explicit installation
  • +
--color color-choice

Control colors in output

+

[default: auto]

+

Possible values:

+ +
    +
  • auto: Enables colored output only when the output is going to a terminal or TTY with support
  • + +
  • always: Enables colored output regardless of the detected environment
  • + +
  • never: Disables colored output
  • +
--config-file config-file

The path to a uv.toml file to use for configuration

@@ -2240,10 +3811,38 @@ uv version [OPTIONS]
--python-preference python-preference

Whether to prefer using Python installations that are already present on the system, or those that are downloaded and installed by uv

+

Possible values:

+ +
    +
  • only-managed: Only use managed Python installations; never use system Python installations
  • + +
  • managed: Prefer managed Python installations over system Python installations
  • + +
  • system: Prefer system Python installations over managed Python installations
  • + +
  • only-system: Only use system Python installations; never use managed Python installations
  • +
--python-fetch python-fetch

Whether to automatically download Python when required

+

Possible values:

+ +
    +
  • automatic: Automatically fetch managed Python installations when needed
  • + +
  • manual: Do not automatically fetch managed Python installations; require explicit installation
  • +
--color color-choice

Control colors in output

+

[default: auto]

+

Possible values:

+ +
    +
  • auto: Enables colored output only when the output is going to a terminal or TTY with support
  • + +
  • always: Enables colored output regardless of the detected environment
  • + +
  • never: Disables colored output
  • +
--config-file config-file

The path to a uv.toml file to use for configuration

@@ -2270,10 +3869,38 @@ uv help [OPTIONS] [COMMAND]...
--python-preference python-preference

Whether to prefer using Python installations that are already present on the system, or those that are downloaded and installed by uv

+

Possible values:

+ +
    +
  • only-managed: Only use managed Python installations; never use system Python installations
  • + +
  • managed: Prefer managed Python installations over system Python installations
  • + +
  • system: Prefer system Python installations over managed Python installations
  • + +
  • only-system: Only use system Python installations; never use managed Python installations
  • +
--python-fetch python-fetch

Whether to automatically download Python when required

+

Possible values:

+ +
    +
  • automatic: Automatically fetch managed Python installations when needed
  • + +
  • manual: Do not automatically fetch managed Python installations; require explicit installation
  • +
--color color-choice

Control colors in output

+

[default: auto]

+

Possible values:

+ +
    +
  • auto: Enables colored output only when the output is going to a terminal or TTY with support
  • + +
  • always: Enables colored output regardless of the detected environment
  • + +
  • never: Disables colored output
  • +
--config-file config-file

The path to a uv.toml file to use for configuration