From 9a0f4b626aa2a447fdab8c73cd02e16204802470 Mon Sep 17 00:00:00 2001 From: Matthew Mckee Date: Sat, 6 Dec 2025 14:11:24 +0000 Subject: [PATCH 01/11] Speed up cache size command --- Cargo.lock | 167 +++++++++++++++++++++++---- Cargo.toml | 1 + crates/uv-cli/src/lib.rs | 4 + crates/uv/Cargo.toml | 1 + crates/uv/src/commands/cache_size.rs | 25 ++-- crates/uv/src/lib.rs | 2 +- crates/uv/tests/it/cache_size.rs | 21 ++++ 7 files changed, 185 insertions(+), 36 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2c000bfbe7188..885f4812f12d1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -63,6 +63,15 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" +[[package]] +name = "ansi_term" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" +dependencies = [ + "winapi", +] + [[package]] name = "anstream" version = "0.6.21" @@ -385,6 +394,17 @@ version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi 0.1.19", + "libc", + "winapi", +] + [[package]] name = "autocfg" version = "1.5.0" @@ -750,6 +770,22 @@ dependencies = [ "inout", ] +[[package]] +name = "clap" +version = "2.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" +dependencies = [ + "ansi_term", + "atty", + "bitflags 1.3.2", + "strsim 0.8.0", + "term_size", + "textwrap 0.11.0", + "unicode-width 0.1.14", + "vec_map", +] + [[package]] name = "clap" version = "4.5.53" @@ -769,7 +805,7 @@ dependencies = [ "anstream", "anstyle", "clap_lex", - "strsim", + "strsim 0.11.1", "terminal_size", ] @@ -779,7 +815,7 @@ version = "4.5.55" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a5abde44486daf70c5be8b8f8f1b66c49f86236edf6fa2abadb4d961c4c6229a" dependencies = [ - "clap", + "clap 4.5.53", ] [[package]] @@ -788,7 +824,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da8e198c052315686d36371e8a3c5778b7852fc75cc313e4e11eeb7a644a1b62" dependencies = [ - "clap", + "clap 4.5.53", "clap_complete", "clap_complete_nushell", ] @@ -799,7 +835,7 @@ version = "4.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0a0c951694691e65bf9d421d597d68416c22de9632e884c28412cb8cd8b73dce" dependencies = [ - "clap", + "clap 4.5.53", "clap_complete", ] @@ -845,7 +881,7 @@ version = "4.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4a06533c3c2c7b43b2efcca2dc0f228097b4c582c95f59cc187bbeb926b42cfb" dependencies = [ - "clap", + "clap 4.5.53", "codspeed", "codspeed-criterion-compat-walltime", "colored", @@ -863,7 +899,7 @@ dependencies = [ "anes", "cast", "ciborium", - "clap", + "clap 4.5.53", "codspeed", "criterion-plot", "futures", @@ -1038,6 +1074,15 @@ dependencies = [ "itertools 0.10.5", ] +[[package]] +name = "crossbeam-channel" +version = "0.5.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82b8f8f868b36967f9606790d1903570de9ceaf870a7bf9fbbd3016d636a2cb2" +dependencies = [ + "crossbeam-utils", +] + [[package]] name = "crossbeam-deque" version = "0.8.6" @@ -1255,6 +1300,20 @@ dependencies = [ "windows-sys 0.61.0", ] +[[package]] +name = "diskus" +version = "0.8.0" +source = "git+https://github.com/sharkdp/diskus#ec3f6e04db61d41e116af923565d24bd5651c8f5" +dependencies = [ + "atty", + "clap 2.34.0", + "crossbeam-channel", + "humansize", + "num-format", + "num_cpus", + "rayon", +] + [[package]] name = "dispatch2" version = "0.3.0" @@ -1855,6 +1914,15 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + [[package]] name = "hermit-abi" version = "0.5.2" @@ -1958,6 +2026,12 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" +[[package]] +name = "humansize" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02296996cb8796d7c6e3bc2d9211b7802812d36999a51bb754123ead7d37d026" + [[package]] name = "hyper" version = "1.7.0" @@ -2266,7 +2340,7 @@ version = "0.4.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e04d7f318608d35d4b61ddd75cbdaee86b023ebe2bd5a66ee0915f0bf93095a9" dependencies = [ - "hermit-abi", + "hermit-abi 0.5.2", "libc", "windows-sys 0.59.0", ] @@ -2609,7 +2683,7 @@ dependencies = [ "supports-hyperlinks", "supports-unicode", "terminal_size", - "textwrap", + "textwrap 0.16.2", "unicode-width 0.1.14", ] @@ -2775,6 +2849,16 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" +[[package]] +name = "num-format" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a652d9771a63711fd3c3deb670acfbe5c30a4072e664d7a3bf5a9e1056ac72c3" +dependencies = [ + "arrayvec", + "itoa", +] + [[package]] name = "num-integer" version = "0.1.46" @@ -2821,7 +2905,7 @@ version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "91df4bbde75afed763b708b7eee1e8e7651e02d97f6d5dd763e89367e957b23b" dependencies = [ - "hermit-abi", + "hermit-abi 0.5.2", "libc", ] @@ -4416,6 +4500,12 @@ dependencies = [ "float-cmp 0.9.0", ] +[[package]] +name = "strsim" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" + [[package]] name = "strsim" version = "0.11.1" @@ -4614,6 +4704,16 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "term_size" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e4129646ca0ed8f45d09b929036bafad5377103edd06e50bf574b353d2b08d9" +dependencies = [ + "libc", + "winapi", +] + [[package]] name = "terminal_size" version = "0.4.2" @@ -4684,6 +4784,16 @@ dependencies = [ "syn", ] +[[package]] +name = "textwrap" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" +dependencies = [ + "term_size", + "unicode-width 0.1.14", +] + [[package]] name = "textwrap" version = "0.16.2" @@ -5399,9 +5509,10 @@ dependencies = [ "backon", "base64 0.22.1", "byteorder", - "clap", + "clap 4.5.53", "console 0.16.1", "ctrlc", + "diskus", "dotenvy", "dunce", "embed-manifest", @@ -5434,7 +5545,7 @@ dependencies = [ "similar", "tar", "tempfile", - "textwrap", + "textwrap 0.16.2", "thiserror 2.0.17", "tokio", "tokio-util", @@ -5691,7 +5802,7 @@ dependencies = [ name = "uv-cache" version = "0.0.4" dependencies = [ - "clap", + "clap 4.5.53", "fs-err", "nanoid", "rmp-serde", @@ -5747,7 +5858,7 @@ version = "0.0.4" dependencies = [ "anstream", "anyhow", - "clap", + "clap 4.5.53", "clap_complete_command", "fs-err", "insta", @@ -5841,7 +5952,7 @@ name = "uv-configuration" version = "0.0.4" dependencies = [ "anyhow", - "clap", + "clap 4.5.53", "either", "fs-err", "rayon", @@ -5878,7 +5989,7 @@ version = "0.0.4" dependencies = [ "anstream", "anyhow", - "clap", + "clap 4.5.53", "fs-err", "futures", "itertools 0.14.0", @@ -5894,7 +6005,7 @@ dependencies = [ "serde_yaml", "tagu", "tempfile", - "textwrap", + "textwrap 0.16.2", "tokio", "tokio-util", "tracing", @@ -6190,7 +6301,7 @@ version = "0.0.4" dependencies = [ "anyhow", "assert_fs", - "clap", + "clap 4.5.53", "configparser", "csv", "data-encoding", @@ -6299,7 +6410,7 @@ dependencies = [ "proc-macro2", "quote", "syn", - "textwrap", + "textwrap 0.16.2", ] [[package]] @@ -6515,7 +6626,7 @@ dependencies = [ "assert_fs", "astral-reqwest-middleware", "astral-reqwest-retry", - "clap", + "clap 4.5.53", "configparser", "dunce", "fs-err", @@ -6654,7 +6765,7 @@ version = "0.0.4" dependencies = [ "arcstr", "astral-pubgrub", - "clap", + "clap 4.5.53", "cyclonedx-bom", "dashmap", "either", @@ -6674,7 +6785,7 @@ dependencies = [ "schemars", "serde", "smallvec", - "textwrap", + "textwrap 0.16.2", "thiserror 2.0.17", "tokio", "tokio-stream", @@ -6741,11 +6852,11 @@ dependencies = [ name = "uv-settings" version = "0.0.4" dependencies = [ - "clap", + "clap 4.5.53", "fs-err", "schemars", "serde", - "textwrap", + "textwrap 0.16.2", "thiserror 2.0.17", "toml", "tracing", @@ -6848,7 +6959,7 @@ dependencies = [ name = "uv-torch" version = "0.0.4" dependencies = [ - "clap", + "clap 4.5.53", "either", "fs-err", "schemars", @@ -6944,7 +7055,7 @@ version = "0.0.4" dependencies = [ "anyhow", "assert_fs", - "clap", + "clap 4.5.53", "fs-err", "glob", "insta", @@ -6983,6 +7094,12 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" +[[package]] +name = "vec_map" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" + [[package]] name = "version_check" version = "0.9.5" diff --git a/Cargo.toml b/Cargo.toml index 66afd27b3410a..3359bc4fb5ac4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -203,6 +203,7 @@ xz2 = { version = "0.1.7" } zeroize = { version = "1.8.1" } zip = { version = "2.2.3", default-features = false, features = ["deflate", "zstd", "bzip2", "lzma", "xz"] } zstd = { version = "0.13.3" } +diskus = { git = "https://github.com/sharkdp/diskus", version = "0.8.0" } # dev-dependencies assert_cmd = { version = "2.0.16" } diff --git a/crates/uv-cli/src/lib.rs b/crates/uv-cli/src/lib.rs index 34797ae14dd95..2cb57215c009a 100644 --- a/crates/uv-cli/src/lib.rs +++ b/crates/uv-cli/src/lib.rs @@ -935,6 +935,10 @@ pub struct SizeArgs { /// Display the cache size in human-readable format (e.g., `1.2 GiB` instead of raw bytes). #[arg(long = "human", short = 'H', alias = "human-readable")] pub human: bool, + + /// Number of threads to use when calculating the cache size + #[arg(long)] + pub threads: Option, } #[derive(Args)] diff --git a/crates/uv/Cargo.toml b/crates/uv/Cargo.toml index 14e7733fd8930..fdcfdd49ba27a 100644 --- a/crates/uv/Cargo.toml +++ b/crates/uv/Cargo.toml @@ -115,6 +115,7 @@ version-ranges = { workspace = true } walkdir = { workspace = true } which = { workspace = true } zip = { workspace = true } +diskus = { workspace = true } [target.'cfg(target_os = "windows")'.dependencies] arrayvec = { workspace = true } diff --git a/crates/uv/src/commands/cache_size.rs b/crates/uv/src/commands/cache_size.rs index dfeecfc9cce7f..21e9764ab11ae 100644 --- a/crates/uv/src/commands/cache_size.rs +++ b/crates/uv/src/commands/cache_size.rs @@ -1,6 +1,8 @@ use std::fmt::Write; +use std::num::NonZero; use anyhow::Result; +use diskus::{FilesizeType, Walk}; use crate::commands::{ExitStatus, human_readable_bytes}; use crate::printer::Printer; @@ -12,6 +14,7 @@ use uv_warnings::warn_user; pub(crate) fn cache_size( cache: &Cache, human_readable: bool, + threads: Option, printer: Printer, preview: Preview, ) -> Result { @@ -31,16 +34,18 @@ pub(crate) fn cache_size( return Ok(ExitStatus::Success); } - // Walk the entire cache root - let total_bytes: u64 = walkdir::WalkDir::new(cache.root()) - .follow_links(false) - .into_iter() - .filter_map(Result::ok) - .filter_map(|entry| match entry.metadata() { - Ok(metadata) if metadata.is_file() => Some(metadata.len()), - _ => None, - }) - .sum(); + let num_threads = threads.unwrap_or_else(|| { + std::thread::available_parallelism() + .map(NonZero::get) + .unwrap_or(1) + }); + + tracing::info!("Using {} threads to calculate cache size", num_threads); + + let root_path_buf = &[cache.root().to_path_buf()]; + + let walk = Walk::new(root_path_buf, num_threads, FilesizeType::ApparentSize); + let (total_bytes, _) = walk.run(); if human_readable { let (bytes, unit) = human_readable_bytes(total_bytes); diff --git a/crates/uv/src/lib.rs b/crates/uv/src/lib.rs index 9a2d4d42b4ceb..c5658ae1900a6 100644 --- a/crates/uv/src/lib.rs +++ b/crates/uv/src/lib.rs @@ -1072,7 +1072,7 @@ async fn run(mut cli: Cli) -> Result { }) => commands::cache_dir(&cache, printer), Commands::Cache(CacheNamespace { command: CacheCommand::Size(args), - }) => commands::cache_size(&cache, args.human, printer, globals.preview), + }) => commands::cache_size(&cache, args.human, args.threads, printer, globals.preview), Commands::Build(args) => { // Resolve the settings from the command-line arguments and workspace configuration. let args = settings::BuildSettings::resolve(args, filesystem, environment); diff --git a/crates/uv/tests/it/cache_size.rs b/crates/uv/tests/it/cache_size.rs index 7fbfde3c80e57..596130acb699b 100644 --- a/crates/uv/tests/it/cache_size.rs +++ b/crates/uv/tests/it/cache_size.rs @@ -57,3 +57,24 @@ fn cache_size_with_packages_human() { ----- stderr ----- "); } + +/// Test that `cache size --threads 1` uses the correct number of threads, via a `info` log statement. +#[test] +fn cache_size_with_packages_threads() { + let context = TestContext::new("3.12"); + + // Install a requirement to populate the cache. + context.pip_install().arg("iniconfig").assert().success(); + + // Check cache size with `--threads 1` + uv_snapshot!(context.with_filtered_cache_size().filters(), context.cache_size().arg("--preview").arg("--threads").arg("2").arg("-v"), @r" + success: true + exit_code: 0 + ----- stdout ----- + [SIZE] + + ----- stderr ----- + DEBUG uv [VERSION] ([COMMIT] DATE) + INFO Using 2 threads to calculate cache size + "); +} From d64f136214368c10a4712162c4b4c7a70de2ee7e Mon Sep 17 00:00:00 2001 From: Matthew Mckee Date: Sat, 6 Dec 2025 14:14:38 +0000 Subject: [PATCH 02/11] Update cli reference --- docs/reference/cli.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/reference/cli.md b/docs/reference/cli.md index de2bdc31279d9..c8d3285fc5b9d 100644 --- a/docs/reference/cli.md +++ b/docs/reference/cli.md @@ -6202,6 +6202,7 @@ uv cache size [OPTIONS]

This setting has no effect when used in the uv pip interface.

May also be set with the UV_PROJECT environment variable.

--quiet, -q

Use quiet output.

Repeating this option, e.g., -qq, will enable a silent mode in which uv will write no output to stdout.

+
--threads threads

Number of threads to use when calculating the cache size

--verbose, -v

Use verbose output.

You can configure fine-grained logging using the RUST_LOG environment variable. (https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#directives)

From d90e641adc8df05e08f5fbae00cc8e3025d63c11 Mon Sep 17 00:00:00 2001 From: Matthew Mckee Date: Sat, 6 Dec 2025 14:49:05 +0000 Subject: [PATCH 03/11] Vendor code from diskus --- Cargo.lock | 160 +++++---------------------- Cargo.toml | 2 +- crates/uv/Cargo.toml | 3 +- crates/uv/src/commands/cache_size.rs | 95 +++++++++++++++- 4 files changed, 120 insertions(+), 140 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 885f4812f12d1..21dae51b9aecc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -63,15 +63,6 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" -[[package]] -name = "ansi_term" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" -dependencies = [ - "winapi", -] - [[package]] name = "anstream" version = "0.6.21" @@ -394,17 +385,6 @@ version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" -[[package]] -name = "atty" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi 0.1.19", - "libc", - "winapi", -] - [[package]] name = "autocfg" version = "1.5.0" @@ -770,22 +750,6 @@ dependencies = [ "inout", ] -[[package]] -name = "clap" -version = "2.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" -dependencies = [ - "ansi_term", - "atty", - "bitflags 1.3.2", - "strsim 0.8.0", - "term_size", - "textwrap 0.11.0", - "unicode-width 0.1.14", - "vec_map", -] - [[package]] name = "clap" version = "4.5.53" @@ -805,7 +769,7 @@ dependencies = [ "anstream", "anstyle", "clap_lex", - "strsim 0.11.1", + "strsim", "terminal_size", ] @@ -815,7 +779,7 @@ version = "4.5.55" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a5abde44486daf70c5be8b8f8f1b66c49f86236edf6fa2abadb4d961c4c6229a" dependencies = [ - "clap 4.5.53", + "clap", ] [[package]] @@ -824,7 +788,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da8e198c052315686d36371e8a3c5778b7852fc75cc313e4e11eeb7a644a1b62" dependencies = [ - "clap 4.5.53", + "clap", "clap_complete", "clap_complete_nushell", ] @@ -835,7 +799,7 @@ version = "4.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0a0c951694691e65bf9d421d597d68416c22de9632e884c28412cb8cd8b73dce" dependencies = [ - "clap 4.5.53", + "clap", "clap_complete", ] @@ -881,7 +845,7 @@ version = "4.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4a06533c3c2c7b43b2efcca2dc0f228097b4c582c95f59cc187bbeb926b42cfb" dependencies = [ - "clap 4.5.53", + "clap", "codspeed", "codspeed-criterion-compat-walltime", "colored", @@ -899,7 +863,7 @@ dependencies = [ "anes", "cast", "ciborium", - "clap 4.5.53", + "clap", "codspeed", "criterion-plot", "futures", @@ -1300,20 +1264,6 @@ dependencies = [ "windows-sys 0.61.0", ] -[[package]] -name = "diskus" -version = "0.8.0" -source = "git+https://github.com/sharkdp/diskus#ec3f6e04db61d41e116af923565d24bd5651c8f5" -dependencies = [ - "atty", - "clap 2.34.0", - "crossbeam-channel", - "humansize", - "num-format", - "num_cpus", - "rayon", -] - [[package]] name = "dispatch2" version = "0.3.0" @@ -1914,15 +1864,6 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" -[[package]] -name = "hermit-abi" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] - [[package]] name = "hermit-abi" version = "0.5.2" @@ -2026,12 +1967,6 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" -[[package]] -name = "humansize" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02296996cb8796d7c6e3bc2d9211b7802812d36999a51bb754123ead7d37d026" - [[package]] name = "hyper" version = "1.7.0" @@ -2340,7 +2275,7 @@ version = "0.4.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e04d7f318608d35d4b61ddd75cbdaee86b023ebe2bd5a66ee0915f0bf93095a9" dependencies = [ - "hermit-abi 0.5.2", + "hermit-abi", "libc", "windows-sys 0.59.0", ] @@ -2683,7 +2618,7 @@ dependencies = [ "supports-hyperlinks", "supports-unicode", "terminal_size", - "textwrap 0.16.2", + "textwrap", "unicode-width 0.1.14", ] @@ -2849,16 +2784,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" -[[package]] -name = "num-format" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a652d9771a63711fd3c3deb670acfbe5c30a4072e664d7a3bf5a9e1056ac72c3" -dependencies = [ - "arrayvec", - "itoa", -] - [[package]] name = "num-integer" version = "0.1.46" @@ -2905,7 +2830,7 @@ version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "91df4bbde75afed763b708b7eee1e8e7651e02d97f6d5dd763e89367e957b23b" dependencies = [ - "hermit-abi 0.5.2", + "hermit-abi", "libc", ] @@ -4500,12 +4425,6 @@ dependencies = [ "float-cmp 0.9.0", ] -[[package]] -name = "strsim" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" - [[package]] name = "strsim" version = "0.11.1" @@ -4704,16 +4623,6 @@ dependencies = [ "windows-sys 0.59.0", ] -[[package]] -name = "term_size" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e4129646ca0ed8f45d09b929036bafad5377103edd06e50bf574b353d2b08d9" -dependencies = [ - "libc", - "winapi", -] - [[package]] name = "terminal_size" version = "0.4.2" @@ -4784,16 +4693,6 @@ dependencies = [ "syn", ] -[[package]] -name = "textwrap" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" -dependencies = [ - "term_size", - "unicode-width 0.1.14", -] - [[package]] name = "textwrap" version = "0.16.2" @@ -5509,10 +5408,10 @@ dependencies = [ "backon", "base64 0.22.1", "byteorder", - "clap 4.5.53", + "clap", "console 0.16.1", + "crossbeam-channel", "ctrlc", - "diskus", "dotenvy", "dunce", "embed-manifest", @@ -5534,6 +5433,7 @@ dependencies = [ "owo-colors", "petgraph", "predicates", + "rayon", "regex", "reqwest", "rkyv", @@ -5545,7 +5445,7 @@ dependencies = [ "similar", "tar", "tempfile", - "textwrap 0.16.2", + "textwrap", "thiserror 2.0.17", "tokio", "tokio-util", @@ -5802,7 +5702,7 @@ dependencies = [ name = "uv-cache" version = "0.0.4" dependencies = [ - "clap 4.5.53", + "clap", "fs-err", "nanoid", "rmp-serde", @@ -5858,7 +5758,7 @@ version = "0.0.4" dependencies = [ "anstream", "anyhow", - "clap 4.5.53", + "clap", "clap_complete_command", "fs-err", "insta", @@ -5952,7 +5852,7 @@ name = "uv-configuration" version = "0.0.4" dependencies = [ "anyhow", - "clap 4.5.53", + "clap", "either", "fs-err", "rayon", @@ -5989,7 +5889,7 @@ version = "0.0.4" dependencies = [ "anstream", "anyhow", - "clap 4.5.53", + "clap", "fs-err", "futures", "itertools 0.14.0", @@ -6005,7 +5905,7 @@ dependencies = [ "serde_yaml", "tagu", "tempfile", - "textwrap 0.16.2", + "textwrap", "tokio", "tokio-util", "tracing", @@ -6301,7 +6201,7 @@ version = "0.0.4" dependencies = [ "anyhow", "assert_fs", - "clap 4.5.53", + "clap", "configparser", "csv", "data-encoding", @@ -6410,7 +6310,7 @@ dependencies = [ "proc-macro2", "quote", "syn", - "textwrap 0.16.2", + "textwrap", ] [[package]] @@ -6626,7 +6526,7 @@ dependencies = [ "assert_fs", "astral-reqwest-middleware", "astral-reqwest-retry", - "clap 4.5.53", + "clap", "configparser", "dunce", "fs-err", @@ -6765,7 +6665,7 @@ version = "0.0.4" dependencies = [ "arcstr", "astral-pubgrub", - "clap 4.5.53", + "clap", "cyclonedx-bom", "dashmap", "either", @@ -6785,7 +6685,7 @@ dependencies = [ "schemars", "serde", "smallvec", - "textwrap 0.16.2", + "textwrap", "thiserror 2.0.17", "tokio", "tokio-stream", @@ -6852,11 +6752,11 @@ dependencies = [ name = "uv-settings" version = "0.0.4" dependencies = [ - "clap 4.5.53", + "clap", "fs-err", "schemars", "serde", - "textwrap 0.16.2", + "textwrap", "thiserror 2.0.17", "toml", "tracing", @@ -6959,7 +6859,7 @@ dependencies = [ name = "uv-torch" version = "0.0.4" dependencies = [ - "clap 4.5.53", + "clap", "either", "fs-err", "schemars", @@ -7055,7 +6955,7 @@ version = "0.0.4" dependencies = [ "anyhow", "assert_fs", - "clap 4.5.53", + "clap", "fs-err", "glob", "insta", @@ -7094,12 +6994,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" -[[package]] -name = "vec_map" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" - [[package]] name = "version_check" version = "0.9.5" diff --git a/Cargo.toml b/Cargo.toml index 3359bc4fb5ac4..0f4f21049e6f9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -98,6 +98,7 @@ clap = { version = "4.5.17", features = ["derive", "env", "string", "wrap_help"] clap_complete_command = { version = "0.6.1" } configparser = { version = "3.1.0" } console = { version = "0.16.0", default-features = false, features = ["std"] } +crossbeam-channel = { version = "0.5.15" } csv = { version = "1.3.0" } ctrlc = { version = "3.4.5" } cyclonedx-bom = { version = "0.8.0" } @@ -203,7 +204,6 @@ xz2 = { version = "0.1.7" } zeroize = { version = "1.8.1" } zip = { version = "2.2.3", default-features = false, features = ["deflate", "zstd", "bzip2", "lzma", "xz"] } zstd = { version = "0.13.3" } -diskus = { git = "https://github.com/sharkdp/diskus", version = "0.8.0" } # dev-dependencies assert_cmd = { version = "2.0.16" } diff --git a/crates/uv/Cargo.toml b/crates/uv/Cargo.toml index fdcfdd49ba27a..c9d4ac9f2b12d 100644 --- a/crates/uv/Cargo.toml +++ b/crates/uv/Cargo.toml @@ -90,6 +90,7 @@ miette = { workspace = true, features = ["fancy-no-backtrace"] } open = { workspace = true } owo-colors = { workspace = true } petgraph = { workspace = true } +rayon = { workspace = true } regex = { workspace = true } reqwest = { workspace = true } rkyv = { workspace = true } @@ -115,7 +116,7 @@ version-ranges = { workspace = true } walkdir = { workspace = true } which = { workspace = true } zip = { workspace = true } -diskus = { workspace = true } +crossbeam-channel = { workspace = true } [target.'cfg(target_os = "windows")'.dependencies] arrayvec = { workspace = true } diff --git a/crates/uv/src/commands/cache_size.rs b/crates/uv/src/commands/cache_size.rs index 21e9764ab11ae..509b015c2fbcf 100644 --- a/crates/uv/src/commands/cache_size.rs +++ b/crates/uv/src/commands/cache_size.rs @@ -1,8 +1,12 @@ +use std::collections::HashSet; use std::fmt::Write; use std::num::NonZero; +use std::path::{Path, PathBuf}; +use std::thread; use anyhow::Result; -use diskus::{FilesizeType, Walk}; +use crossbeam_channel as channel; +use rayon::{self, prelude::*}; use crate::commands::{ExitStatus, human_readable_bytes}; use crate::printer::Printer; @@ -42,10 +46,7 @@ pub(crate) fn cache_size( tracing::info!("Using {} threads to calculate cache size", num_threads); - let root_path_buf = &[cache.root().to_path_buf()]; - - let walk = Walk::new(root_path_buf, num_threads, FilesizeType::ApparentSize); - let (total_bytes, _) = walk.run(); + let total_bytes = calculate_cache_size(num_threads, cache.root()); if human_readable { let (bytes, unit) = human_readable_bytes(total_bytes); @@ -56,3 +57,87 @@ pub(crate) fn cache_size( Ok(ExitStatus::Success) } + +/// Calculate the total size of the cache using multiple threads. +/// +/// Vendored from . +fn calculate_cache_size(num_threads: usize, path: &Path) -> u64 { + let (tx, rx) = channel::unbounded(); + + let receiver_thread = thread::spawn(move || { + let mut total = 0; + let mut ids = HashSet::new(); + for (unique_id, size) in rx { + if let Some(unique_id) = unique_id { + if ids.insert(unique_id) { + total += size; + } + } else { + total += size; + } + } + total + }); + + let pool = rayon::ThreadPoolBuilder::new() + .num_threads(num_threads) + .build() + .unwrap(); + pool.install(|| walk(tx, &[path.to_path_buf()])); + + receiver_thread.join().unwrap() +} + +fn walk(tx: channel::Sender<(Option, u64)>, entries: &[PathBuf]) { + entries.into_par_iter().for_each_with(tx, |tx_ref, entry| { + if let Ok(metadata) = entry.symlink_metadata() { + let unique_id = generate_unique_id(&metadata); + + let size = &metadata.len(); + + tx_ref.send((unique_id, *size)).unwrap(); + + if metadata.is_dir() { + let mut children = vec![]; + if let Ok(child_entries) = fs_err::read_dir(entry) { + for child_entry in child_entries.flatten() { + children.push(child_entry.path()); + } + } + + walk(tx_ref.clone(), &children[..]); + } + } + }); +} + +#[derive(Eq, PartialEq, Hash)] +struct UniqueID { + device: u64, + inode: u64, +} + +#[cfg(not(windows))] +fn generate_unique_id(metadata: &std::fs::Metadata) -> Option { + use std::os::unix::fs::MetadataExt; + // If the entry has more than one hard link, generate + // a unique ID consisting of device and inode in order + // not to count this entry twice. + if metadata.is_file() && metadata.nlink() > 1 { + Some(UniqueID { + device: metadata.dev(), + inode: metadata.ino(), + }) + } else { + None + } +} + +#[cfg(windows)] +fn generate_unique_id(_metadata: &std::fs::Metadata) -> Option { + // Windows-internal tools such as Powershell, Explorer or `dir` are not respecting hardlinks + // or junction points when determining the size of a directory. `diskus` does the same and + // counts such entries multiple times (on Unix systems, multiple hardlinks to a single file are + // counted just once). + None +} From 13307d2df3a3a30332d7d705956cdf28227eb67c Mon Sep 17 00:00:00 2001 From: Matthew Mckee Date: Sat, 6 Dec 2025 14:49:54 +0000 Subject: [PATCH 04/11] Sort uv crate Cargo.toml --- crates/uv/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/uv/Cargo.toml b/crates/uv/Cargo.toml index c9d4ac9f2b12d..6076b63b727fc 100644 --- a/crates/uv/Cargo.toml +++ b/crates/uv/Cargo.toml @@ -74,6 +74,7 @@ axoupdater = { workspace = true, features = [ base64 = { workspace = true } clap = { workspace = true, features = ["derive", "string", "wrap_help"] } console = { workspace = true } +crossbeam-channel = { workspace = true } ctrlc = { workspace = true } dotenvy = { workspace = true } dunce = { workspace = true } @@ -116,7 +117,6 @@ version-ranges = { workspace = true } walkdir = { workspace = true } which = { workspace = true } zip = { workspace = true } -crossbeam-channel = { workspace = true } [target.'cfg(target_os = "windows")'.dependencies] arrayvec = { workspace = true } From 968045cba5b6a0d497c844cd22d0436bfe21a2f1 Mon Sep 17 00:00:00 2001 From: Matthew Mckee Date: Sat, 6 Dec 2025 14:50:57 +0000 Subject: [PATCH 05/11] Update test comment --- crates/uv/tests/it/cache_size.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/uv/tests/it/cache_size.rs b/crates/uv/tests/it/cache_size.rs index 596130acb699b..ffa554b97f48e 100644 --- a/crates/uv/tests/it/cache_size.rs +++ b/crates/uv/tests/it/cache_size.rs @@ -58,7 +58,7 @@ fn cache_size_with_packages_human() { "); } -/// Test that `cache size --threads 1` uses the correct number of threads, via a `info` log statement. +/// Test that `cache size --threads 2` uses the correct number of threads, via a `info` log statement. #[test] fn cache_size_with_packages_threads() { let context = TestContext::new("3.12"); @@ -66,7 +66,7 @@ fn cache_size_with_packages_threads() { // Install a requirement to populate the cache. context.pip_install().arg("iniconfig").assert().success(); - // Check cache size with `--threads 1` + // Check cache size with `--threads 2` uv_snapshot!(context.with_filtered_cache_size().filters(), context.cache_size().arg("--preview").arg("--threads").arg("2").arg("-v"), @r" success: true exit_code: 0 From 2ced2167b932fadb2b8a6673cabf5aadcd6e2b35 Mon Sep 17 00:00:00 2001 From: Matthew Mckee Date: Sun, 7 Dec 2025 14:10:21 +0000 Subject: [PATCH 06/11] Use diskus again --- Cargo.lock | 21 ++++-- Cargo.toml | 1 + crates/uv/Cargo.toml | 3 +- crates/uv/src/commands/cache_size.rs | 104 ++------------------------- 4 files changed, 24 insertions(+), 105 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 21dae51b9aecc..288b0ce49b795 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1264,6 +1264,16 @@ dependencies = [ "windows-sys 0.61.0", ] +[[package]] +name = "diskus" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec07379c016f78e7ddcd953663b9ed17928ff384928d34d824ed7e463bd3d908" +dependencies = [ + "crossbeam-channel", + "rayon", +] + [[package]] name = "dispatch2" version = "0.3.0" @@ -3452,9 +3462,9 @@ dependencies = [ [[package]] name = "rayon" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" +checksum = "368f01d005bf8fd9b1206fb6fa653e6c4a81ceb1466406b81792d87c5677a58f" dependencies = [ "either", "rayon-core", @@ -3462,9 +3472,9 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.12.1" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" +checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91" dependencies = [ "crossbeam-deque", "crossbeam-utils", @@ -5410,8 +5420,8 @@ dependencies = [ "byteorder", "clap", "console 0.16.1", - "crossbeam-channel", "ctrlc", + "diskus", "dotenvy", "dunce", "embed-manifest", @@ -5433,7 +5443,6 @@ dependencies = [ "owo-colors", "petgraph", "predicates", - "rayon", "regex", "reqwest", "rkyv", diff --git a/Cargo.toml b/Cargo.toml index 0f4f21049e6f9..7f1d87a435570 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -104,6 +104,7 @@ ctrlc = { version = "3.4.5" } cyclonedx-bom = { version = "0.8.0" } dashmap = { version = "6.1.0" } data-encoding = { version = "2.6.0" } +diskus = { version = "0.9.0", default-features = false } dotenvy = { version = "0.15.7" } dunce = { version = "1.0.5" } either = { version = "1.13.0" } diff --git a/crates/uv/Cargo.toml b/crates/uv/Cargo.toml index 6076b63b727fc..fdcfdd49ba27a 100644 --- a/crates/uv/Cargo.toml +++ b/crates/uv/Cargo.toml @@ -74,7 +74,6 @@ axoupdater = { workspace = true, features = [ base64 = { workspace = true } clap = { workspace = true, features = ["derive", "string", "wrap_help"] } console = { workspace = true } -crossbeam-channel = { workspace = true } ctrlc = { workspace = true } dotenvy = { workspace = true } dunce = { workspace = true } @@ -91,7 +90,6 @@ miette = { workspace = true, features = ["fancy-no-backtrace"] } open = { workspace = true } owo-colors = { workspace = true } petgraph = { workspace = true } -rayon = { workspace = true } regex = { workspace = true } reqwest = { workspace = true } rkyv = { workspace = true } @@ -117,6 +115,7 @@ version-ranges = { workspace = true } walkdir = { workspace = true } which = { workspace = true } zip = { workspace = true } +diskus = { workspace = true } [target.'cfg(target_os = "windows")'.dependencies] arrayvec = { workspace = true } diff --git a/crates/uv/src/commands/cache_size.rs b/crates/uv/src/commands/cache_size.rs index 509b015c2fbcf..de49a0fc84690 100644 --- a/crates/uv/src/commands/cache_size.rs +++ b/crates/uv/src/commands/cache_size.rs @@ -1,12 +1,7 @@ -use std::collections::HashSet; use std::fmt::Write; -use std::num::NonZero; -use std::path::{Path, PathBuf}; -use std::thread; use anyhow::Result; -use crossbeam_channel as channel; -use rayon::{self, prelude::*}; +use diskus::DiskUsage; use crate::commands::{ExitStatus, human_readable_bytes}; use crate::printer::Printer; @@ -38,15 +33,14 @@ pub(crate) fn cache_size( return Ok(ExitStatus::Success); } - let num_threads = threads.unwrap_or_else(|| { - std::thread::available_parallelism() - .map(NonZero::get) - .unwrap_or(1) - }); + let mut disk_usage = DiskUsage::new(vec![cache.root().to_path_buf()]); - tracing::info!("Using {} threads to calculate cache size", num_threads); + if let Some(n) = threads { + tracing::info!("Using {} threads to calculate cache size", n); + disk_usage = disk_usage.num_workers(n); + } - let total_bytes = calculate_cache_size(num_threads, cache.root()); + let total_bytes = disk_usage.count_ignoring_errors(); if human_readable { let (bytes, unit) = human_readable_bytes(total_bytes); @@ -57,87 +51,3 @@ pub(crate) fn cache_size( Ok(ExitStatus::Success) } - -/// Calculate the total size of the cache using multiple threads. -/// -/// Vendored from . -fn calculate_cache_size(num_threads: usize, path: &Path) -> u64 { - let (tx, rx) = channel::unbounded(); - - let receiver_thread = thread::spawn(move || { - let mut total = 0; - let mut ids = HashSet::new(); - for (unique_id, size) in rx { - if let Some(unique_id) = unique_id { - if ids.insert(unique_id) { - total += size; - } - } else { - total += size; - } - } - total - }); - - let pool = rayon::ThreadPoolBuilder::new() - .num_threads(num_threads) - .build() - .unwrap(); - pool.install(|| walk(tx, &[path.to_path_buf()])); - - receiver_thread.join().unwrap() -} - -fn walk(tx: channel::Sender<(Option, u64)>, entries: &[PathBuf]) { - entries.into_par_iter().for_each_with(tx, |tx_ref, entry| { - if let Ok(metadata) = entry.symlink_metadata() { - let unique_id = generate_unique_id(&metadata); - - let size = &metadata.len(); - - tx_ref.send((unique_id, *size)).unwrap(); - - if metadata.is_dir() { - let mut children = vec![]; - if let Ok(child_entries) = fs_err::read_dir(entry) { - for child_entry in child_entries.flatten() { - children.push(child_entry.path()); - } - } - - walk(tx_ref.clone(), &children[..]); - } - } - }); -} - -#[derive(Eq, PartialEq, Hash)] -struct UniqueID { - device: u64, - inode: u64, -} - -#[cfg(not(windows))] -fn generate_unique_id(metadata: &std::fs::Metadata) -> Option { - use std::os::unix::fs::MetadataExt; - // If the entry has more than one hard link, generate - // a unique ID consisting of device and inode in order - // not to count this entry twice. - if metadata.is_file() && metadata.nlink() > 1 { - Some(UniqueID { - device: metadata.dev(), - inode: metadata.ino(), - }) - } else { - None - } -} - -#[cfg(windows)] -fn generate_unique_id(_metadata: &std::fs::Metadata) -> Option { - // Windows-internal tools such as Powershell, Explorer or `dir` are not respecting hardlinks - // or junction points when determining the size of a directory. `diskus` does the same and - // counts such entries multiple times (on Unix systems, multiple hardlinks to a single file are - // counted just once). - None -} From 59085726200f8d840cc0cbc579d6a98c05247712 Mon Sep 17 00:00:00 2001 From: Matthew Mckee Date: Sun, 7 Dec 2025 14:10:51 +0000 Subject: [PATCH 07/11] Remove crossbeamchannel dep --- Cargo.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 7f1d87a435570..347ad8369d059 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -98,7 +98,6 @@ clap = { version = "4.5.17", features = ["derive", "env", "string", "wrap_help"] clap_complete_command = { version = "0.6.1" } configparser = { version = "3.1.0" } console = { version = "0.16.0", default-features = false, features = ["std"] } -crossbeam-channel = { version = "0.5.15" } csv = { version = "1.3.0" } ctrlc = { version = "3.4.5" } cyclonedx-bom = { version = "0.8.0" } From b51955c06c249f89509181808c44afee6d7a45f7 Mon Sep 17 00:00:00 2001 From: Matthew Mckee Date: Mon, 8 Dec 2025 16:06:48 +0000 Subject: [PATCH 08/11] Sort Cargo.toml dependencies --- crates/uv/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/uv/Cargo.toml b/crates/uv/Cargo.toml index fdcfdd49ba27a..12306a1cdf0ee 100644 --- a/crates/uv/Cargo.toml +++ b/crates/uv/Cargo.toml @@ -75,6 +75,7 @@ base64 = { workspace = true } clap = { workspace = true, features = ["derive", "string", "wrap_help"] } console = { workspace = true } ctrlc = { workspace = true } +diskus = { workspace = true } dotenvy = { workspace = true } dunce = { workspace = true } flate2 = { workspace = true, default-features = false } @@ -115,7 +116,6 @@ version-ranges = { workspace = true } walkdir = { workspace = true } which = { workspace = true } zip = { workspace = true } -diskus = { workspace = true } [target.'cfg(target_os = "windows")'.dependencies] arrayvec = { workspace = true } From 6fe811db35963879cf0db4c5118c5ede8489b48c Mon Sep 17 00:00:00 2001 From: Matthew Mckee Date: Mon, 8 Dec 2025 16:08:48 +0000 Subject: [PATCH 09/11] regenerate reference/cli.md --- docs/reference/cli.md | 110 ++++++++++++++++++++++-------------------- 1 file changed, 58 insertions(+), 52 deletions(-) diff --git a/docs/reference/cli.md b/docs/reference/cli.md index c8d3285fc5b9d..3bd4da753d6ac 100644 --- a/docs/reference/cli.md +++ b/docs/reference/cli.md @@ -112,7 +112,7 @@ uv auth login [OPTIONS]

When disabled, uv will only use locally cached data and locally available files.

May also be set with the UV_OFFLINE environment variable.

--password password

The password to use for the service.

Use - to read the password from stdin.

-
--project project

Run the command within the given project directory.

+
--project project

Discover a project in the given directory.

All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

See --directory to change the working directory entirely.

@@ -185,7 +185,7 @@ uv auth logout [OPTIONS]

May also be set with the UV_NO_PROGRESS environment variable.

--no-python-downloads

Disable automatic downloads of Python.

--offline

Disable network access.

When disabled, uv will only use locally cached data and locally available files.

-

May also be set with the UV_OFFLINE environment variable.

--project project

Run the command within the given project directory.

+

May also be set with the UV_OFFLINE environment variable.

--project project

Discover a project in the given directory.

All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

See --directory to change the working directory entirely.

@@ -254,7 +254,7 @@ uv auth token [OPTIONS]

May also be set with the UV_NO_PROGRESS environment variable.

--no-python-downloads

Disable automatic downloads of Python.

--offline

Disable network access.

When disabled, uv will only use locally cached data and locally available files.

-

May also be set with the UV_OFFLINE environment variable.

--project project

Run the command within the given project directory.

+

May also be set with the UV_OFFLINE environment variable.

--project project

Discover a project in the given directory.

All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

See --directory to change the working directory entirely.

@@ -324,7 +324,7 @@ uv auth dir [OPTIONS] [SERVICE]

May also be set with the UV_NO_PROGRESS environment variable.

--no-python-downloads

Disable automatic downloads of Python.

--offline

Disable network access.

When disabled, uv will only use locally cached data and locally available files.

-

May also be set with the UV_OFFLINE environment variable.

--project project

Run the command within the given project directory.

+

May also be set with the UV_OFFLINE environment variable.

--project project

Discover a project in the given directory.

All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

See --directory to change the working directory entirely.

@@ -526,7 +526,7 @@ uv run [OPTIONS] [COMMAND]
  • 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
  • -
    --project project

    Run the command within the given project directory.

    +
    --project project

    Discover a project in the given directory.

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    See --directory to change the working directory entirely.

    @@ -722,7 +722,7 @@ uv init [OPTIONS] [PATH]

    Defines a [build-system] for the project.

    This is the default behavior when using --lib or --build-backend.

    When using --app, this will include a [project.scripts] entrypoint and use a src/ project structure.

    -
    --project project

    Run the command within the given project directory.

    +
    --project project

    Discover a project in the given directory.

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    See --directory to change the working directory entirely.

    @@ -933,7 +933,7 @@ uv add [OPTIONS] >
  • 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
  • -
    --project project

    Run the command within the given project directory.

    +
    --project project

    Discover a project in the given directory.

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    See --directory to change the working directory entirely.

    @@ -1123,7 +1123,7 @@ uv remove [OPTIONS] ...
  • 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
  • -
    --project project

    Run the command within the given project directory.

    +
    --project project

    Discover a project in the given directory.

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    See --directory to change the working directory entirely.

    @@ -1309,7 +1309,7 @@ uv version [OPTIONS] [VALUE]
  • 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
  • -
    --project project

    Run the command within the given project directory.

    +
    --project project

    Discover a project in the given directory.

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    See --directory to change the working directory entirely.

    @@ -1536,7 +1536,7 @@ uv sync [OPTIONS]
  • 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
  • -
    --project project

    Run the command within the given project directory.

    +
    --project project

    Discover a project in the given directory.

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    See --directory to change the working directory entirely.

    @@ -1755,7 +1755,7 @@ uv lock [OPTIONS]
  • 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
  • -
    --project project

    Run the command within the given project directory.

    +
    --project project

    Discover a project in the given directory.

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    See --directory to change the working directory entirely.

    @@ -1971,7 +1971,7 @@ uv export [OPTIONS]
  • 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
  • -
    --project project

    Run the command within the given project directory.

    +
    --project project

    Discover a project in the given directory.

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    See --directory to change the working directory entirely.

    @@ -2151,7 +2151,7 @@ uv tree [OPTIONS]
  • 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
  • -
    --project project

    Run the command within the given project directory.

    +
    --project project

    Discover a project in the given directory.

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    See --directory to change the working directory entirely.

    @@ -2300,7 +2300,7 @@ uv format [OPTIONS] [-- ...]
    --no-python-downloads

    Disable automatic downloads of Python.

    --offline

    Disable network access.

    When disabled, uv will only use locally cached data and locally available files.

    -

    May also be set with the UV_OFFLINE environment variable.

    --project project

    Run the command within the given project directory.

    +

    May also be set with the UV_OFFLINE environment variable.

    --project project

    Discover a project in the given directory.

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    See --directory to change the working directory entirely.

    @@ -2487,7 +2487,7 @@ uv tool run [OPTIONS] [COMMAND]
  • 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
  • -
    --project project

    Run the command within the given project directory.

    +
    --project project

    Discover a project in the given directory.

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    See --directory to change the working directory entirely.

    @@ -2718,7 +2718,7 @@ uv tool install [OPTIONS]
  • 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
  • -
    --project project

    Run the command within the given project directory.

    +
    --project project

    Discover a project in the given directory.

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    See --directory to change the working directory entirely.

    @@ -2936,7 +2936,7 @@ uv tool upgrade [OPTIONS] ...
  • 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
  • -
    --project project

    Run the command within the given project directory.

    +
    --project project

    Discover a project in the given directory.

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    See --directory to change the working directory entirely.

    @@ -3058,7 +3058,7 @@ uv tool list [OPTIONS]

    For example, spinners or progress bars.

    May also be set with the UV_NO_PROGRESS environment variable.

    --offline

    Disable network access.

    When disabled, uv will only use locally cached data and locally available files.

    -

    May also be set with the UV_OFFLINE environment variable.

    --project project

    Run the command within the given project directory.

    +

    May also be set with the UV_OFFLINE environment variable.

    --project project

    Discover a project in the given directory.

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    See --directory to change the working directory entirely.

    @@ -3127,7 +3127,7 @@ uv tool uninstall [OPTIONS] ...

    May also be set with the UV_NO_PROGRESS environment variable.

    --no-python-downloads

    Disable automatic downloads of Python.

    --offline

    Disable network access.

    When disabled, uv will only use locally cached data and locally available files.

    -

    May also be set with the UV_OFFLINE environment variable.

    --project project

    Run the command within the given project directory.

    +

    May also be set with the UV_OFFLINE environment variable.

    --project project

    Discover a project in the given directory.

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    See --directory to change the working directory entirely.

    @@ -3191,7 +3191,7 @@ uv tool update-shell [OPTIONS]

    May also be set with the UV_NO_PROGRESS environment variable.

    --no-python-downloads

    Disable automatic downloads of Python.

    --offline

    Disable network access.

    When disabled, uv will only use locally cached data and locally available files.

    -

    May also be set with the UV_OFFLINE environment variable.

    --project project

    Run the command within the given project directory.

    +

    May also be set with the UV_OFFLINE environment variable.

    --project project

    Discover a project in the given directory.

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    See --directory to change the working directory entirely.

    @@ -3268,7 +3268,7 @@ from the following environment variables, in order of preference:

    May also be set with the UV_NO_PROGRESS environment variable.

    --no-python-downloads

    Disable automatic downloads of Python.

    --offline

    Disable network access.

    When disabled, uv will only use locally cached data and locally available files.

    -

    May also be set with the UV_OFFLINE environment variable.

    --project project

    Run the command within the given project directory.

    +

    May also be set with the UV_OFFLINE environment variable.

    --project project

    Discover a project in the given directory.

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    See --directory to change the working directory entirely.

    @@ -3419,7 +3419,7 @@ uv python list [OPTIONS] [REQUEST]
    • text: Plain text (for humans)
    • json: JSON (for computers)
    • -
    --project project

    Run the command within the given project directory.

    +
    --project project

    Discover a project in the given directory.

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    See --directory to change the working directory entirely.

    @@ -3514,7 +3514,7 @@ uv python install [OPTIONS] [TARGETS]...

    This can also be set with UV_PYTHON_INSTALL_REGISTRY=0.

    --offline

    Disable network access.

    When disabled, uv will only use locally cached data and locally available files.

    -

    May also be set with the UV_OFFLINE environment variable.

    --project project

    Run the command within the given project directory.

    +

    May also be set with the UV_OFFLINE environment variable.

    --project project

    Discover a project in the given directory.

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    See --directory to change the working directory entirely.

    @@ -3606,7 +3606,7 @@ uv python upgrade [OPTIONS] [TARGETS]...

    May also be set with the UV_NO_PROGRESS environment variable.

    --no-python-downloads

    Disable automatic downloads of Python.

    --offline

    Disable network access.

    When disabled, uv will only use locally cached data and locally available files.

    -

    May also be set with the UV_OFFLINE environment variable.

    --project project

    Run the command within the given project directory.

    +

    May also be set with the UV_OFFLINE environment variable.

    --project project

    Discover a project in the given directory.

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    See --directory to change the working directory entirely.

    @@ -3682,7 +3682,7 @@ uv python find [OPTIONS] [REQUEST]
    --no-python-downloads

    Disable automatic downloads of Python.

    --offline

    Disable network access.

    When disabled, uv will only use locally cached data and locally available files.

    -

    May also be set with the UV_OFFLINE environment variable.

    --project project

    Run the command within the given project directory.

    +

    May also be set with the UV_OFFLINE environment variable.

    --project project

    Discover a project in the given directory.

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    See --directory to change the working directory entirely.

    @@ -3765,7 +3765,7 @@ uv python pin [OPTIONS] [REQUEST]
    --no-python-downloads

    Disable automatic downloads of Python.

    --offline

    Disable network access.

    When disabled, uv will only use locally cached data and locally available files.

    -

    May also be set with the UV_OFFLINE environment variable.

    --project project

    Run the command within the given project directory.

    +

    May also be set with the UV_OFFLINE environment variable.

    --project project

    Discover a project in the given directory.

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    See --directory to change the working directory entirely.

    @@ -3843,7 +3843,7 @@ from the following environment variables, in order of preference:

    May also be set with the UV_NO_PROGRESS environment variable.

    --no-python-downloads

    Disable automatic downloads of Python.

    --offline

    Disable network access.

    When disabled, uv will only use locally cached data and locally available files.

    -

    May also be set with the UV_OFFLINE environment variable.

    --project project

    Run the command within the given project directory.

    +

    May also be set with the UV_OFFLINE environment variable.

    --project project

    Discover a project in the given directory.

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    See --directory to change the working directory entirely.

    @@ -3909,7 +3909,7 @@ uv python uninstall [OPTIONS] ...

    May also be set with the UV_NO_PROGRESS environment variable.

    --no-python-downloads

    Disable automatic downloads of Python.

    --offline

    Disable network access.

    When disabled, uv will only use locally cached data and locally available files.

    -

    May also be set with the UV_OFFLINE environment variable.

    --project project

    Run the command within the given project directory.

    +

    May also be set with the UV_OFFLINE environment variable.

    --project project

    Discover a project in the given directory.

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    See --directory to change the working directory entirely.

    @@ -3973,7 +3973,7 @@ uv python update-shell [OPTIONS]

    May also be set with the UV_NO_PROGRESS environment variable.

    --no-python-downloads

    Disable automatic downloads of Python.

    --offline

    Disable network access.

    When disabled, uv will only use locally cached data and locally available files.

    -

    May also be set with the UV_OFFLINE environment variable.

    --project project

    Run the command within the given project directory.

    +

    May also be set with the UV_OFFLINE environment variable.

    --project project

    Discover a project in the given directory.

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    See --directory to change the working directory entirely.

    @@ -4186,7 +4186,7 @@ uv pip compile [OPTIONS] >
  • 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
  • -
    --project project

    Run the command within the given project directory.

    +
    --project project

    Discover a project in the given directory.

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    See --directory to change the working directory entirely.

    @@ -4471,7 +4471,7 @@ uv pip sync [OPTIONS] ...
    --prefix prefix

    Install packages into lib, bin, and other top-level folders under the specified directory, as if a virtual environment were present at that location.

    In general, prefer the use of --python to install into an alternate environment, as scripts and other artifacts installed via --prefix will reference the installing interpreter, rather than any interpreter added to the --prefix directory, rendering them non-portable.

    Unlike other install operations, this command does not require discovery of an existing Python environment and only searches for a Python interpreter to use for package resolution. If a suitable Python interpreter cannot be found, uv will install one. To disable this, add --no-python-downloads.

    -
    --project project

    Run the command within the given project directory.

    +
    --project project

    Discover a project in the given directory.

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    See --directory to change the working directory entirely.

    @@ -4774,7 +4774,7 @@ uv pip install [OPTIONS] |--editable 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
  • -
    --project project

    Run the command within the given project directory.

    +
    --project project

    Discover a project in the given directory.

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    See --directory to change the working directory entirely.

    @@ -4991,7 +4991,7 @@ uv pip uninstall [OPTIONS] >
    --offline

    Disable network access.

    When disabled, uv will only use locally cached data and locally available files.

    May also be set with the UV_OFFLINE environment variable.

    --prefix prefix

    Uninstall packages from the specified --prefix directory

    -
    --project project

    Run the command within the given project directory.

    +
    --project project

    Discover a project in the given directory.

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    See --directory to change the working directory entirely.

    @@ -5062,7 +5062,8 @@ uv pip freeze [OPTIONS]
    --offline

    Disable network access.

    When disabled, uv will only use locally cached data and locally available files.

    May also be set with the UV_OFFLINE environment variable.

    --path paths

    Restrict to the specified installation path for listing packages (can be used multiple times)

    -
    --project project

    Run the command within the given project directory.

    +
    --prefix prefix

    List packages from the specified --prefix directory

    +
    --project project

    Discover a project in the given directory.

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    See --directory to change the working directory entirely.

    @@ -5077,7 +5078,8 @@ Python environment if no virtual environment is found.

    --system

    List packages in the system Python environment.

    Disables discovery of virtual environments.

    See uv python for details on Python discovery.

    -

    May also be set with the UV_SYSTEM_PYTHON environment variable.

    --verbose, -v

    Use verbose output.

    +

    May also be set with the UV_SYSTEM_PYTHON environment variable.

    --target target

    List packages from the specified --target directory

    +
    --verbose, -v

    Use verbose output.

    You can configure fine-grained logging using the RUST_LOG environment variable. (https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#directives)

    @@ -5172,7 +5174,8 @@ uv pip list [OPTIONS]

    When disabled, uv will only use locally cached data and locally available files.

    May also be set with the UV_OFFLINE environment variable.

    --outdated

    List outdated packages.

    The latest version of each package will be shown alongside the installed version. Up-to-date packages will be omitted from the output.

    -
    --project project

    Run the command within the given project directory.

    +
    --prefix prefix

    List packages from the specified --prefix directory

    +
    --project project

    Discover a project in the given directory.

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    See --directory to change the working directory entirely.

    @@ -5187,7 +5190,8 @@ Python environment if no virtual environment is found.

    --system

    List packages in the system Python environment.

    Disables discovery of virtual environments.

    See uv python for details on Python discovery.

    -

    May also be set with the UV_SYSTEM_PYTHON environment variable.

    --verbose, -v

    Use verbose output.

    +

    May also be set with the UV_SYSTEM_PYTHON environment variable.

    --target target

    List packages from the specified --target directory

    +
    --verbose, -v

    Use verbose output.

    You can configure fine-grained logging using the RUST_LOG environment variable. (https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#directives)

    @@ -5244,7 +5248,8 @@ uv pip show [OPTIONS] [PACKAGE]...

    May also be set with the UV_NO_PROGRESS environment variable.

    --no-python-downloads

    Disable automatic downloads of Python.

    --offline

    Disable network access.

    When disabled, uv will only use locally cached data and locally available files.

    -

    May also be set with the UV_OFFLINE environment variable.

    --project project

    Run the command within the given project directory.

    +

    May also be set with the UV_OFFLINE environment variable.

    --prefix prefix

    Show a package from the specified --prefix directory

    +
    --project project

    Discover a project in the given directory.

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    See --directory to change the working directory entirely.

    @@ -5259,7 +5264,8 @@ system Python environment if no virtual environment is found.

    --system

    Show a package in the system Python environment.

    Disables discovery of virtual environments.

    See uv python for details on Python discovery.

    -

    May also be set with the UV_SYSTEM_PYTHON environment variable.

    --verbose, -v

    Use verbose output.

    +

    May also be set with the UV_SYSTEM_PYTHON environment variable.

    --target target

    Show a package from the specified --target directory

    +
    --verbose, -v

    Use verbose output.

    You can configure fine-grained logging using the RUST_LOG environment variable. (https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#directives)

    @@ -5348,7 +5354,7 @@ uv pip tree [OPTIONS]

    When disabled, uv will only use locally cached data and locally available files.

    May also be set with the UV_OFFLINE environment variable.

    --outdated

    Show the latest available version of each package in the tree

    --package package

    Display only the specified packages

    -
    --project project

    Run the command within the given project directory.

    +
    --project project

    Discover a project in the given directory.

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    See --directory to change the working directory entirely.

    @@ -5417,7 +5423,7 @@ uv pip check [OPTIONS]

    May also be set with the UV_NO_PROGRESS environment variable.

    --no-python-downloads

    Disable automatic downloads of Python.

    --offline

    Disable network access.

    When disabled, uv will only use locally cached data and locally available files.

    -

    May also be set with the UV_OFFLINE environment variable.

    --project project

    Run the command within the given project directory.

    +

    May also be set with the UV_OFFLINE environment variable.

    --project project

    Discover a project in the given directory.

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    See --directory to change the working directory entirely.

    @@ -5605,7 +5611,7 @@ uv venv [OPTIONS] [PATH]
    --no-python-downloads

    Disable automatic downloads of Python.

    --offline

    Disable network access.

    When disabled, uv will only use locally cached data and locally available files.

    -

    May also be set with the UV_OFFLINE environment variable.

    --project project

    Run the command within the given project directory.

    +

    May also be set with the UV_OFFLINE environment variable.

    --project project

    Discover a project in the given directory.

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    See --directory to change the working directory entirely.

    @@ -5790,7 +5796,7 @@ uv build [OPTIONS] [SRC]
  • 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
  • -
    --project project

    Run the command within the given project directory.

    +
    --project project

    Discover a project in the given directory.

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    See --directory to change the working directory entirely.

    @@ -5908,7 +5914,7 @@ uv publish --publish-url https://upload.pypi.org/legacy/ --check-url https://pyp
    --offline

    Disable network access.

    When disabled, uv will only use locally cached data and locally available files.

    May also be set with the UV_OFFLINE environment variable.

    --password, -p password

    The password for the upload

    -

    May also be set with the UV_PUBLISH_PASSWORD environment variable.

    --project project

    Run the command within the given project directory.

    +

    May also be set with the UV_PUBLISH_PASSWORD environment variable.

    --project project

    Discover a project in the given directory.

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    See --directory to change the working directory entirely.

    @@ -6005,7 +6011,7 @@ uv cache clean [OPTIONS] [PACKAGE]...

    May also be set with the UV_NO_PROGRESS environment variable.

    --no-python-downloads

    Disable automatic downloads of Python.

    --offline

    Disable network access.

    When disabled, uv will only use locally cached data and locally available files.

    -

    May also be set with the UV_OFFLINE environment variable.

    --project project

    Run the command within the given project directory.

    +

    May also be set with the UV_OFFLINE environment variable.

    --project project

    Discover a project in the given directory.

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    See --directory to change the working directory entirely.

    @@ -6068,7 +6074,7 @@ uv cache prune [OPTIONS]

    May also be set with the UV_NO_PROGRESS environment variable.

    --no-python-downloads

    Disable automatic downloads of Python.

    --offline

    Disable network access.

    When disabled, uv will only use locally cached data and locally available files.

    -

    May also be set with the UV_OFFLINE environment variable.

    --project project

    Run the command within the given project directory.

    +

    May also be set with the UV_OFFLINE environment variable.

    --project project

    Discover a project in the given directory.

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    See --directory to change the working directory entirely.

    @@ -6134,7 +6140,7 @@ uv cache dir [OPTIONS]

    May also be set with the UV_NO_PROGRESS environment variable.

    --no-python-downloads

    Disable automatic downloads of Python.

    --offline

    Disable network access.

    When disabled, uv will only use locally cached data and locally available files.

    -

    May also be set with the UV_OFFLINE environment variable.

    --project project

    Run the command within the given project directory.

    +

    May also be set with the UV_OFFLINE environment variable.

    --project project

    Discover a project in the given directory.

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    See --directory to change the working directory entirely.

    @@ -6195,7 +6201,7 @@ uv cache size [OPTIONS]

    May also be set with the UV_NO_PROGRESS environment variable.

    --no-python-downloads

    Disable automatic downloads of Python.

    --offline

    Disable network access.

    When disabled, uv will only use locally cached data and locally available files.

    -

    May also be set with the UV_OFFLINE environment variable.

    --project project

    Run the command within the given project directory.

    +

    May also be set with the UV_OFFLINE environment variable.

    --project project

    Discover a project in the given directory.

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    See --directory to change the working directory entirely.

    @@ -6276,7 +6282,7 @@ uv self update [OPTIONS] [TARGET_VERSION]

    May also be set with the UV_NO_PROGRESS environment variable.

    --no-python-downloads

    Disable automatic downloads of Python.

    --offline

    Disable network access.

    When disabled, uv will only use locally cached data and locally available files.

    -

    May also be set with the UV_OFFLINE environment variable.

    --project project

    Run the command within the given project directory.

    +

    May also be set with the UV_OFFLINE environment variable.

    --project project

    Discover a project in the given directory.

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    See --directory to change the working directory entirely.

    @@ -6335,7 +6341,7 @@ uv self version [OPTIONS]

    May also be set with the UV_NO_PROGRESS environment variable.

    --no-python-downloads

    Disable automatic downloads of Python.

    --offline

    Disable network access.

    When disabled, uv will only use locally cached data and locally available files.

    -

    May also be set with the UV_OFFLINE environment variable.

    --output-format output-format
    --project project

    Run the command within the given project directory.

    +

    May also be set with the UV_OFFLINE environment variable.

    --output-format output-format
    --project project

    Discover a project in the given directory.

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    See --directory to change the working directory entirely.

    @@ -6375,7 +6381,7 @@ uv generate-shell-completion [OPTIONS]

    By default, uv prefers using Python versions it manages. However, it will use system Python versions if a uv-managed Python is not installed. This option disables use of system Python versions.

    May also be set with the UV_MANAGED_PYTHON environment variable.

    --no-managed-python

    Disable use of uv-managed Python versions.

    Instead, uv will search for a suitable Python version on the system.

    -

    May also be set with the UV_NO_MANAGED_PYTHON environment variable.

    --project project

    Run the command within the given project directory.

    +

    May also be set with the UV_NO_MANAGED_PYTHON environment variable.

    --project project

    Discover a project in the given directory.

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    See --directory to change the working directory entirely.

    @@ -6434,7 +6440,7 @@ uv help [OPTIONS] [COMMAND]...

    May also be set with the UV_NO_PROGRESS environment variable.

    --no-python-downloads

    Disable automatic downloads of Python.

    --offline

    Disable network access.

    When disabled, uv will only use locally cached data and locally available files.

    -

    May also be set with the UV_OFFLINE environment variable.

    --project project

    Run the command within the given project directory.

    +

    May also be set with the UV_OFFLINE environment variable.

    --project project

    Discover a project in the given directory.

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    See --directory to change the working directory entirely.

    From a5f16fc638bcdca413971306fa47409c2b844aab Mon Sep 17 00:00:00 2001 From: Matthew Mckee Date: Mon, 8 Dec 2025 16:11:14 +0000 Subject: [PATCH 10/11] Remove reference/cli.md --- docs/reference/cli.md | 6453 ----------------------------------------- 1 file changed, 6453 deletions(-) delete mode 100644 docs/reference/cli.md diff --git a/docs/reference/cli.md b/docs/reference/cli.md deleted file mode 100644 index 3bd4da753d6ac..0000000000000 --- a/docs/reference/cli.md +++ /dev/null @@ -1,6453 +0,0 @@ -# CLI Reference - -## uv - -An extremely fast Python package manager. - -

    Usage

    - -``` -uv [OPTIONS] -``` - -

    Commands

    - -
    uv auth

    Manage authentication

    -
    uv run

    Run a command or script

    -
    uv init

    Create a new project

    -
    uv add

    Add dependencies to the project

    -
    uv remove

    Remove dependencies from the project

    -
    uv version

    Read or update the project's version

    -
    uv sync

    Update the project's environment

    -
    uv lock

    Update the project's lockfile

    -
    uv export

    Export the project's lockfile to an alternate format

    -
    uv tree

    Display the project's dependency tree

    -
    uv format

    Format Python code in the project

    -
    uv tool

    Run and install commands provided by Python packages

    -
    uv python

    Manage Python versions and installations

    -
    uv pip

    Manage Python packages with a pip-compatible interface

    -
    uv venv

    Create a virtual environment

    -
    uv build

    Build Python packages into source distributions and wheels

    -
    uv publish

    Upload distributions to an index

    -
    uv cache

    Manage uv's cache

    -
    uv self

    Manage the uv executable

    -
    uv help

    Display documentation for a command

    -
    - -## uv auth - -Manage authentication - -

    Usage

    - -``` -uv auth [OPTIONS] -``` - -

    Commands

    - -
    uv auth login

    Login to a service

    -
    uv auth logout

    Logout of a service

    -
    uv auth token

    Show the authentication token for a service

    -
    uv auth dir

    Show the path to the uv credentials directory

    -
    - -### uv auth login - -Login to a service - -

    Usage

    - -``` -uv auth login [OPTIONS] -``` - -

    Arguments

    - -
    SERVICE

    The domain or URL of the service to log into

    -
    - -

    Options

    - -
    --allow-insecure-host, --trusted-host allow-insecure-host

    Allow insecure connections to a host.

    -

    Can be provided multiple times.

    -

    Expects to receive either a hostname (e.g., localhost), a host-port pair (e.g., localhost:8080), or a URL (e.g., https://localhost).

    -

    WARNING: Hosts included in this list will not be verified against the system's certificate store. Only use --allow-insecure-host in a secure network with verified sources, as it bypasses SSL verification and could expose you to MITM attacks.

    -

    May also be set with the UV_INSECURE_HOST environment variable.

    --cache-dir cache-dir

    Path to the cache directory.

    -

    Defaults to $XDG_CACHE_HOME/uv or $HOME/.cache/uv on macOS and Linux, and %LOCALAPPDATA%\uv\cache on Windows.

    -

    To view the location of the cache directory, run uv cache dir.

    -

    May also be set with the UV_CACHE_DIR environment variable.

    --color color-choice

    Control the use of color in output.

    -

    By default, uv will automatically detect support for colors when writing to a terminal.

    -

    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.

    -

    While uv configuration can be included in a pyproject.toml file, it is not allowed in this context.

    -

    May also be set with the UV_CONFIG_FILE environment variable.

    --directory directory

    Change to the given directory prior to running the command.

    -

    Relative paths are resolved with the given directory as the base.

    -

    See --project to only change the project root directory.

    -

    May also be set with the UV_WORKING_DIR environment variable.

    --help, -h

    Display the concise help for this command

    -
    --keyring-provider keyring-provider

    The keyring provider to use for storage of credentials.

    -

    Only --keyring-provider native is supported for login, which uses the system keyring via an integration built into uv.

    -

    May also be set with the UV_KEYRING_PROVIDER environment variable.

    Possible values:

    -
      -
    • disabled: Do not use keyring for credential lookup
    • -
    • subprocess: Use the keyring command for credential lookup
    • -
    --managed-python

    Require use of uv-managed Python versions.

    -

    By default, uv prefers using Python versions it manages. However, it will use system Python versions if a uv-managed Python is not installed. This option disables use of system Python versions.

    -

    May also be set with the UV_MANAGED_PYTHON environment variable.

    --native-tls

    Whether to load TLS certificates from the platform's native certificate store.

    -

    By default, uv loads certificates from the bundled webpki-roots crate. The webpki-roots are a reliable set of trust roots from Mozilla, and including them in uv improves portability and performance (especially on macOS).

    -

    However, in some cases, you may want to use the platform's native certificate store, especially if you're relying on a corporate trust root (e.g., for a mandatory proxy) that's included in your system's certificate store.

    -

    May also be set with the UV_NATIVE_TLS environment variable.

    --no-cache, --no-cache-dir, -n

    Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation

    -

    May also be set with the UV_NO_CACHE environment variable.

    --no-config

    Avoid discovering configuration files (pyproject.toml, uv.toml).

    -

    Normally, configuration files are discovered in the current directory, parent directories, or user configuration directories.

    -

    May also be set with the UV_NO_CONFIG environment variable.

    --no-managed-python

    Disable use of uv-managed Python versions.

    -

    Instead, uv will search for a suitable Python version on the system.

    -

    May also be set with the UV_NO_MANAGED_PYTHON environment variable.

    --no-progress

    Hide all progress outputs.

    -

    For example, spinners or progress bars.

    -

    May also be set with the UV_NO_PROGRESS environment variable.

    --no-python-downloads

    Disable automatic downloads of Python.

    -
    --offline

    Disable network access.

    -

    When disabled, uv will only use locally cached data and locally available files.

    -

    May also be set with the UV_OFFLINE environment variable.

    --password password

    The password to use for the service.

    -

    Use - to read the password from stdin.

    -
    --project project

    Discover a project in the given directory.

    -

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    -

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    -

    See --directory to change the working directory entirely.

    -

    This setting has no effect when used in the uv pip interface.

    -

    May also be set with the UV_PROJECT environment variable.

    --quiet, -q

    Use quiet output.

    -

    Repeating this option, e.g., -qq, will enable a silent mode in which uv will write no output to stdout.

    -
    --token, -t token

    The token to use for the service.

    -

    The username will be set to __token__.

    -

    Use - to read the token from stdin.

    -
    --username, -u username

    The username to use for the service

    -
    --verbose, -v

    Use verbose output.

    -

    You can configure fine-grained logging using the RUST_LOG environment variable. (https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#directives)

    -
    - -### uv auth logout - -Logout of a service - -

    Usage

    - -``` -uv auth logout [OPTIONS] -``` - -

    Arguments

    - -
    SERVICE

    The domain or URL of the service to logout from

    -
    - -

    Options

    - -
    --allow-insecure-host, --trusted-host allow-insecure-host

    Allow insecure connections to a host.

    -

    Can be provided multiple times.

    -

    Expects to receive either a hostname (e.g., localhost), a host-port pair (e.g., localhost:8080), or a URL (e.g., https://localhost).

    -

    WARNING: Hosts included in this list will not be verified against the system's certificate store. Only use --allow-insecure-host in a secure network with verified sources, as it bypasses SSL verification and could expose you to MITM attacks.

    -

    May also be set with the UV_INSECURE_HOST environment variable.

    --cache-dir cache-dir

    Path to the cache directory.

    -

    Defaults to $XDG_CACHE_HOME/uv or $HOME/.cache/uv on macOS and Linux, and %LOCALAPPDATA%\uv\cache on Windows.

    -

    To view the location of the cache directory, run uv cache dir.

    -

    May also be set with the UV_CACHE_DIR environment variable.

    --color color-choice

    Control the use of color in output.

    -

    By default, uv will automatically detect support for colors when writing to a terminal.

    -

    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.

    -

    While uv configuration can be included in a pyproject.toml file, it is not allowed in this context.

    -

    May also be set with the UV_CONFIG_FILE environment variable.

    --directory directory

    Change to the given directory prior to running the command.

    -

    Relative paths are resolved with the given directory as the base.

    -

    See --project to only change the project root directory.

    -

    May also be set with the UV_WORKING_DIR environment variable.

    --help, -h

    Display the concise help for this command

    -
    --keyring-provider keyring-provider

    The keyring provider to use for storage of credentials.

    -

    Only --keyring-provider native is supported for logout, which uses the system keyring via an integration built into uv.

    -

    May also be set with the UV_KEYRING_PROVIDER environment variable.

    Possible values:

    -
      -
    • disabled: Do not use keyring for credential lookup
    • -
    • subprocess: Use the keyring command for credential lookup
    • -
    --managed-python

    Require use of uv-managed Python versions.

    -

    By default, uv prefers using Python versions it manages. However, it will use system Python versions if a uv-managed Python is not installed. This option disables use of system Python versions.

    -

    May also be set with the UV_MANAGED_PYTHON environment variable.

    --native-tls

    Whether to load TLS certificates from the platform's native certificate store.

    -

    By default, uv loads certificates from the bundled webpki-roots crate. The webpki-roots are a reliable set of trust roots from Mozilla, and including them in uv improves portability and performance (especially on macOS).

    -

    However, in some cases, you may want to use the platform's native certificate store, especially if you're relying on a corporate trust root (e.g., for a mandatory proxy) that's included in your system's certificate store.

    -

    May also be set with the UV_NATIVE_TLS environment variable.

    --no-cache, --no-cache-dir, -n

    Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation

    -

    May also be set with the UV_NO_CACHE environment variable.

    --no-config

    Avoid discovering configuration files (pyproject.toml, uv.toml).

    -

    Normally, configuration files are discovered in the current directory, parent directories, or user configuration directories.

    -

    May also be set with the UV_NO_CONFIG environment variable.

    --no-managed-python

    Disable use of uv-managed Python versions.

    -

    Instead, uv will search for a suitable Python version on the system.

    -

    May also be set with the UV_NO_MANAGED_PYTHON environment variable.

    --no-progress

    Hide all progress outputs.

    -

    For example, spinners or progress bars.

    -

    May also be set with the UV_NO_PROGRESS environment variable.

    --no-python-downloads

    Disable automatic downloads of Python.

    -
    --offline

    Disable network access.

    -

    When disabled, uv will only use locally cached data and locally available files.

    -

    May also be set with the UV_OFFLINE environment variable.

    --project project

    Discover a project in the given directory.

    -

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    -

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    -

    See --directory to change the working directory entirely.

    -

    This setting has no effect when used in the uv pip interface.

    -

    May also be set with the UV_PROJECT environment variable.

    --quiet, -q

    Use quiet output.

    -

    Repeating this option, e.g., -qq, will enable a silent mode in which uv will write no output to stdout.

    -
    --username, -u username

    The username to logout

    -
    --verbose, -v

    Use verbose output.

    -

    You can configure fine-grained logging using the RUST_LOG environment variable. (https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#directives)

    -
    - -### uv auth token - -Show the authentication token for a service - -

    Usage

    - -``` -uv auth token [OPTIONS] -``` - -

    Arguments

    - -
    SERVICE

    The domain or URL of the service to lookup

    -
    - -

    Options

    - -
    --allow-insecure-host, --trusted-host allow-insecure-host

    Allow insecure connections to a host.

    -

    Can be provided multiple times.

    -

    Expects to receive either a hostname (e.g., localhost), a host-port pair (e.g., localhost:8080), or a URL (e.g., https://localhost).

    -

    WARNING: Hosts included in this list will not be verified against the system's certificate store. Only use --allow-insecure-host in a secure network with verified sources, as it bypasses SSL verification and could expose you to MITM attacks.

    -

    May also be set with the UV_INSECURE_HOST environment variable.

    --cache-dir cache-dir

    Path to the cache directory.

    -

    Defaults to $XDG_CACHE_HOME/uv or $HOME/.cache/uv on macOS and Linux, and %LOCALAPPDATA%\uv\cache on Windows.

    -

    To view the location of the cache directory, run uv cache dir.

    -

    May also be set with the UV_CACHE_DIR environment variable.

    --color color-choice

    Control the use of color in output.

    -

    By default, uv will automatically detect support for colors when writing to a terminal.

    -

    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.

    -

    While uv configuration can be included in a pyproject.toml file, it is not allowed in this context.

    -

    May also be set with the UV_CONFIG_FILE environment variable.

    --directory directory

    Change to the given directory prior to running the command.

    -

    Relative paths are resolved with the given directory as the base.

    -

    See --project to only change the project root directory.

    -

    May also be set with the UV_WORKING_DIR environment variable.

    --help, -h

    Display the concise help for this command

    -
    --keyring-provider keyring-provider

    The keyring provider to use for reading credentials

    -

    May also be set with the UV_KEYRING_PROVIDER environment variable.

    Possible values:

    -
      -
    • disabled: Do not use keyring for credential lookup
    • -
    • subprocess: Use the keyring command for credential lookup
    • -
    --managed-python

    Require use of uv-managed Python versions.

    -

    By default, uv prefers using Python versions it manages. However, it will use system Python versions if a uv-managed Python is not installed. This option disables use of system Python versions.

    -

    May also be set with the UV_MANAGED_PYTHON environment variable.

    --native-tls

    Whether to load TLS certificates from the platform's native certificate store.

    -

    By default, uv loads certificates from the bundled webpki-roots crate. The webpki-roots are a reliable set of trust roots from Mozilla, and including them in uv improves portability and performance (especially on macOS).

    -

    However, in some cases, you may want to use the platform's native certificate store, especially if you're relying on a corporate trust root (e.g., for a mandatory proxy) that's included in your system's certificate store.

    -

    May also be set with the UV_NATIVE_TLS environment variable.

    --no-cache, --no-cache-dir, -n

    Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation

    -

    May also be set with the UV_NO_CACHE environment variable.

    --no-config

    Avoid discovering configuration files (pyproject.toml, uv.toml).

    -

    Normally, configuration files are discovered in the current directory, parent directories, or user configuration directories.

    -

    May also be set with the UV_NO_CONFIG environment variable.

    --no-managed-python

    Disable use of uv-managed Python versions.

    -

    Instead, uv will search for a suitable Python version on the system.

    -

    May also be set with the UV_NO_MANAGED_PYTHON environment variable.

    --no-progress

    Hide all progress outputs.

    -

    For example, spinners or progress bars.

    -

    May also be set with the UV_NO_PROGRESS environment variable.

    --no-python-downloads

    Disable automatic downloads of Python.

    -
    --offline

    Disable network access.

    -

    When disabled, uv will only use locally cached data and locally available files.

    -

    May also be set with the UV_OFFLINE environment variable.

    --project project

    Discover a project in the given directory.

    -

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    -

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    -

    See --directory to change the working directory entirely.

    -

    This setting has no effect when used in the uv pip interface.

    -

    May also be set with the UV_PROJECT environment variable.

    --quiet, -q

    Use quiet output.

    -

    Repeating this option, e.g., -qq, will enable a silent mode in which uv will write no output to stdout.

    -
    --username, -u username

    The username to lookup

    -
    --verbose, -v

    Use verbose output.

    -

    You can configure fine-grained logging using the RUST_LOG environment variable. (https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#directives)

    -
    - -### uv auth dir - -Show the path to the uv credentials directory. - -By default, credentials are stored in the uv data directory at `$XDG_DATA_HOME/uv/credentials` or `$HOME/.local/share/uv/credentials` on Unix and `%APPDATA%\uv\data\credentials` on Windows. - -The credentials directory may be overridden with `$UV_CREDENTIALS_DIR`. - -Credentials are only stored in this directory when the plaintext backend is used, as opposed to the native backend, which uses the system keyring. - -

    Usage

    - -``` -uv auth dir [OPTIONS] [SERVICE] -``` - -

    Arguments

    - -
    SERVICE

    The domain or URL of the service to lookup

    -
    - -

    Options

    - -
    --allow-insecure-host, --trusted-host allow-insecure-host

    Allow insecure connections to a host.

    -

    Can be provided multiple times.

    -

    Expects to receive either a hostname (e.g., localhost), a host-port pair (e.g., localhost:8080), or a URL (e.g., https://localhost).

    -

    WARNING: Hosts included in this list will not be verified against the system's certificate store. Only use --allow-insecure-host in a secure network with verified sources, as it bypasses SSL verification and could expose you to MITM attacks.

    -

    May also be set with the UV_INSECURE_HOST environment variable.

    --cache-dir cache-dir

    Path to the cache directory.

    -

    Defaults to $XDG_CACHE_HOME/uv or $HOME/.cache/uv on macOS and Linux, and %LOCALAPPDATA%\uv\cache on Windows.

    -

    To view the location of the cache directory, run uv cache dir.

    -

    May also be set with the UV_CACHE_DIR environment variable.

    --color color-choice

    Control the use of color in output.

    -

    By default, uv will automatically detect support for colors when writing to a terminal.

    -

    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.

    -

    While uv configuration can be included in a pyproject.toml file, it is not allowed in this context.

    -

    May also be set with the UV_CONFIG_FILE environment variable.

    --directory directory

    Change to the given directory prior to running the command.

    -

    Relative paths are resolved with the given directory as the base.

    -

    See --project to only change the project root directory.

    -

    May also be set with the UV_WORKING_DIR environment variable.

    --help, -h

    Display the concise help for this command

    -
    --managed-python

    Require use of uv-managed Python versions.

    -

    By default, uv prefers using Python versions it manages. However, it will use system Python versions if a uv-managed Python is not installed. This option disables use of system Python versions.

    -

    May also be set with the UV_MANAGED_PYTHON environment variable.

    --native-tls

    Whether to load TLS certificates from the platform's native certificate store.

    -

    By default, uv loads certificates from the bundled webpki-roots crate. The webpki-roots are a reliable set of trust roots from Mozilla, and including them in uv improves portability and performance (especially on macOS).

    -

    However, in some cases, you may want to use the platform's native certificate store, especially if you're relying on a corporate trust root (e.g., for a mandatory proxy) that's included in your system's certificate store.

    -

    May also be set with the UV_NATIVE_TLS environment variable.

    --no-cache, --no-cache-dir, -n

    Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation

    -

    May also be set with the UV_NO_CACHE environment variable.

    --no-config

    Avoid discovering configuration files (pyproject.toml, uv.toml).

    -

    Normally, configuration files are discovered in the current directory, parent directories, or user configuration directories.

    -

    May also be set with the UV_NO_CONFIG environment variable.

    --no-managed-python

    Disable use of uv-managed Python versions.

    -

    Instead, uv will search for a suitable Python version on the system.

    -

    May also be set with the UV_NO_MANAGED_PYTHON environment variable.

    --no-progress

    Hide all progress outputs.

    -

    For example, spinners or progress bars.

    -

    May also be set with the UV_NO_PROGRESS environment variable.

    --no-python-downloads

    Disable automatic downloads of Python.

    -
    --offline

    Disable network access.

    -

    When disabled, uv will only use locally cached data and locally available files.

    -

    May also be set with the UV_OFFLINE environment variable.

    --project project

    Discover a project in the given directory.

    -

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    -

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    -

    See --directory to change the working directory entirely.

    -

    This setting has no effect when used in the uv pip interface.

    -

    May also be set with the UV_PROJECT environment variable.

    --quiet, -q

    Use quiet output.

    -

    Repeating this option, e.g., -qq, will enable a silent mode in which uv will write no output to stdout.

    -
    --verbose, -v

    Use verbose output.

    -

    You can configure fine-grained logging using the RUST_LOG environment variable. (https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#directives)

    -
    - -## uv run - -Run a command or script. - -Ensures that the command runs in a Python environment. - -When used with a file ending in `.py` or an HTTP(S) URL, the file will be treated as a script and run with a Python interpreter, i.e., `uv run file.py` is equivalent to `uv run python file.py`. For URLs, the script is temporarily downloaded before execution. If the script contains inline dependency metadata, it will be installed into an isolated, ephemeral environment. When used with `-`, the input will be read from stdin, and treated as a Python script. - -When used in a project, the project environment will be created and updated before invoking the command. - -When used outside a project, if a virtual environment can be found in the current directory or a parent directory, the command will be run in that environment. Otherwise, the command will be run in the environment of the discovered interpreter. - -Arguments following the command (or script) are not interpreted as arguments to uv. All options to uv must be provided before the command, e.g., `uv run --verbose foo`. A `--` can be used to separate the command from uv options for clarity, e.g., `uv run --python 3.12 -- python`. - -

    Usage

    - -``` -uv run [OPTIONS] [COMMAND] -``` - -

    Options

    - -
    --active

    Prefer the active virtual environment over the project's virtual environment.

    -

    If the project virtual environment is active or no virtual environment is active, this has no effect.

    -
    --all-extras

    Include all optional dependencies.

    -

    Optional dependencies are defined via project.optional-dependencies in a pyproject.toml.

    -

    This option is only available when running in a project.

    -
    --all-groups

    Include dependencies from all dependency groups.

    -

    --no-group can be used to exclude specific groups.

    -
    --all-packages

    Run the command with all workspace members installed.

    -

    The workspace's environment (.venv) is updated to include all workspace members.

    -

    Any extras or groups specified via --extra, --group, or related options will be applied to all workspace members.

    -
    --allow-insecure-host, --trusted-host allow-insecure-host

    Allow insecure connections to a host.

    -

    Can be provided multiple times.

    -

    Expects to receive either a hostname (e.g., localhost), a host-port pair (e.g., localhost:8080), or a URL (e.g., https://localhost).

    -

    WARNING: Hosts included in this list will not be verified against the system's certificate store. Only use --allow-insecure-host in a secure network with verified sources, as it bypasses SSL verification and could expose you to MITM attacks.

    -

    May also be set with the UV_INSECURE_HOST environment variable.

    --cache-dir cache-dir

    Path to the cache directory.

    -

    Defaults to $XDG_CACHE_HOME/uv or $HOME/.cache/uv on macOS and Linux, and %LOCALAPPDATA%\uv\cache on Windows.

    -

    To view the location of the cache directory, run uv cache dir.

    -

    May also be set with the UV_CACHE_DIR environment variable.

    --color color-choice

    Control the use of color in output.

    -

    By default, uv will automatically detect support for colors when writing to a terminal.

    -

    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
    • -
    --compile-bytecode, --compile

    Compile Python files to bytecode after installation.

    -

    By default, uv does not compile Python (.py) files to bytecode (__pycache__/*.pyc); instead, compilation is performed lazily the first time a module is imported. For use-cases in which start time is critical, such as CLI applications and Docker containers, this option can be enabled to trade longer installation times for faster start times.

    -

    When enabled, uv will process the entire site-packages directory (including packages that are not being modified by the current operation) for consistency. Like pip, it will also ignore errors.

    -

    May also be set with the UV_COMPILE_BYTECODE environment variable.

    --config-file config-file

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

    -

    While uv configuration can be included in a pyproject.toml file, it is not allowed in this context.

    -

    May also be set with the UV_CONFIG_FILE environment variable.

    --config-setting, --config-settings, -C config-setting

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

    -
    --config-settings-package, --config-settings-package config-settings-package

    Settings to pass to the PEP 517 build backend for a specific package, specified as PACKAGE:KEY=VALUE pairs

    -
    --default-index default-index

    The URL of the default package index (by default: https://pypi.org/simple).

    -

    Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

    -

    The index given by this flag is given lower priority than all other indexes specified via the --index flag.

    -

    May also be set with the UV_DEFAULT_INDEX environment variable.

    --directory directory

    Change to the given directory prior to running the command.

    -

    Relative paths are resolved with the given directory as the base.

    -

    See --project to only change the project root directory.

    -

    May also be set with the UV_WORKING_DIR environment variable.

    --env-file env-file

    Load environment variables from a .env file.

    -

    Can be provided multiple times, with subsequent files overriding values defined in previous files.

    -

    May also be set with the UV_ENV_FILE environment variable.

    --exact

    Perform an exact sync, removing extraneous packages.

    -

    When enabled, uv will remove any extraneous packages from the environment. By default, uv run will make the minimum necessary changes to satisfy the requirements.

    -
    --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 local dates in the same format (e.g., 2006-12-02) in your system's configured time zone.

    -

    May also be set with the UV_EXCLUDE_NEWER environment variable.

    --exclude-newer-package exclude-newer-package

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

    -

    Accepts package-date pairs in the format PACKAGE=DATE, where DATE is an RFC 3339 timestamp (e.g., 2006-12-02T02:07:43Z) or local date (e.g., 2006-12-02) in your system's configured time zone.

    -

    Can be provided multiple times for different packages.

    -
    --extra extra

    Include optional dependencies from the specified extra name.

    -

    May be provided more than once.

    -

    Optional dependencies are defined via project.optional-dependencies in a pyproject.toml.

    -

    This option is only available when running in a project.

    -
    --extra-index-url extra-index-url

    (Deprecated: use --index instead) Extra URLs of package indexes to use, in addition to --index-url.

    -

    Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

    -

    All indexes provided via this flag take priority over the index specified by --index-url (which defaults to PyPI). When multiple --extra-index-url flags are provided, earlier values take priority.

    -

    May also be set with the UV_EXTRA_INDEX_URL environment variable.

    Locations to search for candidate distributions, in addition to those found in the registry indexes.

    -

    If a path, the target must be a directory that contains packages as wheel files (.whl) or source distributions (e.g., .tar.gz or .zip) at the top level.

    -

    If a URL, the page must contain a flat list of links to package files adhering to the formats described above.

    -

    May also be set with the UV_FIND_LINKS environment variable.

    --fork-strategy fork-strategy

    The strategy to use when selecting multiple versions of a given package across Python versions and platforms.

    -

    By default, uv will optimize for selecting the latest version of each package for each supported Python version (requires-python), while minimizing the number of selected versions across platforms.

    -

    Under fewest, uv will minimize the number of selected versions for each package, preferring older versions that are compatible with a wider range of supported Python versions or platforms.

    -

    May also be set with the UV_FORK_STRATEGY environment variable.

    Possible values:

    -
      -
    • fewest: Optimize for selecting the fewest number of versions for each package. Older versions may be preferred if they are compatible with a wider range of supported Python versions or platforms
    • -
    • requires-python: Optimize for selecting latest supported version of each package, for each supported Python version
    • -
    --frozen

    Run without updating the uv.lock file.

    -

    Instead of checking if the lockfile is up-to-date, uses the versions in the lockfile as the source of truth. If the lockfile is missing, uv will exit with an error. If the pyproject.toml includes changes to dependencies that have not been included in the lockfile yet, they will not be present in the environment.

    -

    May also be set with the UV_FROZEN environment variable.

    --group group

    Include dependencies from the specified dependency group.

    -

    May be provided multiple times.

    -
    --gui-script

    Run the given path as a Python GUI script.

    -

    Using --gui-script will attempt to parse the path as a PEP 723 script and run it with pythonw.exe, irrespective of its extension. Only available on Windows.

    -
    --help, -h

    Display the concise help for this command

    -
    --index index

    The URLs to use when resolving dependencies, in addition to the default index.

    -

    Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

    -

    All indexes provided via this flag take priority over the index specified by --default-index (which defaults to PyPI). When multiple --index flags are provided, earlier values take priority.

    -

    Index names are not supported as values. Relative paths must be disambiguated from index names with ./ or ../ on Unix or .\\, ..\\, ./ or ../ on Windows.

    -

    May also be set with the UV_INDEX environment variable.

    --index-strategy index-strategy

    The strategy to use when resolving against multiple index URLs.

    -

    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-index). This prevents "dependency confusion" attacks, whereby an attacker can upload a malicious package under the same name to an alternate index.

    -

    May also be set with the UV_INDEX_STRATEGY environment variable.

    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
    • -
    --index-url, -i index-url

    (Deprecated: use --default-index instead) The URL of the Python package index (by default: https://pypi.org/simple).

    -

    Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

    -

    The index given by this flag is given lower priority than all other indexes specified via the --extra-index-url flag.

    -

    May also be set with the UV_INDEX_URL environment variable.

    --isolated

    Run the command in an isolated virtual environment.

    -

    Usually, the project environment is reused for performance. This option forces a fresh environment to be used for the project, enforcing strict isolation between dependencies and declaration of requirements.

    -

    An editable installation is still used for the project.

    -

    When used with --with or --with-requirements, the additional dependencies will still be layered in a second environment.

    -

    May also be set with the UV_ISOLATED environment variable.

    --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.

    -

    May also be set with the UV_KEYRING_PROVIDER environment variable.

    Possible values:

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

    The method to use when installing packages from the global cache.

    -

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

    -

    WARNING: The use of symlink link mode is discouraged, as they create tight coupling between the cache and the target environment. For example, clearing the cache (uv cache clean) will break all installed packages by way of removing the underlying source files. Use symlinks with caution.

    -

    May also be set with the UV_LINK_MODE environment variable.

    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
    • -
    --locked

    Assert that the uv.lock will remain unchanged.

    -

    Requires that the lockfile is up-to-date. If the lockfile is missing or needs to be updated, uv will exit with an error.

    -

    May also be set with the UV_LOCKED environment variable.

    --managed-python

    Require use of uv-managed Python versions.

    -

    By default, uv prefers using Python versions it manages. However, it will use system Python versions if a uv-managed Python is not installed. This option disables use of system Python versions.

    -

    May also be set with the UV_MANAGED_PYTHON environment variable.

    --module, -m

    Run a Python module.

    -

    Equivalent to python -m <module>.

    -
    --native-tls

    Whether to load TLS certificates from the platform's native certificate store.

    -

    By default, uv loads certificates from the bundled webpki-roots crate. The webpki-roots are a reliable set of trust roots from Mozilla, and including them in uv improves portability and performance (especially on macOS).

    -

    However, in some cases, you may want to use the platform's native certificate store, especially if you're relying on a corporate trust root (e.g., for a mandatory proxy) that's included in your system's certificate store.

    -

    May also be set with the UV_NATIVE_TLS environment variable.

    --no-binary

    Don't install pre-built wheels.

    -

    The given packages will be built and installed from source. The resolver will still use pre-built wheels to extract package metadata, if available.

    -

    May also be set with the UV_NO_BINARY environment variable.

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

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

    -

    May also be set with the UV_NO_BINARY_PACKAGE environment variable.

    --no-build

    Don't build source distributions.

    -

    When enabled, resolving will not run arbitrary Python code. The cached wheels of already-built source distributions will be reused, but operations that require building distributions will exit with an error.

    -

    May also be set with the UV_NO_BUILD environment variable.

    --no-build-isolation

    Disable isolation when building source distributions.

    -

    Assumes that build dependencies specified by PEP 518 are already installed.

    -

    May also be set with the UV_NO_BUILD_ISOLATION environment variable.

    --no-build-isolation-package no-build-isolation-package

    Disable isolation when building source distributions for a specific package.

    -

    Assumes that the packages' build dependencies specified by PEP 518 are already installed.

    -
    --no-build-package no-build-package

    Don't build source distributions for a specific package

    -

    May also be set with the UV_NO_BUILD_PACKAGE environment variable.

    --no-cache, --no-cache-dir, -n

    Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation

    -

    May also be set with the UV_NO_CACHE environment variable.

    --no-config

    Avoid discovering configuration files (pyproject.toml, uv.toml).

    -

    Normally, configuration files are discovered in the current directory, parent directories, or user configuration directories.

    -

    May also be set with the UV_NO_CONFIG environment variable.

    --no-default-groups

    Ignore the default dependency groups.

    -

    uv includes the groups defined in tool.uv.default-groups by default. This disables that option, however, specific groups can still be included with --group.

    -

    May also be set with the UV_NO_DEFAULT_GROUPS environment variable.

    --no-dev

    Disable the development dependency group.

    -

    This option is an alias of --no-group dev. See --no-default-groups to disable all default groups instead.

    -

    This option is only available when running in a project.

    -

    May also be set with the UV_NO_DEV environment variable.

    --no-editable

    Install any editable dependencies, including the project and any workspace members, as non-editable

    -

    May also be set with the UV_NO_EDITABLE environment variable.

    --no-env-file

    Avoid reading environment variables from a .env file

    -

    May also be set with the UV_NO_ENV_FILE environment variable.

    --no-extra no-extra

    Exclude the specified optional dependencies, if --all-extras is supplied.

    -

    May be provided multiple times.

    -
    --no-group no-group

    Disable the specified dependency group.

    -

    This option always takes precedence over default groups, --all-groups, and --group.

    -

    May be provided multiple times.

    -

    May also be set with the UV_NO_GROUP environment variable.

    --no-index

    Ignore the registry index (e.g., PyPI), instead relying on direct URL dependencies and those provided via --find-links

    -
    --no-managed-python

    Disable use of uv-managed Python versions.

    -

    Instead, uv will search for a suitable Python version on the system.

    -

    May also be set with the UV_NO_MANAGED_PYTHON environment variable.

    --no-progress

    Hide all progress outputs.

    -

    For example, spinners or progress bars.

    -

    May also be set with the UV_NO_PROGRESS environment variable.

    --no-project, --no_workspace

    Avoid discovering the project or workspace.

    -

    Instead of searching for projects in the current directory and parent directories, run in an isolated, ephemeral environment populated by the --with requirements.

    -

    If a virtual environment is active or found in a current or parent directory, it will be used as if there was no project or workspace.

    -
    --no-python-downloads

    Disable automatic downloads of Python.

    -
    --no-sources

    Ignore the tool.uv.sources table when resolving dependencies. Used to lock against the standards-compliant, publishable package metadata, as opposed to using any workspace, Git, URL, or local path sources

    -

    May also be set with the UV_NO_SOURCES environment variable.

    --no-sync

    Avoid syncing the virtual environment.

    -

    Implies --frozen, as the project dependencies will be ignored (i.e., the lockfile will not be updated, since the environment will not be synced regardless).

    -

    May also be set with the UV_NO_SYNC environment variable.

    --offline

    Disable network access.

    -

    When disabled, uv will only use locally cached data and locally available files.

    -

    May also be set with the UV_OFFLINE environment variable.

    --only-dev

    Only include the development dependency group.

    -

    The project and its dependencies will be omitted.

    -

    This option is an alias for --only-group dev. Implies --no-default-groups.

    -
    --only-group only-group

    Only include dependencies from the specified dependency group.

    -

    The project and its dependencies will be omitted.

    -

    May be provided multiple times. Implies --no-default-groups.

    -
    --package package

    Run the command in a specific package in the workspace.

    -

    If the workspace member does not exist, uv will exit with an error.

    -
    --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).

    -

    May also be set with the UV_PRERELEASE environment variable.

    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
    • -
    --project project

    Discover a project in the given directory.

    -

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    -

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    -

    See --directory to change the working directory entirely.

    -

    This setting has no effect when used in the uv pip interface.

    -

    May also be set with the UV_PROJECT environment variable.

    --python, -p python

    The Python interpreter to use for the run environment.

    -

    If the interpreter request is satisfied by a discovered environment, the environment will be -used.

    -

    See uv python to view supported request formats.

    -

    May also be set with the UV_PYTHON environment variable.

    --python-platform python-platform

    The platform for which requirements should be installed.

    -

    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 aarch64-apple-darwin.

    -

    When targeting macOS (Darwin), the default minimum version is 13.0. Use MACOSX_DEPLOYMENT_TARGET to specify a different minimum version, e.g., 14.0.

    -

    When targeting iOS, the default minimum version is 13.0. Use IPHONEOS_DEPLOYMENT_TARGET to specify a different minimum version, e.g., 14.0.

    -

    When targeting Android, the default minimum Android API level is 24. Use ANDROID_API_LEVEL to specify a different minimum version, e.g., 26.

    -

    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: A 64-bit x86 Windows target
    • -
    • aarch64-pc-windows-msvc: An ARM64 Windows target
    • -
    • i686-pc-windows-msvc: A 32-bit x86 Windows target
    • -
    • x86_64-unknown-linux-gnu: An x86 Linux target. Equivalent to x86_64-manylinux_2_28
    • -
    • aarch64-apple-darwin: An ARM-based macOS target, as seen on Apple Silicon devices
    • -
    • x86_64-apple-darwin: An x86 macOS target
    • -
    • aarch64-unknown-linux-gnu: An ARM64 Linux target. Equivalent to aarch64-manylinux_2_28
    • -
    • aarch64-unknown-linux-musl: An ARM64 Linux target
    • -
    • x86_64-unknown-linux-musl: An x86_64 Linux target
    • -
    • riscv64-unknown-linux: A RISCV64 Linux target
    • -
    • x86_64-manylinux2014: An x86_64 target for the manylinux2014 platform. Equivalent to x86_64-manylinux_2_17
    • -
    • x86_64-manylinux_2_17: An x86_64 target for the manylinux_2_17 platform
    • -
    • x86_64-manylinux_2_28: An x86_64 target for the manylinux_2_28 platform
    • -
    • x86_64-manylinux_2_31: An x86_64 target for the manylinux_2_31 platform
    • -
    • x86_64-manylinux_2_32: An x86_64 target for the manylinux_2_32 platform
    • -
    • x86_64-manylinux_2_33: An x86_64 target for the manylinux_2_33 platform
    • -
    • x86_64-manylinux_2_34: An x86_64 target for the manylinux_2_34 platform
    • -
    • x86_64-manylinux_2_35: An x86_64 target for the manylinux_2_35 platform
    • -
    • x86_64-manylinux_2_36: An x86_64 target for the manylinux_2_36 platform
    • -
    • x86_64-manylinux_2_37: An x86_64 target for the manylinux_2_37 platform
    • -
    • x86_64-manylinux_2_38: An x86_64 target for the manylinux_2_38 platform
    • -
    • x86_64-manylinux_2_39: An x86_64 target for the manylinux_2_39 platform
    • -
    • x86_64-manylinux_2_40: An x86_64 target for the manylinux_2_40 platform
    • -
    • aarch64-manylinux2014: An ARM64 target for the manylinux2014 platform. Equivalent to aarch64-manylinux_2_17
    • -
    • aarch64-manylinux_2_17: An ARM64 target for the manylinux_2_17 platform
    • -
    • aarch64-manylinux_2_28: An ARM64 target for the manylinux_2_28 platform
    • -
    • aarch64-manylinux_2_31: An ARM64 target for the manylinux_2_31 platform
    • -
    • aarch64-manylinux_2_32: An ARM64 target for the manylinux_2_32 platform
    • -
    • aarch64-manylinux_2_33: An ARM64 target for the manylinux_2_33 platform
    • -
    • aarch64-manylinux_2_34: An ARM64 target for the manylinux_2_34 platform
    • -
    • aarch64-manylinux_2_35: An ARM64 target for the manylinux_2_35 platform
    • -
    • aarch64-manylinux_2_36: An ARM64 target for the manylinux_2_36 platform
    • -
    • aarch64-manylinux_2_37: An ARM64 target for the manylinux_2_37 platform
    • -
    • aarch64-manylinux_2_38: An ARM64 target for the manylinux_2_38 platform
    • -
    • aarch64-manylinux_2_39: An ARM64 target for the manylinux_2_39 platform
    • -
    • aarch64-manylinux_2_40: An ARM64 target for the manylinux_2_40 platform
    • -
    • aarch64-linux-android: An ARM64 Android target
    • -
    • x86_64-linux-android: An x86_64 Android target
    • -
    • wasm32-pyodide2024: A wasm32 target using the Pyodide 2024 platform. Meant for use with Python 3.12
    • -
    • arm64-apple-ios: An ARM64 target for iOS device
    • -
    • arm64-apple-ios-simulator: An ARM64 target for iOS simulator
    • -
    • x86_64-apple-ios-simulator: An x86_64 target for iOS simulator
    • -
    --quiet, -q

    Use quiet output.

    -

    Repeating this option, e.g., -qq, will enable a silent mode in which uv will write no output to stdout.

    -
    --refresh

    Refresh all cached data

    -
    --refresh-package refresh-package

    Refresh cached data for a specific package

    -
    --reinstall, --force-reinstall

    Reinstall all packages, regardless of whether they're already installed. Implies --refresh

    -
    --reinstall-package reinstall-package

    Reinstall a specific package, regardless of whether it's already installed. Implies --refresh-package

    -
    --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).

    -

    May also be set with the UV_RESOLUTION environment variable.

    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
    • -
    --script, -s

    Run the given path as a Python script.

    -

    Using --script will attempt to parse the path as a PEP 723 script, irrespective of its extension.

    -
    --upgrade, -U

    Allow package upgrades, ignoring pinned versions in any existing output file. Implies --refresh

    -
    --upgrade-package, -P upgrade-package

    Allow upgrades for a specific package, ignoring pinned versions in any existing output file. Implies --refresh-package

    -
    --verbose, -v

    Use verbose output.

    -

    You can configure fine-grained logging using the RUST_LOG environment variable. (https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#directives)

    -
    --with, -w with

    Run with the given packages installed.

    -

    When used in a project, these dependencies will be layered on top of the project environment in a separate, ephemeral environment. These dependencies are allowed to conflict with those specified by the project.

    -
    --with-editable with-editable

    Run with the given packages installed in editable mode.

    -

    When used in a project, these dependencies will be layered on top of the project environment in a separate, ephemeral environment. These dependencies are allowed to conflict with those specified by the project.

    -
    --with-requirements with-requirements

    Run with the packages listed in the given files.

    -

    The following formats are supported: requirements.txt, .py files with inline metadata, and pylock.toml.

    -

    The same environment semantics as --with apply.

    -

    Using pyproject.toml, setup.py, or setup.cfg files is not allowed.

    -
    - -## uv init - -Create a new project. - -Follows the `pyproject.toml` specification. - -If a `pyproject.toml` already exists at the target, uv will exit with an error. - -If a `pyproject.toml` is found in any of the parent directories of the target path, the project will be added as a workspace member of the parent. - -Some project state is not created until needed, e.g., the project virtual environment (`.venv`) and lockfile (`uv.lock`) are lazily created during the first sync. - -

    Usage

    - -``` -uv init [OPTIONS] [PATH] -``` - -

    Arguments

    - -
    PATH

    The path to use for the project/script.

    -

    Defaults to the current working directory when initializing an app or library; required when initializing a script. Accepts relative and absolute paths.

    -

    If a pyproject.toml is found in any of the parent directories of the target path, the project will be added as a workspace member of the parent, unless --no-workspace is provided.

    -
    - -

    Options

    - -
    --allow-insecure-host, --trusted-host allow-insecure-host

    Allow insecure connections to a host.

    -

    Can be provided multiple times.

    -

    Expects to receive either a hostname (e.g., localhost), a host-port pair (e.g., localhost:8080), or a URL (e.g., https://localhost).

    -

    WARNING: Hosts included in this list will not be verified against the system's certificate store. Only use --allow-insecure-host in a secure network with verified sources, as it bypasses SSL verification and could expose you to MITM attacks.

    -

    May also be set with the UV_INSECURE_HOST environment variable.

    --app, --application

    Create a project for an application.

    -

    This is the default behavior if --lib is not requested.

    -

    This project kind is for web servers, scripts, and command-line interfaces.

    -

    By default, an application is not intended to be built and distributed as a Python package. The --package option can be used to create an application that is distributable, e.g., if you want to distribute a command-line interface via PyPI.

    -
    --author-from author-from

    Fill in the authors field in the pyproject.toml.

    -

    By default, uv will attempt to infer the author information from some sources (e.g., Git) (auto). Use --author-from git to only infer from Git configuration. Use --author-from none to avoid inferring the author information.

    -

    Possible values:

    -
      -
    • auto: Fetch the author information from some sources (e.g., Git) automatically
    • -
    • git: Fetch the author information from Git configuration only
    • -
    • none: Do not infer the author information
    • -
    --bare

    Only create a pyproject.toml.

    -

    Disables creating extra files like README.md, the src/ tree, .python-version files, etc.

    -
    --build-backend build-backend

    Initialize a build-backend of choice for the project.

    -

    Implicitly sets --package.

    -

    May also be set with the UV_INIT_BUILD_BACKEND environment variable.

    Possible values:

    -
      -
    • uv: Use uv as the project build backend
    • -
    • hatch: Use hatchling as the project build backend
    • -
    • flit: Use flit-core as the project build backend
    • -
    • pdm: Use pdm-backend as the project build backend
    • -
    • poetry: Use poetry-core as the project build backend
    • -
    • setuptools: Use setuptools as the project build backend
    • -
    • maturin: Use maturin as the project build backend
    • -
    • scikit: Use scikit-build-core as the project build backend
    • -
    --cache-dir cache-dir

    Path to the cache directory.

    -

    Defaults to $XDG_CACHE_HOME/uv or $HOME/.cache/uv on macOS and Linux, and %LOCALAPPDATA%\uv\cache on Windows.

    -

    To view the location of the cache directory, run uv cache dir.

    -

    May also be set with the UV_CACHE_DIR environment variable.

    --color color-choice

    Control the use of color in output.

    -

    By default, uv will automatically detect support for colors when writing to a terminal.

    -

    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.

    -

    While uv configuration can be included in a pyproject.toml file, it is not allowed in this context.

    -

    May also be set with the UV_CONFIG_FILE environment variable.

    --description description

    Set the project description

    -
    --directory directory

    Change to the given directory prior to running the command.

    -

    Relative paths are resolved with the given directory as the base.

    -

    See --project to only change the project root directory.

    -

    May also be set with the UV_WORKING_DIR environment variable.

    --help, -h

    Display the concise help for this command

    -
    --lib, --library

    Create a project for a library.

    -

    A library is a project that is intended to be built and distributed as a Python package.

    -
    --managed-python

    Require use of uv-managed Python versions.

    -

    By default, uv prefers using Python versions it manages. However, it will use system Python versions if a uv-managed Python is not installed. This option disables use of system Python versions.

    -

    May also be set with the UV_MANAGED_PYTHON environment variable.

    --name name

    The name of the project.

    -

    Defaults to the name of the directory.

    -
    --native-tls

    Whether to load TLS certificates from the platform's native certificate store.

    -

    By default, uv loads certificates from the bundled webpki-roots crate. The webpki-roots are a reliable set of trust roots from Mozilla, and including them in uv improves portability and performance (especially on macOS).

    -

    However, in some cases, you may want to use the platform's native certificate store, especially if you're relying on a corporate trust root (e.g., for a mandatory proxy) that's included in your system's certificate store.

    -

    May also be set with the UV_NATIVE_TLS environment variable.

    --no-cache, --no-cache-dir, -n

    Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation

    -

    May also be set with the UV_NO_CACHE environment variable.

    --no-config

    Avoid discovering configuration files (pyproject.toml, uv.toml).

    -

    Normally, configuration files are discovered in the current directory, parent directories, or user configuration directories.

    -

    May also be set with the UV_NO_CONFIG environment variable.

    --no-description

    Disable the description for the project

    -
    --no-managed-python

    Disable use of uv-managed Python versions.

    -

    Instead, uv will search for a suitable Python version on the system.

    -

    May also be set with the UV_NO_MANAGED_PYTHON environment variable.

    --no-package

    Do not set up the project to be built as a Python package.

    -

    Does not include a [build-system] for the project.

    -

    This is the default behavior when using --app.

    -
    --no-pin-python

    Do not create a .python-version file for the project.

    -

    By default, uv will create a .python-version file containing the minor version of the discovered Python interpreter, which will cause subsequent uv commands to use that version.

    -
    --no-progress

    Hide all progress outputs.

    -

    For example, spinners or progress bars.

    -

    May also be set with the UV_NO_PROGRESS environment variable.

    --no-python-downloads

    Disable automatic downloads of Python.

    -
    --no-readme

    Do not create a README.md file

    -
    --no-workspace, --no-project

    Avoid discovering a workspace and create a standalone project.

    -

    By default, uv searches for workspaces in the current directory or any parent directory.

    -
    --offline

    Disable network access.

    -

    When disabled, uv will only use locally cached data and locally available files.

    -

    May also be set with the UV_OFFLINE environment variable.

    --package

    Set up the project to be built as a Python package.

    -

    Defines a [build-system] for the project.

    -

    This is the default behavior when using --lib or --build-backend.

    -

    When using --app, this will include a [project.scripts] entrypoint and use a src/ project structure.

    -
    --project project

    Discover a project in the given directory.

    -

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    -

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    -

    See --directory to change the working directory entirely.

    -

    This setting has no effect when used in the uv pip interface.

    -

    May also be set with the UV_PROJECT environment variable.

    --python, -p python

    The Python interpreter to use to determine the minimum supported Python version.

    -

    See uv python to view supported request formats.

    -

    May also be set with the UV_PYTHON environment variable.

    --quiet, -q

    Use quiet output.

    -

    Repeating this option, e.g., -qq, will enable a silent mode in which uv will write no output to stdout.

    -
    --script

    Create a script.

    -

    A script is a standalone file with embedded metadata enumerating its dependencies, along with any Python version requirements, as defined in the PEP 723 specification.

    -

    PEP 723 scripts can be executed directly with uv run.

    -

    By default, adds a requirement on the system Python version; use --python to specify an alternative Python version requirement.

    -
    --vcs vcs

    Initialize a version control system for the project.

    -

    By default, uv will initialize a Git repository (git). Use --vcs none to explicitly avoid initializing a version control system.

    -

    Possible values:

    -
      -
    • git: Use Git for version control
    • -
    • none: Do not use any version control system
    • -
    --verbose, -v

    Use verbose output.

    -

    You can configure fine-grained logging using the RUST_LOG environment variable. (https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#directives)

    -
    - -## uv add - -Add dependencies to the project. - -Dependencies are added to the project's `pyproject.toml` file. - -If a given dependency exists already, it will be updated to the new version specifier unless it includes markers that differ from the existing specifier in which case another entry for the dependency will be added. - -The lockfile and project environment will be updated to reflect the added dependencies. To skip updating the lockfile, use `--frozen`. To skip updating the environment, use `--no-sync`. - -If any of the requested dependencies cannot be found, uv will exit with an error, unless the `--frozen` flag is provided, in which case uv will add the dependencies verbatim without checking that they exist or are compatible with the project. - -uv will search for a project in the current directory or any parent directory. If a project cannot be found, uv will exit with an error. - -

    Usage

    - -``` -uv add [OPTIONS] > -``` - -

    Arguments

    - -
    PACKAGES

    The packages to add, as PEP 508 requirements (e.g., ruff==0.5.0)

    -
    - -

    Options

    - -
    --active

    Prefer the active virtual environment over the project's virtual environment.

    -

    If the project virtual environment is active or no virtual environment is active, this has no effect.

    -
    --allow-insecure-host, --trusted-host allow-insecure-host

    Allow insecure connections to a host.

    -

    Can be provided multiple times.

    -

    Expects to receive either a hostname (e.g., localhost), a host-port pair (e.g., localhost:8080), or a URL (e.g., https://localhost).

    -

    WARNING: Hosts included in this list will not be verified against the system's certificate store. Only use --allow-insecure-host in a secure network with verified sources, as it bypasses SSL verification and could expose you to MITM attacks.

    -

    May also be set with the UV_INSECURE_HOST environment variable.

    --bounds bounds

    The kind of version specifier to use when adding dependencies.

    -

    When adding a dependency to the project, if no constraint or URL is provided, a constraint is added based on the latest compatible version of the package. By default, a lower bound constraint is used, e.g., >=1.2.3.

    -

    When --frozen is provided, no resolution is performed, and dependencies are always added without constraints.

    -

    This option is in preview and may change in any future release.

    -

    Possible values:

    -
      -
    • lower: Only a lower bound, e.g., >=1.2.3
    • -
    • major: Allow the same major version, similar to the semver caret, e.g., >=1.2.3, <2.0.0
    • -
    • minor: Allow the same minor version, similar to the semver tilde, e.g., >=1.2.3, <1.3.0
    • -
    • exact: Pin the exact version, e.g., ==1.2.3
    • -
    --branch branch

    Branch to use when adding a dependency from Git

    -
    --cache-dir cache-dir

    Path to the cache directory.

    -

    Defaults to $XDG_CACHE_HOME/uv or $HOME/.cache/uv on macOS and Linux, and %LOCALAPPDATA%\uv\cache on Windows.

    -

    To view the location of the cache directory, run uv cache dir.

    -

    May also be set with the UV_CACHE_DIR environment variable.

    --color color-choice

    Control the use of color in output.

    -

    By default, uv will automatically detect support for colors when writing to a terminal.

    -

    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
    • -
    --compile-bytecode, --compile

    Compile Python files to bytecode after installation.

    -

    By default, uv does not compile Python (.py) files to bytecode (__pycache__/*.pyc); instead, compilation is performed lazily the first time a module is imported. For use-cases in which start time is critical, such as CLI applications and Docker containers, this option can be enabled to trade longer installation times for faster start times.

    -

    When enabled, uv will process the entire site-packages directory (including packages that are not being modified by the current operation) for consistency. Like pip, it will also ignore errors.

    -

    May also be set with the UV_COMPILE_BYTECODE environment variable.

    --config-file config-file

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

    -

    While uv configuration can be included in a pyproject.toml file, it is not allowed in this context.

    -

    May also be set with the UV_CONFIG_FILE environment variable.

    --config-setting, --config-settings, -C config-setting

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

    -
    --config-settings-package, --config-settings-package config-settings-package

    Settings to pass to the PEP 517 build backend for a specific package, specified as PACKAGE:KEY=VALUE pairs

    -
    --constraints, --constraint, -c constraints

    Constrain versions using the given requirements files.

    -

    Constraints files are requirements.txt-like files that only control the version of a requirement that's installed. The constraints will not be added to the project's pyproject.toml file, but will be respected during dependency resolution.

    -

    This is equivalent to pip's --constraint option.

    -

    May also be set with the UV_CONSTRAINT environment variable.

    --default-index default-index

    The URL of the default package index (by default: https://pypi.org/simple).

    -

    Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

    -

    The index given by this flag is given lower priority than all other indexes specified via the --index flag.

    -

    May also be set with the UV_DEFAULT_INDEX environment variable.

    --dev

    Add the requirements to the development dependency group.

    -

    This option is an alias for --group dev.

    -

    May also be set with the UV_DEV environment variable.

    --directory directory

    Change to the given directory prior to running the command.

    -

    Relative paths are resolved with the given directory as the base.

    -

    See --project to only change the project root directory.

    -

    May also be set with the UV_WORKING_DIR environment variable.

    --editable

    Add the requirements as editable

    -
    --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 local dates in the same format (e.g., 2006-12-02) in your system's configured time zone.

    -

    May also be set with the UV_EXCLUDE_NEWER environment variable.

    --exclude-newer-package exclude-newer-package

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

    -

    Accepts package-date pairs in the format PACKAGE=DATE, where DATE is an RFC 3339 timestamp (e.g., 2006-12-02T02:07:43Z) or local date (e.g., 2006-12-02) in your system's configured time zone.

    -

    Can be provided multiple times for different packages.

    -
    --extra extra

    Extras to enable for the dependency.

    -

    May be provided more than once.

    -

    To add this dependency to an optional extra instead, see --optional.

    -
    --extra-index-url extra-index-url

    (Deprecated: use --index instead) Extra URLs of package indexes to use, in addition to --index-url.

    -

    Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

    -

    All indexes provided via this flag take priority over the index specified by --index-url (which defaults to PyPI). When multiple --extra-index-url flags are provided, earlier values take priority.

    -

    May also be set with the UV_EXTRA_INDEX_URL environment variable.

    Locations to search for candidate distributions, in addition to those found in the registry indexes.

    -

    If a path, the target must be a directory that contains packages as wheel files (.whl) or source distributions (e.g., .tar.gz or .zip) at the top level.

    -

    If a URL, the page must contain a flat list of links to package files adhering to the formats described above.

    -

    May also be set with the UV_FIND_LINKS environment variable.

    --fork-strategy fork-strategy

    The strategy to use when selecting multiple versions of a given package across Python versions and platforms.

    -

    By default, uv will optimize for selecting the latest version of each package for each supported Python version (requires-python), while minimizing the number of selected versions across platforms.

    -

    Under fewest, uv will minimize the number of selected versions for each package, preferring older versions that are compatible with a wider range of supported Python versions or platforms.

    -

    May also be set with the UV_FORK_STRATEGY environment variable.

    Possible values:

    -
      -
    • fewest: Optimize for selecting the fewest number of versions for each package. Older versions may be preferred if they are compatible with a wider range of supported Python versions or platforms
    • -
    • requires-python: Optimize for selecting latest supported version of each package, for each supported Python version
    • -
    --frozen

    Add dependencies without re-locking the project.

    -

    The project environment will not be synced.

    -

    May also be set with the UV_FROZEN environment variable.

    --group group

    Add the requirements to the specified dependency group.

    -

    These requirements will not be included in the published metadata for the project.

    -
    --help, -h

    Display the concise help for this command

    -
    --index index

    The URLs to use when resolving dependencies, in addition to the default index.

    -

    Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

    -

    All indexes provided via this flag take priority over the index specified by --default-index (which defaults to PyPI). When multiple --index flags are provided, earlier values take priority.

    -

    Index names are not supported as values. Relative paths must be disambiguated from index names with ./ or ../ on Unix or .\\, ..\\, ./ or ../ on Windows.

    -

    May also be set with the UV_INDEX environment variable.

    --index-strategy index-strategy

    The strategy to use when resolving against multiple index URLs.

    -

    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-index). This prevents "dependency confusion" attacks, whereby an attacker can upload a malicious package under the same name to an alternate index.

    -

    May also be set with the UV_INDEX_STRATEGY environment variable.

    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
    • -
    --index-url, -i index-url

    (Deprecated: use --default-index instead) The URL of the Python package index (by default: https://pypi.org/simple).

    -

    Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

    -

    The index given by this flag is given lower priority than all other indexes specified via the --extra-index-url flag.

    -

    May also be set with the UV_INDEX_URL environment variable.

    --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.

    -

    May also be set with the UV_KEYRING_PROVIDER environment variable.

    Possible values:

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

    Whether to use Git LFS when adding a dependency from Git

    -

    May also be set with the UV_GIT_LFS environment variable.

    The method to use when installing packages from the global cache.

    -

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

    -

    WARNING: The use of symlink link mode is discouraged, as they create tight coupling between the cache and the target environment. For example, clearing the cache (uv cache clean) will break all installed packages by way of removing the underlying source files. Use symlinks with caution.

    -

    May also be set with the UV_LINK_MODE environment variable.

    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
    • -
    --locked

    Assert that the uv.lock will remain unchanged.

    -

    Requires that the lockfile is up-to-date. If the lockfile is missing or needs to be updated, uv will exit with an error.

    -

    May also be set with the UV_LOCKED environment variable.

    --managed-python

    Require use of uv-managed Python versions.

    -

    By default, uv prefers using Python versions it manages. However, it will use system Python versions if a uv-managed Python is not installed. This option disables use of system Python versions.

    -

    May also be set with the UV_MANAGED_PYTHON environment variable.

    --marker, -m marker

    Apply this marker to all added packages

    -
    --native-tls

    Whether to load TLS certificates from the platform's native certificate store.

    -

    By default, uv loads certificates from the bundled webpki-roots crate. The webpki-roots are a reliable set of trust roots from Mozilla, and including them in uv improves portability and performance (especially on macOS).

    -

    However, in some cases, you may want to use the platform's native certificate store, especially if you're relying on a corporate trust root (e.g., for a mandatory proxy) that's included in your system's certificate store.

    -

    May also be set with the UV_NATIVE_TLS environment variable.

    --no-binary

    Don't install pre-built wheels.

    -

    The given packages will be built and installed from source. The resolver will still use pre-built wheels to extract package metadata, if available.

    -

    May also be set with the UV_NO_BINARY environment variable.

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

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

    -

    May also be set with the UV_NO_BINARY_PACKAGE environment variable.

    --no-build

    Don't build source distributions.

    -

    When enabled, resolving will not run arbitrary Python code. The cached wheels of already-built source distributions will be reused, but operations that require building distributions will exit with an error.

    -

    May also be set with the UV_NO_BUILD environment variable.

    --no-build-isolation

    Disable isolation when building source distributions.

    -

    Assumes that build dependencies specified by PEP 518 are already installed.

    -

    May also be set with the UV_NO_BUILD_ISOLATION environment variable.

    --no-build-isolation-package no-build-isolation-package

    Disable isolation when building source distributions for a specific package.

    -

    Assumes that the packages' build dependencies specified by PEP 518 are already installed.

    -
    --no-build-package no-build-package

    Don't build source distributions for a specific package

    -

    May also be set with the UV_NO_BUILD_PACKAGE environment variable.

    --no-cache, --no-cache-dir, -n

    Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation

    -

    May also be set with the UV_NO_CACHE environment variable.

    --no-config

    Avoid discovering configuration files (pyproject.toml, uv.toml).

    -

    Normally, configuration files are discovered in the current directory, parent directories, or user configuration directories.

    -

    May also be set with the UV_NO_CONFIG environment variable.

    --no-index

    Ignore the registry index (e.g., PyPI), instead relying on direct URL dependencies and those provided via --find-links

    -
    --no-install-local

    Do not install local path dependencies

    -

    Skips the current project, workspace members, and any other local (path or editable) packages. Only remote/indexed dependencies are installed. Useful in Docker builds to cache heavy third-party dependencies first and layer local packages separately.

    -

    The inverse --only-install-local can be used to install only local packages, excluding all remote dependencies.

    -
    --no-install-package no-install-package

    Do not install the given package(s).

    -

    By default, all project's dependencies are installed into the environment. The --no-install-package option allows exclusion of specific packages. Note this can result in a broken environment, and should be used with caution.

    -

    The inverse --only-install-package can be used to install only the specified packages, excluding all others.

    -
    --no-install-project

    Do not install the current project.

    -

    By default, the current project is installed into the environment with all of its dependencies. The --no-install-project option allows the project to be excluded, but all of its dependencies are still installed. This is particularly useful in situations like building Docker images where installing the project separately from its dependencies allows optimal layer caching.

    -

    The inverse --only-install-project can be used to install only the project itself, excluding all dependencies.

    -
    --no-install-workspace

    Do not install any workspace members, including the current project.

    -

    By default, all workspace members and their dependencies are installed into the environment. The --no-install-workspace option allows exclusion of all the workspace members while retaining their dependencies. This is particularly useful in situations like building Docker images where installing the workspace separately from its dependencies allows optimal layer caching.

    -

    The inverse --only-install-workspace can be used to install only workspace members, excluding all other dependencies.

    -
    --no-managed-python

    Disable use of uv-managed Python versions.

    -

    Instead, uv will search for a suitable Python version on the system.

    -

    May also be set with the UV_NO_MANAGED_PYTHON environment variable.

    --no-progress

    Hide all progress outputs.

    -

    For example, spinners or progress bars.

    -

    May also be set with the UV_NO_PROGRESS environment variable.

    --no-python-downloads

    Disable automatic downloads of Python.

    -
    --no-sources

    Ignore the tool.uv.sources table when resolving dependencies. Used to lock against the standards-compliant, publishable package metadata, as opposed to using any workspace, Git, URL, or local path sources

    -

    May also be set with the UV_NO_SOURCES environment variable.

    --no-sync

    Avoid syncing the virtual environment

    -

    May also be set with the UV_NO_SYNC environment variable.

    --no-workspace

    Don't add the dependency as a workspace member.

    -

    By default, when adding a dependency that's a local path and is within the workspace directory, uv will add it as a workspace member; pass --no-workspace to add the package as direct path dependency instead.

    -
    --offline

    Disable network access.

    -

    When disabled, uv will only use locally cached data and locally available files.

    -

    May also be set with the UV_OFFLINE environment variable.

    --optional optional

    Add the requirements to the package's optional dependencies for the specified extra.

    -

    The group may then be activated when installing the project with the --extra flag.

    -

    To enable an optional extra for this requirement instead, see --extra.

    -
    --package package

    Add the dependency to a specific package in the workspace

    -
    --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).

    -

    May also be set with the UV_PRERELEASE environment variable.

    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
    • -
    --project project

    Discover a project in the given directory.

    -

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    -

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    -

    See --directory to change the working directory entirely.

    -

    This setting has no effect when used in the uv pip interface.

    -

    May also be set with the UV_PROJECT environment variable.

    --python, -p python

    The Python interpreter to use for resolving and syncing.

    -

    See uv python for details on Python discovery and supported request formats.

    -

    May also be set with the UV_PYTHON environment variable.

    --quiet, -q

    Use quiet output.

    -

    Repeating this option, e.g., -qq, will enable a silent mode in which uv will write no output to stdout.

    -
    --raw, --raw-sources

    Add a dependency as provided.

    -

    By default, uv will use the tool.uv.sources section to record source information for Git, local, editable, and direct URL requirements. When --raw is provided, uv will add source requirements to project.dependencies, rather than tool.uv.sources.

    -

    Additionally, by default, uv will add bounds to your dependency, e.g., foo>=1.0.0. When --raw is provided, uv will add the dependency without bounds.

    -
    --refresh

    Refresh all cached data

    -
    --refresh-package refresh-package

    Refresh cached data for a specific package

    -
    --reinstall, --force-reinstall

    Reinstall all packages, regardless of whether they're already installed. Implies --refresh

    -
    --reinstall-package reinstall-package

    Reinstall a specific package, regardless of whether it's already installed. Implies --refresh-package

    -
    --requirements, --requirement, -r requirements

    Add the packages listed in the given files.

    -

    The following formats are supported: requirements.txt, .py files with inline metadata, pylock.toml, pyproject.toml, setup.py, and setup.cfg.

    -
    --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).

    -

    May also be set with the UV_RESOLUTION environment variable.

    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
    • -
    --rev rev

    Commit to use when adding a dependency from Git

    -
    --script script

    Add the dependency to the specified Python script, rather than to a project.

    -

    If provided, uv will add the dependency to the script's inline metadata table, in adherence with PEP 723. If no such inline metadata table is present, a new one will be created and added to the script. When executed via uv run, uv will create a temporary environment for the script with all inline dependencies installed.

    -
    --tag tag

    Tag to use when adding a dependency from Git

    -
    --upgrade, -U

    Allow package upgrades, ignoring pinned versions in any existing output file. Implies --refresh

    -
    --upgrade-package, -P upgrade-package

    Allow upgrades for a specific package, ignoring pinned versions in any existing output file. Implies --refresh-package

    -
    --verbose, -v

    Use verbose output.

    -

    You can configure fine-grained logging using the RUST_LOG environment variable. (https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#directives)

    -
    --workspace

    Add the dependency as a workspace member.

    -

    By default, uv will add path dependencies that are within the workspace directory as workspace members. When used with a path dependency, the package will be added to the workspace's members list in the root pyproject.toml file.

    -
    - -## uv remove - -Remove dependencies from the project. - -Dependencies are removed from the project's `pyproject.toml` file. - -If multiple entries exist for a given dependency, i.e., each with different markers, all of the entries will be removed. - -The lockfile and project environment will be updated to reflect the removed dependencies. To skip updating the lockfile, use `--frozen`. To skip updating the environment, use `--no-sync`. - -If any of the requested dependencies are not present in the project, uv will exit with an error. - -If a package has been manually installed in the environment, i.e., with `uv pip install`, it will not be removed by `uv remove`. - -uv will search for a project in the current directory or any parent directory. If a project cannot be found, uv will exit with an error. - -

    Usage

    - -``` -uv remove [OPTIONS] ... -``` - -

    Arguments

    - -
    PACKAGES

    The names of the dependencies to remove (e.g., ruff)

    -
    - -

    Options

    - -
    --active

    Prefer the active virtual environment over the project's virtual environment.

    -

    If the project virtual environment is active or no virtual environment is active, this has no effect.

    -
    --allow-insecure-host, --trusted-host allow-insecure-host

    Allow insecure connections to a host.

    -

    Can be provided multiple times.

    -

    Expects to receive either a hostname (e.g., localhost), a host-port pair (e.g., localhost:8080), or a URL (e.g., https://localhost).

    -

    WARNING: Hosts included in this list will not be verified against the system's certificate store. Only use --allow-insecure-host in a secure network with verified sources, as it bypasses SSL verification and could expose you to MITM attacks.

    -

    May also be set with the UV_INSECURE_HOST environment variable.

    --cache-dir cache-dir

    Path to the cache directory.

    -

    Defaults to $XDG_CACHE_HOME/uv or $HOME/.cache/uv on macOS and Linux, and %LOCALAPPDATA%\uv\cache on Windows.

    -

    To view the location of the cache directory, run uv cache dir.

    -

    May also be set with the UV_CACHE_DIR environment variable.

    --color color-choice

    Control the use of color in output.

    -

    By default, uv will automatically detect support for colors when writing to a terminal.

    -

    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
    • -
    --compile-bytecode, --compile

    Compile Python files to bytecode after installation.

    -

    By default, uv does not compile Python (.py) files to bytecode (__pycache__/*.pyc); instead, compilation is performed lazily the first time a module is imported. For use-cases in which start time is critical, such as CLI applications and Docker containers, this option can be enabled to trade longer installation times for faster start times.

    -

    When enabled, uv will process the entire site-packages directory (including packages that are not being modified by the current operation) for consistency. Like pip, it will also ignore errors.

    -

    May also be set with the UV_COMPILE_BYTECODE environment variable.

    --config-file config-file

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

    -

    While uv configuration can be included in a pyproject.toml file, it is not allowed in this context.

    -

    May also be set with the UV_CONFIG_FILE environment variable.

    --config-setting, --config-settings, -C config-setting

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

    -
    --config-settings-package, --config-settings-package config-settings-package

    Settings to pass to the PEP 517 build backend for a specific package, specified as PACKAGE:KEY=VALUE pairs

    -
    --default-index default-index

    The URL of the default package index (by default: https://pypi.org/simple).

    -

    Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

    -

    The index given by this flag is given lower priority than all other indexes specified via the --index flag.

    -

    May also be set with the UV_DEFAULT_INDEX environment variable.

    --dev

    Remove the packages from the development dependency group.

    -

    This option is an alias for --group dev.

    -

    May also be set with the UV_DEV environment variable.

    --directory directory

    Change to the given directory prior to running the command.

    -

    Relative paths are resolved with the given directory as the base.

    -

    See --project to only change the project root directory.

    -

    May also be set with the UV_WORKING_DIR environment variable.

    --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 local dates in the same format (e.g., 2006-12-02) in your system's configured time zone.

    -

    May also be set with the UV_EXCLUDE_NEWER environment variable.

    --exclude-newer-package exclude-newer-package

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

    -

    Accepts package-date pairs in the format PACKAGE=DATE, where DATE is an RFC 3339 timestamp (e.g., 2006-12-02T02:07:43Z) or local date (e.g., 2006-12-02) in your system's configured time zone.

    -

    Can be provided multiple times for different packages.

    -
    --extra-index-url extra-index-url

    (Deprecated: use --index instead) Extra URLs of package indexes to use, in addition to --index-url.

    -

    Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

    -

    All indexes provided via this flag take priority over the index specified by --index-url (which defaults to PyPI). When multiple --extra-index-url flags are provided, earlier values take priority.

    -

    May also be set with the UV_EXTRA_INDEX_URL environment variable.

    Locations to search for candidate distributions, in addition to those found in the registry indexes.

    -

    If a path, the target must be a directory that contains packages as wheel files (.whl) or source distributions (e.g., .tar.gz or .zip) at the top level.

    -

    If a URL, the page must contain a flat list of links to package files adhering to the formats described above.

    -

    May also be set with the UV_FIND_LINKS environment variable.

    --fork-strategy fork-strategy

    The strategy to use when selecting multiple versions of a given package across Python versions and platforms.

    -

    By default, uv will optimize for selecting the latest version of each package for each supported Python version (requires-python), while minimizing the number of selected versions across platforms.

    -

    Under fewest, uv will minimize the number of selected versions for each package, preferring older versions that are compatible with a wider range of supported Python versions or platforms.

    -

    May also be set with the UV_FORK_STRATEGY environment variable.

    Possible values:

    -
      -
    • fewest: Optimize for selecting the fewest number of versions for each package. Older versions may be preferred if they are compatible with a wider range of supported Python versions or platforms
    • -
    • requires-python: Optimize for selecting latest supported version of each package, for each supported Python version
    • -
    --frozen

    Remove dependencies without re-locking the project.

    -

    The project environment will not be synced.

    -

    May also be set with the UV_FROZEN environment variable.

    --group group

    Remove the packages from the specified dependency group

    -
    --help, -h

    Display the concise help for this command

    -
    --index index

    The URLs to use when resolving dependencies, in addition to the default index.

    -

    Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

    -

    All indexes provided via this flag take priority over the index specified by --default-index (which defaults to PyPI). When multiple --index flags are provided, earlier values take priority.

    -

    Index names are not supported as values. Relative paths must be disambiguated from index names with ./ or ../ on Unix or .\\, ..\\, ./ or ../ on Windows.

    -

    May also be set with the UV_INDEX environment variable.

    --index-strategy index-strategy

    The strategy to use when resolving against multiple index URLs.

    -

    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-index). This prevents "dependency confusion" attacks, whereby an attacker can upload a malicious package under the same name to an alternate index.

    -

    May also be set with the UV_INDEX_STRATEGY environment variable.

    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
    • -
    --index-url, -i index-url

    (Deprecated: use --default-index instead) The URL of the Python package index (by default: https://pypi.org/simple).

    -

    Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

    -

    The index given by this flag is given lower priority than all other indexes specified via the --extra-index-url flag.

    -

    May also be set with the UV_INDEX_URL environment variable.

    --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.

    -

    May also be set with the UV_KEYRING_PROVIDER environment variable.

    Possible values:

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

    The method to use when installing packages from the global cache.

    -

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

    -

    WARNING: The use of symlink link mode is discouraged, as they create tight coupling between the cache and the target environment. For example, clearing the cache (uv cache clean) will break all installed packages by way of removing the underlying source files. Use symlinks with caution.

    -

    May also be set with the UV_LINK_MODE environment variable.

    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
    • -
    --locked

    Assert that the uv.lock will remain unchanged.

    -

    Requires that the lockfile is up-to-date. If the lockfile is missing or needs to be updated, uv will exit with an error.

    -

    May also be set with the UV_LOCKED environment variable.

    --managed-python

    Require use of uv-managed Python versions.

    -

    By default, uv prefers using Python versions it manages. However, it will use system Python versions if a uv-managed Python is not installed. This option disables use of system Python versions.

    -

    May also be set with the UV_MANAGED_PYTHON environment variable.

    --native-tls

    Whether to load TLS certificates from the platform's native certificate store.

    -

    By default, uv loads certificates from the bundled webpki-roots crate. The webpki-roots are a reliable set of trust roots from Mozilla, and including them in uv improves portability and performance (especially on macOS).

    -

    However, in some cases, you may want to use the platform's native certificate store, especially if you're relying on a corporate trust root (e.g., for a mandatory proxy) that's included in your system's certificate store.

    -

    May also be set with the UV_NATIVE_TLS environment variable.

    --no-binary

    Don't install pre-built wheels.

    -

    The given packages will be built and installed from source. The resolver will still use pre-built wheels to extract package metadata, if available.

    -

    May also be set with the UV_NO_BINARY environment variable.

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

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

    -

    May also be set with the UV_NO_BINARY_PACKAGE environment variable.

    --no-build

    Don't build source distributions.

    -

    When enabled, resolving will not run arbitrary Python code. The cached wheels of already-built source distributions will be reused, but operations that require building distributions will exit with an error.

    -

    May also be set with the UV_NO_BUILD environment variable.

    --no-build-isolation

    Disable isolation when building source distributions.

    -

    Assumes that build dependencies specified by PEP 518 are already installed.

    -

    May also be set with the UV_NO_BUILD_ISOLATION environment variable.

    --no-build-isolation-package no-build-isolation-package

    Disable isolation when building source distributions for a specific package.

    -

    Assumes that the packages' build dependencies specified by PEP 518 are already installed.

    -
    --no-build-package no-build-package

    Don't build source distributions for a specific package

    -

    May also be set with the UV_NO_BUILD_PACKAGE environment variable.

    --no-cache, --no-cache-dir, -n

    Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation

    -

    May also be set with the UV_NO_CACHE environment variable.

    --no-config

    Avoid discovering configuration files (pyproject.toml, uv.toml).

    -

    Normally, configuration files are discovered in the current directory, parent directories, or user configuration directories.

    -

    May also be set with the UV_NO_CONFIG environment variable.

    --no-index

    Ignore the registry index (e.g., PyPI), instead relying on direct URL dependencies and those provided via --find-links

    -
    --no-managed-python

    Disable use of uv-managed Python versions.

    -

    Instead, uv will search for a suitable Python version on the system.

    -

    May also be set with the UV_NO_MANAGED_PYTHON environment variable.

    --no-progress

    Hide all progress outputs.

    -

    For example, spinners or progress bars.

    -

    May also be set with the UV_NO_PROGRESS environment variable.

    --no-python-downloads

    Disable automatic downloads of Python.

    -
    --no-sources

    Ignore the tool.uv.sources table when resolving dependencies. Used to lock against the standards-compliant, publishable package metadata, as opposed to using any workspace, Git, URL, or local path sources

    -

    May also be set with the UV_NO_SOURCES environment variable.

    --no-sync

    Avoid syncing the virtual environment after re-locking the project

    -

    May also be set with the UV_NO_SYNC environment variable.

    --offline

    Disable network access.

    -

    When disabled, uv will only use locally cached data and locally available files.

    -

    May also be set with the UV_OFFLINE environment variable.

    --optional optional

    Remove the packages from the project's optional dependencies for the specified extra

    -
    --package package

    Remove the dependencies from a specific package in the workspace

    -
    --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).

    -

    May also be set with the UV_PRERELEASE environment variable.

    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
    • -
    --project project

    Discover a project in the given directory.

    -

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    -

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    -

    See --directory to change the working directory entirely.

    -

    This setting has no effect when used in the uv pip interface.

    -

    May also be set with the UV_PROJECT environment variable.

    --python, -p python

    The Python interpreter to use for resolving and syncing.

    -

    See uv python for details on Python discovery and supported request formats.

    -

    May also be set with the UV_PYTHON environment variable.

    --quiet, -q

    Use quiet output.

    -

    Repeating this option, e.g., -qq, will enable a silent mode in which uv will write no output to stdout.

    -
    --refresh

    Refresh all cached data

    -
    --refresh-package refresh-package

    Refresh cached data for a specific package

    -
    --reinstall, --force-reinstall

    Reinstall all packages, regardless of whether they're already installed. Implies --refresh

    -
    --reinstall-package reinstall-package

    Reinstall a specific package, regardless of whether it's already installed. Implies --refresh-package

    -
    --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).

    -

    May also be set with the UV_RESOLUTION environment variable.

    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
    • -
    --script script

    Remove the dependency from the specified Python script, rather than from a project.

    -

    If provided, uv will remove the dependency from the script's inline metadata table, in adherence with PEP 723.

    -
    --upgrade, -U

    Allow package upgrades, ignoring pinned versions in any existing output file. Implies --refresh

    -
    --upgrade-package, -P upgrade-package

    Allow upgrades for a specific package, ignoring pinned versions in any existing output file. Implies --refresh-package

    -
    --verbose, -v

    Use verbose output.

    -

    You can configure fine-grained logging using the RUST_LOG environment variable. (https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#directives)

    -
    - -## uv version - -Read or update the project's version - -

    Usage

    - -``` -uv version [OPTIONS] [VALUE] -``` - -

    Arguments

    - -
    VALUE

    Set the project version to this value

    -

    To update the project using semantic versioning components instead, use --bump.

    -
    - -

    Options

    - -
    --active

    Prefer the active virtual environment over the project's virtual environment.

    -

    If the project virtual environment is active or no virtual environment is active, this has no effect.

    -
    --allow-insecure-host, --trusted-host allow-insecure-host

    Allow insecure connections to a host.

    -

    Can be provided multiple times.

    -

    Expects to receive either a hostname (e.g., localhost), a host-port pair (e.g., localhost:8080), or a URL (e.g., https://localhost).

    -

    WARNING: Hosts included in this list will not be verified against the system's certificate store. Only use --allow-insecure-host in a secure network with verified sources, as it bypasses SSL verification and could expose you to MITM attacks.

    -

    May also be set with the UV_INSECURE_HOST environment variable.

    --bump bump[=value]

    Update the project version using the given semantics

    -

    This flag can be passed multiple times.

    -

    Possible values:

    -
      -
    • major: Increase the major version (e.g., 1.2.3 => 2.0.0)
    • -
    • minor: Increase the minor version (e.g., 1.2.3 => 1.3.0)
    • -
    • patch: Increase the patch version (e.g., 1.2.3 => 1.2.4)
    • -
    • stable: Move from a pre-release to stable version (e.g., 1.2.3b4.post5.dev6 => 1.2.3)
    • -
    • alpha: Increase the alpha version (e.g., 1.2.3a4 => 1.2.3a5)
    • -
    • beta: Increase the beta version (e.g., 1.2.3b4 => 1.2.3b5)
    • -
    • rc: Increase the rc version (e.g., 1.2.3rc4 => 1.2.3rc5)
    • -
    • post: Increase the post version (e.g., 1.2.3.post5 => 1.2.3.post6)
    • -
    • dev: Increase the dev version (e.g., 1.2.3a4.dev6 => 1.2.3.dev7)
    • -
    --cache-dir cache-dir

    Path to the cache directory.

    -

    Defaults to $XDG_CACHE_HOME/uv or $HOME/.cache/uv on macOS and Linux, and %LOCALAPPDATA%\uv\cache on Windows.

    -

    To view the location of the cache directory, run uv cache dir.

    -

    May also be set with the UV_CACHE_DIR environment variable.

    --color color-choice

    Control the use of color in output.

    -

    By default, uv will automatically detect support for colors when writing to a terminal.

    -

    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
    • -
    --compile-bytecode, --compile

    Compile Python files to bytecode after installation.

    -

    By default, uv does not compile Python (.py) files to bytecode (__pycache__/*.pyc); instead, compilation is performed lazily the first time a module is imported. For use-cases in which start time is critical, such as CLI applications and Docker containers, this option can be enabled to trade longer installation times for faster start times.

    -

    When enabled, uv will process the entire site-packages directory (including packages that are not being modified by the current operation) for consistency. Like pip, it will also ignore errors.

    -

    May also be set with the UV_COMPILE_BYTECODE environment variable.

    --config-file config-file

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

    -

    While uv configuration can be included in a pyproject.toml file, it is not allowed in this context.

    -

    May also be set with the UV_CONFIG_FILE environment variable.

    --config-setting, --config-settings, -C config-setting

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

    -
    --config-settings-package, --config-settings-package config-settings-package

    Settings to pass to the PEP 517 build backend for a specific package, specified as PACKAGE:KEY=VALUE pairs

    -
    --default-index default-index

    The URL of the default package index (by default: https://pypi.org/simple).

    -

    Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

    -

    The index given by this flag is given lower priority than all other indexes specified via the --index flag.

    -

    May also be set with the UV_DEFAULT_INDEX environment variable.

    --directory directory

    Change to the given directory prior to running the command.

    -

    Relative paths are resolved with the given directory as the base.

    -

    See --project to only change the project root directory.

    -

    May also be set with the UV_WORKING_DIR environment variable.

    --dry-run

    Don't write a new version to the pyproject.toml

    -

    Instead, the version will be displayed.

    -
    --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 local dates in the same format (e.g., 2006-12-02) in your system's configured time zone.

    -

    May also be set with the UV_EXCLUDE_NEWER environment variable.

    --exclude-newer-package exclude-newer-package

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

    -

    Accepts package-date pairs in the format PACKAGE=DATE, where DATE is an RFC 3339 timestamp (e.g., 2006-12-02T02:07:43Z) or local date (e.g., 2006-12-02) in your system's configured time zone.

    -

    Can be provided multiple times for different packages.

    -
    --extra-index-url extra-index-url

    (Deprecated: use --index instead) Extra URLs of package indexes to use, in addition to --index-url.

    -

    Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

    -

    All indexes provided via this flag take priority over the index specified by --index-url (which defaults to PyPI). When multiple --extra-index-url flags are provided, earlier values take priority.

    -

    May also be set with the UV_EXTRA_INDEX_URL environment variable.

    Locations to search for candidate distributions, in addition to those found in the registry indexes.

    -

    If a path, the target must be a directory that contains packages as wheel files (.whl) or source distributions (e.g., .tar.gz or .zip) at the top level.

    -

    If a URL, the page must contain a flat list of links to package files adhering to the formats described above.

    -

    May also be set with the UV_FIND_LINKS environment variable.

    --fork-strategy fork-strategy

    The strategy to use when selecting multiple versions of a given package across Python versions and platforms.

    -

    By default, uv will optimize for selecting the latest version of each package for each supported Python version (requires-python), while minimizing the number of selected versions across platforms.

    -

    Under fewest, uv will minimize the number of selected versions for each package, preferring older versions that are compatible with a wider range of supported Python versions or platforms.

    -

    May also be set with the UV_FORK_STRATEGY environment variable.

    Possible values:

    -
      -
    • fewest: Optimize for selecting the fewest number of versions for each package. Older versions may be preferred if they are compatible with a wider range of supported Python versions or platforms
    • -
    • requires-python: Optimize for selecting latest supported version of each package, for each supported Python version
    • -
    --frozen

    Update the version without re-locking the project.

    -

    The project environment will not be synced.

    -

    May also be set with the UV_FROZEN environment variable.

    --help, -h

    Display the concise help for this command

    -
    --index index

    The URLs to use when resolving dependencies, in addition to the default index.

    -

    Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

    -

    All indexes provided via this flag take priority over the index specified by --default-index (which defaults to PyPI). When multiple --index flags are provided, earlier values take priority.

    -

    Index names are not supported as values. Relative paths must be disambiguated from index names with ./ or ../ on Unix or .\\, ..\\, ./ or ../ on Windows.

    -

    May also be set with the UV_INDEX environment variable.

    --index-strategy index-strategy

    The strategy to use when resolving against multiple index URLs.

    -

    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-index). This prevents "dependency confusion" attacks, whereby an attacker can upload a malicious package under the same name to an alternate index.

    -

    May also be set with the UV_INDEX_STRATEGY environment variable.

    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
    • -
    --index-url, -i index-url

    (Deprecated: use --default-index instead) The URL of the Python package index (by default: https://pypi.org/simple).

    -

    Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

    -

    The index given by this flag is given lower priority than all other indexes specified via the --extra-index-url flag.

    -

    May also be set with the UV_INDEX_URL environment variable.

    --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.

    -

    May also be set with the UV_KEYRING_PROVIDER environment variable.

    Possible values:

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

    The method to use when installing packages from the global cache.

    -

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

    -

    WARNING: The use of symlink link mode is discouraged, as they create tight coupling between the cache and the target environment. For example, clearing the cache (uv cache clean) will break all installed packages by way of removing the underlying source files. Use symlinks with caution.

    -

    May also be set with the UV_LINK_MODE environment variable.

    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
    • -
    --locked

    Assert that the uv.lock will remain unchanged.

    -

    Requires that the lockfile is up-to-date. If the lockfile is missing or needs to be updated, uv will exit with an error.

    -

    May also be set with the UV_LOCKED environment variable.

    --managed-python

    Require use of uv-managed Python versions.

    -

    By default, uv prefers using Python versions it manages. However, it will use system Python versions if a uv-managed Python is not installed. This option disables use of system Python versions.

    -

    May also be set with the UV_MANAGED_PYTHON environment variable.

    --native-tls

    Whether to load TLS certificates from the platform's native certificate store.

    -

    By default, uv loads certificates from the bundled webpki-roots crate. The webpki-roots are a reliable set of trust roots from Mozilla, and including them in uv improves portability and performance (especially on macOS).

    -

    However, in some cases, you may want to use the platform's native certificate store, especially if you're relying on a corporate trust root (e.g., for a mandatory proxy) that's included in your system's certificate store.

    -

    May also be set with the UV_NATIVE_TLS environment variable.

    --no-binary

    Don't install pre-built wheels.

    -

    The given packages will be built and installed from source. The resolver will still use pre-built wheels to extract package metadata, if available.

    -

    May also be set with the UV_NO_BINARY environment variable.

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

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

    -

    May also be set with the UV_NO_BINARY_PACKAGE environment variable.

    --no-build

    Don't build source distributions.

    -

    When enabled, resolving will not run arbitrary Python code. The cached wheels of already-built source distributions will be reused, but operations that require building distributions will exit with an error.

    -

    May also be set with the UV_NO_BUILD environment variable.

    --no-build-isolation

    Disable isolation when building source distributions.

    -

    Assumes that build dependencies specified by PEP 518 are already installed.

    -

    May also be set with the UV_NO_BUILD_ISOLATION environment variable.

    --no-build-isolation-package no-build-isolation-package

    Disable isolation when building source distributions for a specific package.

    -

    Assumes that the packages' build dependencies specified by PEP 518 are already installed.

    -
    --no-build-package no-build-package

    Don't build source distributions for a specific package

    -

    May also be set with the UV_NO_BUILD_PACKAGE environment variable.

    --no-cache, --no-cache-dir, -n

    Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation

    -

    May also be set with the UV_NO_CACHE environment variable.

    --no-config

    Avoid discovering configuration files (pyproject.toml, uv.toml).

    -

    Normally, configuration files are discovered in the current directory, parent directories, or user configuration directories.

    -

    May also be set with the UV_NO_CONFIG environment variable.

    --no-index

    Ignore the registry index (e.g., PyPI), instead relying on direct URL dependencies and those provided via --find-links

    -
    --no-managed-python

    Disable use of uv-managed Python versions.

    -

    Instead, uv will search for a suitable Python version on the system.

    -

    May also be set with the UV_NO_MANAGED_PYTHON environment variable.

    --no-progress

    Hide all progress outputs.

    -

    For example, spinners or progress bars.

    -

    May also be set with the UV_NO_PROGRESS environment variable.

    --no-python-downloads

    Disable automatic downloads of Python.

    -
    --no-sources

    Ignore the tool.uv.sources table when resolving dependencies. Used to lock against the standards-compliant, publishable package metadata, as opposed to using any workspace, Git, URL, or local path sources

    -

    May also be set with the UV_NO_SOURCES environment variable.

    --no-sync

    Avoid syncing the virtual environment after re-locking the project

    -

    May also be set with the UV_NO_SYNC environment variable.

    --offline

    Disable network access.

    -

    When disabled, uv will only use locally cached data and locally available files.

    -

    May also be set with the UV_OFFLINE environment variable.

    --output-format output-format

    The format of the output

    -

    [default: text]

    Possible values:

    -
      -
    • text: Display the version as plain text
    • -
    • json: Display the version as JSON
    • -
    --package package

    Update the version of a specific package in the workspace

    -
    --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).

    -

    May also be set with the UV_PRERELEASE environment variable.

    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
    • -
    --project project

    Discover a project in the given directory.

    -

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    -

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    -

    See --directory to change the working directory entirely.

    -

    This setting has no effect when used in the uv pip interface.

    -

    May also be set with the UV_PROJECT environment variable.

    --python, -p python

    The Python interpreter to use for resolving and syncing.

    -

    See uv python for details on Python discovery and supported request formats.

    -

    May also be set with the UV_PYTHON environment variable.

    --quiet, -q

    Use quiet output.

    -

    Repeating this option, e.g., -qq, will enable a silent mode in which uv will write no output to stdout.

    -
    --refresh

    Refresh all cached data

    -
    --refresh-package refresh-package

    Refresh cached data for a specific package

    -
    --reinstall, --force-reinstall

    Reinstall all packages, regardless of whether they're already installed. Implies --refresh

    -
    --reinstall-package reinstall-package

    Reinstall a specific package, regardless of whether it's already installed. Implies --refresh-package

    -
    --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).

    -

    May also be set with the UV_RESOLUTION environment variable.

    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
    • -
    --short

    Only show the version

    -

    By default, uv will show the project name before the version.

    -
    --upgrade, -U

    Allow package upgrades, ignoring pinned versions in any existing output file. Implies --refresh

    -
    --upgrade-package, -P upgrade-package

    Allow upgrades for a specific package, ignoring pinned versions in any existing output file. Implies --refresh-package

    -
    --verbose, -v

    Use verbose output.

    -

    You can configure fine-grained logging using the RUST_LOG environment variable. (https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#directives)

    -
    - -## uv sync - -Update the project's environment. - -Syncing ensures that all project dependencies are installed and up-to-date with the lockfile. - -By default, an exact sync is performed: uv removes packages that are not declared as dependencies of the project. Use the `--inexact` flag to keep extraneous packages. Note that if an extraneous package conflicts with a project dependency, it will still be removed. Additionally, if `--no-build-isolation` is used, uv will not remove extraneous packages to avoid removing possible build dependencies. - -If the project virtual environment (`.venv`) does not exist, it will be created. - -The project is re-locked before syncing unless the `--locked` or `--frozen` flag is provided. - -uv will search for a project in the current directory or any parent directory. If a project cannot be found, uv will exit with an error. - -Note that, when installing from a lockfile, uv will not provide warnings for yanked package versions. - -

    Usage

    - -``` -uv sync [OPTIONS] -``` - -

    Options

    - -
    --active

    Sync dependencies to the active virtual environment.

    -

    Instead of creating or updating the virtual environment for the project or script, the active virtual environment will be preferred, if the VIRTUAL_ENV environment variable is set.

    -
    --all-extras

    Include all optional dependencies.

    -

    When two or more extras are declared as conflicting in tool.uv.conflicts, using this flag will always result in an error.

    -

    Note that all optional dependencies are always included in the resolution; this option only affects the selection of packages to install.

    -
    --all-groups

    Include dependencies from all dependency groups.

    -

    --no-group can be used to exclude specific groups.

    -
    --all-packages

    Sync all packages in the workspace.

    -

    The workspace's environment (.venv) is updated to include all workspace members.

    -

    Any extras or groups specified via --extra, --group, or related options will be applied to all workspace members.

    -
    --allow-insecure-host, --trusted-host allow-insecure-host

    Allow insecure connections to a host.

    -

    Can be provided multiple times.

    -

    Expects to receive either a hostname (e.g., localhost), a host-port pair (e.g., localhost:8080), or a URL (e.g., https://localhost).

    -

    WARNING: Hosts included in this list will not be verified against the system's certificate store. Only use --allow-insecure-host in a secure network with verified sources, as it bypasses SSL verification and could expose you to MITM attacks.

    -

    May also be set with the UV_INSECURE_HOST environment variable.

    --cache-dir cache-dir

    Path to the cache directory.

    -

    Defaults to $XDG_CACHE_HOME/uv or $HOME/.cache/uv on macOS and Linux, and %LOCALAPPDATA%\uv\cache on Windows.

    -

    To view the location of the cache directory, run uv cache dir.

    -

    May also be set with the UV_CACHE_DIR environment variable.

    --check

    Check if the Python environment is synchronized with the project.

    -

    If the environment is not up to date, uv will exit with an error.

    -
    --color color-choice

    Control the use of color in output.

    -

    By default, uv will automatically detect support for colors when writing to a terminal.

    -

    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
    • -
    --compile-bytecode, --compile

    Compile Python files to bytecode after installation.

    -

    By default, uv does not compile Python (.py) files to bytecode (__pycache__/*.pyc); instead, compilation is performed lazily the first time a module is imported. For use-cases in which start time is critical, such as CLI applications and Docker containers, this option can be enabled to trade longer installation times for faster start times.

    -

    When enabled, uv will process the entire site-packages directory (including packages that are not being modified by the current operation) for consistency. Like pip, it will also ignore errors.

    -

    May also be set with the UV_COMPILE_BYTECODE environment variable.

    --config-file config-file

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

    -

    While uv configuration can be included in a pyproject.toml file, it is not allowed in this context.

    -

    May also be set with the UV_CONFIG_FILE environment variable.

    --config-setting, --config-settings, -C config-setting

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

    -
    --config-settings-package, --config-settings-package config-settings-package

    Settings to pass to the PEP 517 build backend for a specific package, specified as PACKAGE:KEY=VALUE pairs

    -
    --default-index default-index

    The URL of the default package index (by default: https://pypi.org/simple).

    -

    Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

    -

    The index given by this flag is given lower priority than all other indexes specified via the --index flag.

    -

    May also be set with the UV_DEFAULT_INDEX environment variable.

    --directory directory

    Change to the given directory prior to running the command.

    -

    Relative paths are resolved with the given directory as the base.

    -

    See --project to only change the project root directory.

    -

    May also be set with the UV_WORKING_DIR environment variable.

    --dry-run

    Perform a dry run, without writing the lockfile or modifying the project environment.

    -

    In dry-run mode, uv will resolve the project's dependencies and report on the resulting changes to both the lockfile and the project environment, but will not modify either.

    -
    --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 local dates in the same format (e.g., 2006-12-02) in your system's configured time zone.

    -

    May also be set with the UV_EXCLUDE_NEWER environment variable.

    --exclude-newer-package exclude-newer-package

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

    -

    Accepts package-date pairs in the format PACKAGE=DATE, where DATE is an RFC 3339 timestamp (e.g., 2006-12-02T02:07:43Z) or local date (e.g., 2006-12-02) in your system's configured time zone.

    -

    Can be provided multiple times for different packages.

    -
    --extra extra

    Include optional dependencies from the specified extra name.

    -

    May be provided more than once.

    -

    When multiple extras or groups are specified that appear in tool.uv.conflicts, uv will report an error.

    -

    Note that all optional dependencies are always included in the resolution; this option only affects the selection of packages to install.

    -
    --extra-index-url extra-index-url

    (Deprecated: use --index instead) Extra URLs of package indexes to use, in addition to --index-url.

    -

    Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

    -

    All indexes provided via this flag take priority over the index specified by --index-url (which defaults to PyPI). When multiple --extra-index-url flags are provided, earlier values take priority.

    -

    May also be set with the UV_EXTRA_INDEX_URL environment variable.

    Locations to search for candidate distributions, in addition to those found in the registry indexes.

    -

    If a path, the target must be a directory that contains packages as wheel files (.whl) or source distributions (e.g., .tar.gz or .zip) at the top level.

    -

    If a URL, the page must contain a flat list of links to package files adhering to the formats described above.

    -

    May also be set with the UV_FIND_LINKS environment variable.

    --fork-strategy fork-strategy

    The strategy to use when selecting multiple versions of a given package across Python versions and platforms.

    -

    By default, uv will optimize for selecting the latest version of each package for each supported Python version (requires-python), while minimizing the number of selected versions across platforms.

    -

    Under fewest, uv will minimize the number of selected versions for each package, preferring older versions that are compatible with a wider range of supported Python versions or platforms.

    -

    May also be set with the UV_FORK_STRATEGY environment variable.

    Possible values:

    -
      -
    • fewest: Optimize for selecting the fewest number of versions for each package. Older versions may be preferred if they are compatible with a wider range of supported Python versions or platforms
    • -
    • requires-python: Optimize for selecting latest supported version of each package, for each supported Python version
    • -
    --frozen

    Sync without updating the uv.lock file.

    -

    Instead of checking if the lockfile is up-to-date, uses the versions in the lockfile as the source of truth. If the lockfile is missing, uv will exit with an error. If the pyproject.toml includes changes to dependencies that have not been included in the lockfile yet, they will not be present in the environment.

    -

    May also be set with the UV_FROZEN environment variable.

    --group group

    Include dependencies from the specified dependency group.

    -

    When multiple extras or groups are specified that appear in tool.uv.conflicts, uv will report an error.

    -

    May be provided multiple times.

    -
    --help, -h

    Display the concise help for this command

    -
    --index index

    The URLs to use when resolving dependencies, in addition to the default index.

    -

    Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

    -

    All indexes provided via this flag take priority over the index specified by --default-index (which defaults to PyPI). When multiple --index flags are provided, earlier values take priority.

    -

    Index names are not supported as values. Relative paths must be disambiguated from index names with ./ or ../ on Unix or .\\, ..\\, ./ or ../ on Windows.

    -

    May also be set with the UV_INDEX environment variable.

    --index-strategy index-strategy

    The strategy to use when resolving against multiple index URLs.

    -

    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-index). This prevents "dependency confusion" attacks, whereby an attacker can upload a malicious package under the same name to an alternate index.

    -

    May also be set with the UV_INDEX_STRATEGY environment variable.

    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
    • -
    --index-url, -i index-url

    (Deprecated: use --default-index instead) The URL of the Python package index (by default: https://pypi.org/simple).

    -

    Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

    -

    The index given by this flag is given lower priority than all other indexes specified via the --extra-index-url flag.

    -

    May also be set with the UV_INDEX_URL environment variable.

    --inexact, --no-exact

    Do not remove extraneous packages present in the environment.

    -

    When enabled, uv will make the minimum necessary changes to satisfy the requirements. By default, syncing will remove any extraneous packages from the environment

    -
    --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.

    -

    May also be set with the UV_KEYRING_PROVIDER environment variable.

    Possible values:

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

    The method to use when installing packages from the global cache.

    -

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

    -

    WARNING: The use of symlink link mode is discouraged, as they create tight coupling between the cache and the target environment. For example, clearing the cache (uv cache clean) will break all installed packages by way of removing the underlying source files. Use symlinks with caution.

    -

    May also be set with the UV_LINK_MODE environment variable.

    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
    • -
    --locked

    Assert that the uv.lock will remain unchanged.

    -

    Requires that the lockfile is up-to-date. If the lockfile is missing or needs to be updated, uv will exit with an error.

    -

    May also be set with the UV_LOCKED environment variable.

    --managed-python

    Require use of uv-managed Python versions.

    -

    By default, uv prefers using Python versions it manages. However, it will use system Python versions if a uv-managed Python is not installed. This option disables use of system Python versions.

    -

    May also be set with the UV_MANAGED_PYTHON environment variable.

    --native-tls

    Whether to load TLS certificates from the platform's native certificate store.

    -

    By default, uv loads certificates from the bundled webpki-roots crate. The webpki-roots are a reliable set of trust roots from Mozilla, and including them in uv improves portability and performance (especially on macOS).

    -

    However, in some cases, you may want to use the platform's native certificate store, especially if you're relying on a corporate trust root (e.g., for a mandatory proxy) that's included in your system's certificate store.

    -

    May also be set with the UV_NATIVE_TLS environment variable.

    --no-binary

    Don't install pre-built wheels.

    -

    The given packages will be built and installed from source. The resolver will still use pre-built wheels to extract package metadata, if available.

    -

    May also be set with the UV_NO_BINARY environment variable.

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

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

    -

    May also be set with the UV_NO_BINARY_PACKAGE environment variable.

    --no-build

    Don't build source distributions.

    -

    When enabled, resolving will not run arbitrary Python code. The cached wheels of already-built source distributions will be reused, but operations that require building distributions will exit with an error.

    -

    May also be set with the UV_NO_BUILD environment variable.

    --no-build-isolation

    Disable isolation when building source distributions.

    -

    Assumes that build dependencies specified by PEP 518 are already installed.

    -

    May also be set with the UV_NO_BUILD_ISOLATION environment variable.

    --no-build-isolation-package no-build-isolation-package

    Disable isolation when building source distributions for a specific package.

    -

    Assumes that the packages' build dependencies specified by PEP 518 are already installed.

    -
    --no-build-package no-build-package

    Don't build source distributions for a specific package

    -

    May also be set with the UV_NO_BUILD_PACKAGE environment variable.

    --no-cache, --no-cache-dir, -n

    Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation

    -

    May also be set with the UV_NO_CACHE environment variable.

    --no-config

    Avoid discovering configuration files (pyproject.toml, uv.toml).

    -

    Normally, configuration files are discovered in the current directory, parent directories, or user configuration directories.

    -

    May also be set with the UV_NO_CONFIG environment variable.

    --no-default-groups

    Ignore the default dependency groups.

    -

    uv includes the groups defined in tool.uv.default-groups by default. This disables that option, however, specific groups can still be included with --group.

    -

    May also be set with the UV_NO_DEFAULT_GROUPS environment variable.

    --no-dev

    Disable the development dependency group.

    -

    This option is an alias of --no-group dev. See --no-default-groups to disable all default groups instead.

    -

    May also be set with the UV_NO_DEV environment variable.

    --no-editable

    Install any editable dependencies, including the project and any workspace members, as non-editable

    -

    May also be set with the UV_NO_EDITABLE environment variable.

    --no-extra no-extra

    Exclude the specified optional dependencies, if --all-extras is supplied.

    -

    May be provided multiple times.

    -
    --no-group no-group

    Disable the specified dependency group.

    -

    This option always takes precedence over default groups, --all-groups, and --group.

    -

    May be provided multiple times.

    -

    May also be set with the UV_NO_GROUP environment variable.

    --no-index

    Ignore the registry index (e.g., PyPI), instead relying on direct URL dependencies and those provided via --find-links

    -
    --no-install-local

    Do not install local path dependencies

    -

    Skips the current project, workspace members, and any other local (path or editable) packages. Only remote/indexed dependencies are installed. Useful in Docker builds to cache heavy third-party dependencies first and layer local packages separately.

    -

    The inverse --only-install-local can be used to install only local packages, excluding all remote dependencies.

    -
    --no-install-package no-install-package

    Do not install the given package(s).

    -

    By default, all of the project's dependencies are installed into the environment. The --no-install-package option allows exclusion of specific packages. Note this can result in a broken environment, and should be used with caution.

    -

    The inverse --only-install-package can be used to install only the specified packages, excluding all others.

    -
    --no-install-project

    Do not install the current project.

    -

    By default, the current project is installed into the environment with all of its dependencies. The --no-install-project option allows the project to be excluded, but all of its dependencies are still installed. This is particularly useful in situations like building Docker images where installing the project separately from its dependencies allows optimal layer caching.

    -

    The inverse --only-install-project can be used to install only the project itself, excluding all dependencies.

    -
    --no-install-workspace

    Do not install any workspace members, including the root project.

    -

    By default, all workspace members and their dependencies are installed into the environment. The --no-install-workspace option allows exclusion of all the workspace members while retaining their dependencies. This is particularly useful in situations like building Docker images where installing the workspace separately from its dependencies allows optimal layer caching.

    -

    The inverse --only-install-workspace can be used to install only workspace members, excluding all other dependencies.

    -
    --no-managed-python

    Disable use of uv-managed Python versions.

    -

    Instead, uv will search for a suitable Python version on the system.

    -

    May also be set with the UV_NO_MANAGED_PYTHON environment variable.

    --no-progress

    Hide all progress outputs.

    -

    For example, spinners or progress bars.

    -

    May also be set with the UV_NO_PROGRESS environment variable.

    --no-python-downloads

    Disable automatic downloads of Python.

    -
    --no-sources

    Ignore the tool.uv.sources table when resolving dependencies. Used to lock against the standards-compliant, publishable package metadata, as opposed to using any workspace, Git, URL, or local path sources

    -

    May also be set with the UV_NO_SOURCES environment variable.

    --offline

    Disable network access.

    -

    When disabled, uv will only use locally cached data and locally available files.

    -

    May also be set with the UV_OFFLINE environment variable.

    --only-dev

    Only include the development dependency group.

    -

    The project and its dependencies will be omitted.

    -

    This option is an alias for --only-group dev. Implies --no-default-groups.

    -
    --only-group only-group

    Only include dependencies from the specified dependency group.

    -

    The project and its dependencies will be omitted.

    -

    May be provided multiple times. Implies --no-default-groups.

    -
    --output-format output-format

    Select the output format

    -

    [default: text]

    Possible values:

    -
      -
    • text: Display the result in a human-readable format
    • -
    • json: Display the result in JSON format
    • -
    --package package

    Sync for specific packages in the workspace.

    -

    The workspace's environment (.venv) is updated to reflect the subset of dependencies declared by the specified workspace member packages.

    -

    If any workspace member does not exist, uv will exit with an error.

    -
    --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).

    -

    May also be set with the UV_PRERELEASE environment variable.

    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
    • -
    --project project

    Discover a project in the given directory.

    -

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    -

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    -

    See --directory to change the working directory entirely.

    -

    This setting has no effect when used in the uv pip interface.

    -

    May also be set with the UV_PROJECT environment variable.

    --python, -p python

    The Python interpreter to use for the project environment.

    -

    By default, the first interpreter that meets the project's requires-python constraint is -used.

    -

    If a Python interpreter in a virtual environment is provided, the packages will not be -synced to the given environment. The interpreter will be used to create a virtual -environment in the project.

    -

    See uv python for details on Python discovery and supported request formats.

    -

    May also be set with the UV_PYTHON environment variable.

    --python-platform python-platform

    The platform for which requirements should be installed.

    -

    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 aarch64-apple-darwin.

    -

    When targeting macOS (Darwin), the default minimum version is 13.0. Use MACOSX_DEPLOYMENT_TARGET to specify a different minimum version, e.g., 14.0.

    -

    When targeting iOS, the default minimum version is 13.0. Use IPHONEOS_DEPLOYMENT_TARGET to specify a different minimum version, e.g., 14.0.

    -

    When targeting Android, the default minimum Android API level is 24. Use ANDROID_API_LEVEL to specify a different minimum version, e.g., 26.

    -

    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: A 64-bit x86 Windows target
    • -
    • aarch64-pc-windows-msvc: An ARM64 Windows target
    • -
    • i686-pc-windows-msvc: A 32-bit x86 Windows target
    • -
    • x86_64-unknown-linux-gnu: An x86 Linux target. Equivalent to x86_64-manylinux_2_28
    • -
    • aarch64-apple-darwin: An ARM-based macOS target, as seen on Apple Silicon devices
    • -
    • x86_64-apple-darwin: An x86 macOS target
    • -
    • aarch64-unknown-linux-gnu: An ARM64 Linux target. Equivalent to aarch64-manylinux_2_28
    • -
    • aarch64-unknown-linux-musl: An ARM64 Linux target
    • -
    • x86_64-unknown-linux-musl: An x86_64 Linux target
    • -
    • riscv64-unknown-linux: A RISCV64 Linux target
    • -
    • x86_64-manylinux2014: An x86_64 target for the manylinux2014 platform. Equivalent to x86_64-manylinux_2_17
    • -
    • x86_64-manylinux_2_17: An x86_64 target for the manylinux_2_17 platform
    • -
    • x86_64-manylinux_2_28: An x86_64 target for the manylinux_2_28 platform
    • -
    • x86_64-manylinux_2_31: An x86_64 target for the manylinux_2_31 platform
    • -
    • x86_64-manylinux_2_32: An x86_64 target for the manylinux_2_32 platform
    • -
    • x86_64-manylinux_2_33: An x86_64 target for the manylinux_2_33 platform
    • -
    • x86_64-manylinux_2_34: An x86_64 target for the manylinux_2_34 platform
    • -
    • x86_64-manylinux_2_35: An x86_64 target for the manylinux_2_35 platform
    • -
    • x86_64-manylinux_2_36: An x86_64 target for the manylinux_2_36 platform
    • -
    • x86_64-manylinux_2_37: An x86_64 target for the manylinux_2_37 platform
    • -
    • x86_64-manylinux_2_38: An x86_64 target for the manylinux_2_38 platform
    • -
    • x86_64-manylinux_2_39: An x86_64 target for the manylinux_2_39 platform
    • -
    • x86_64-manylinux_2_40: An x86_64 target for the manylinux_2_40 platform
    • -
    • aarch64-manylinux2014: An ARM64 target for the manylinux2014 platform. Equivalent to aarch64-manylinux_2_17
    • -
    • aarch64-manylinux_2_17: An ARM64 target for the manylinux_2_17 platform
    • -
    • aarch64-manylinux_2_28: An ARM64 target for the manylinux_2_28 platform
    • -
    • aarch64-manylinux_2_31: An ARM64 target for the manylinux_2_31 platform
    • -
    • aarch64-manylinux_2_32: An ARM64 target for the manylinux_2_32 platform
    • -
    • aarch64-manylinux_2_33: An ARM64 target for the manylinux_2_33 platform
    • -
    • aarch64-manylinux_2_34: An ARM64 target for the manylinux_2_34 platform
    • -
    • aarch64-manylinux_2_35: An ARM64 target for the manylinux_2_35 platform
    • -
    • aarch64-manylinux_2_36: An ARM64 target for the manylinux_2_36 platform
    • -
    • aarch64-manylinux_2_37: An ARM64 target for the manylinux_2_37 platform
    • -
    • aarch64-manylinux_2_38: An ARM64 target for the manylinux_2_38 platform
    • -
    • aarch64-manylinux_2_39: An ARM64 target for the manylinux_2_39 platform
    • -
    • aarch64-manylinux_2_40: An ARM64 target for the manylinux_2_40 platform
    • -
    • aarch64-linux-android: An ARM64 Android target
    • -
    • x86_64-linux-android: An x86_64 Android target
    • -
    • wasm32-pyodide2024: A wasm32 target using the Pyodide 2024 platform. Meant for use with Python 3.12
    • -
    • arm64-apple-ios: An ARM64 target for iOS device
    • -
    • arm64-apple-ios-simulator: An ARM64 target for iOS simulator
    • -
    • x86_64-apple-ios-simulator: An x86_64 target for iOS simulator
    • -
    --quiet, -q

    Use quiet output.

    -

    Repeating this option, e.g., -qq, will enable a silent mode in which uv will write no output to stdout.

    -
    --refresh

    Refresh all cached data

    -
    --refresh-package refresh-package

    Refresh cached data for a specific package

    -
    --reinstall, --force-reinstall

    Reinstall all packages, regardless of whether they're already installed. Implies --refresh

    -
    --reinstall-package reinstall-package

    Reinstall a specific package, regardless of whether it's already installed. Implies --refresh-package

    -
    --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).

    -

    May also be set with the UV_RESOLUTION environment variable.

    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
    • -
    --script script

    Sync the environment for a Python script, rather than the current project.

    -

    If provided, uv will sync the dependencies based on the script's inline metadata table, in adherence with PEP 723.

    -
    --upgrade, -U

    Allow package upgrades, ignoring pinned versions in any existing output file. Implies --refresh

    -
    --upgrade-package, -P upgrade-package

    Allow upgrades for a specific package, ignoring pinned versions in any existing output file. Implies --refresh-package

    -
    --verbose, -v

    Use verbose output.

    -

    You can configure fine-grained logging using the RUST_LOG environment variable. (https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#directives)

    -
    - -## uv lock - -Update the project's lockfile. - -If the project lockfile (`uv.lock`) does not exist, it will be created. If a lockfile is present, its contents will be used as preferences for the resolution. - -If there are no changes to the project's dependencies, locking will have no effect unless the `--upgrade` flag is provided. - -

    Usage

    - -``` -uv lock [OPTIONS] -``` - -

    Options

    - -
    --allow-insecure-host, --trusted-host allow-insecure-host

    Allow insecure connections to a host.

    -

    Can be provided multiple times.

    -

    Expects to receive either a hostname (e.g., localhost), a host-port pair (e.g., localhost:8080), or a URL (e.g., https://localhost).

    -

    WARNING: Hosts included in this list will not be verified against the system's certificate store. Only use --allow-insecure-host in a secure network with verified sources, as it bypasses SSL verification and could expose you to MITM attacks.

    -

    May also be set with the UV_INSECURE_HOST environment variable.

    --cache-dir cache-dir

    Path to the cache directory.

    -

    Defaults to $XDG_CACHE_HOME/uv or $HOME/.cache/uv on macOS and Linux, and %LOCALAPPDATA%\uv\cache on Windows.

    -

    To view the location of the cache directory, run uv cache dir.

    -

    May also be set with the UV_CACHE_DIR environment variable.

    --check

    Check if the lockfile is up-to-date.

    -

    Asserts that the uv.lock would remain unchanged after a resolution. If the lockfile is missing or needs to be updated, uv will exit with an error.

    -

    Equivalent to --locked.

    -
    --check-exists, --frozen

    Assert that a uv.lock exists without checking if it is up-to-date.

    -

    Equivalent to --frozen.

    -

    May also be set with the UV_FROZEN environment variable.

    --color color-choice

    Control the use of color in output.

    -

    By default, uv will automatically detect support for colors when writing to a terminal.

    -

    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.

    -

    While uv configuration can be included in a pyproject.toml file, it is not allowed in this context.

    -

    May also be set with the UV_CONFIG_FILE environment variable.

    --config-setting, --config-settings, -C config-setting

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

    -
    --config-settings-package, --config-settings-package config-settings-package

    Settings to pass to the PEP 517 build backend for a specific package, specified as PACKAGE:KEY=VALUE pairs

    -
    --default-index default-index

    The URL of the default package index (by default: https://pypi.org/simple).

    -

    Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

    -

    The index given by this flag is given lower priority than all other indexes specified via the --index flag.

    -

    May also be set with the UV_DEFAULT_INDEX environment variable.

    --directory directory

    Change to the given directory prior to running the command.

    -

    Relative paths are resolved with the given directory as the base.

    -

    See --project to only change the project root directory.

    -

    May also be set with the UV_WORKING_DIR environment variable.

    --dry-run

    Perform a dry run, without writing the lockfile.

    -

    In dry-run mode, uv will resolve the project's dependencies and report on the resulting changes, but will not write the lockfile to disk.

    -
    --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 local dates in the same format (e.g., 2006-12-02) in your system's configured time zone.

    -

    May also be set with the UV_EXCLUDE_NEWER environment variable.

    --exclude-newer-package exclude-newer-package

    Limit candidate packages for a specific package to those that were uploaded prior to the given date.

    -

    Accepts package-date pairs in the format PACKAGE=DATE, where DATE is an RFC 3339 timestamp (e.g., 2006-12-02T02:07:43Z) or local date (e.g., 2006-12-02) in your system's configured time zone.

    -

    Can be provided multiple times for different packages.

    -
    --extra-index-url extra-index-url

    (Deprecated: use --index instead) Extra URLs of package indexes to use, in addition to --index-url.

    -

    Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

    -

    All indexes provided via this flag take priority over the index specified by --index-url (which defaults to PyPI). When multiple --extra-index-url flags are provided, earlier values take priority.

    -

    May also be set with the UV_EXTRA_INDEX_URL environment variable.

    Locations to search for candidate distributions, in addition to those found in the registry indexes.

    -

    If a path, the target must be a directory that contains packages as wheel files (.whl) or source distributions (e.g., .tar.gz or .zip) at the top level.

    -

    If a URL, the page must contain a flat list of links to package files adhering to the formats described above.

    -

    May also be set with the UV_FIND_LINKS environment variable.

    --fork-strategy fork-strategy

    The strategy to use when selecting multiple versions of a given package across Python versions and platforms.

    -

    By default, uv will optimize for selecting the latest version of each package for each supported Python version (requires-python), while minimizing the number of selected versions across platforms.

    -

    Under fewest, uv will minimize the number of selected versions for each package, preferring older versions that are compatible with a wider range of supported Python versions or platforms.

    -

    May also be set with the UV_FORK_STRATEGY environment variable.

    Possible values:

    -
      -
    • fewest: Optimize for selecting the fewest number of versions for each package. Older versions may be preferred if they are compatible with a wider range of supported Python versions or platforms
    • -
    • requires-python: Optimize for selecting latest supported version of each package, for each supported Python version
    • -
    --help, -h

    Display the concise help for this command

    -
    --index index

    The URLs to use when resolving dependencies, in addition to the default index.

    -

    Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

    -

    All indexes provided via this flag take priority over the index specified by --default-index (which defaults to PyPI). When multiple --index flags are provided, earlier values take priority.

    -

    Index names are not supported as values. Relative paths must be disambiguated from index names with ./ or ../ on Unix or .\\, ..\\, ./ or ../ on Windows.

    -

    May also be set with the UV_INDEX environment variable.

    --index-strategy index-strategy

    The strategy to use when resolving against multiple index URLs.

    -

    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-index). This prevents "dependency confusion" attacks, whereby an attacker can upload a malicious package under the same name to an alternate index.

    -

    May also be set with the UV_INDEX_STRATEGY environment variable.

    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
    • -
    --index-url, -i index-url

    (Deprecated: use --default-index instead) The URL of the Python package index (by default: https://pypi.org/simple).

    -

    Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

    -

    The index given by this flag is given lower priority than all other indexes specified via the --extra-index-url flag.

    -

    May also be set with the UV_INDEX_URL environment variable.

    --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.

    -

    May also be set with the UV_KEYRING_PROVIDER environment variable.

    Possible values:

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

    The method to use when installing packages from the global cache.

    -

    This option is only used when building source distributions.

    -

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

    -

    WARNING: The use of symlink link mode is discouraged, as they create tight coupling between the cache and the target environment. For example, clearing the cache (uv cache clean) will break all installed packages by way of removing the underlying source files. Use symlinks with caution.

    -

    May also be set with the UV_LINK_MODE environment variable.

    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
    • -
    --managed-python

    Require use of uv-managed Python versions.

    -

    By default, uv prefers using Python versions it manages. However, it will use system Python versions if a uv-managed Python is not installed. This option disables use of system Python versions.

    -

    May also be set with the UV_MANAGED_PYTHON environment variable.

    --native-tls

    Whether to load TLS certificates from the platform's native certificate store.

    -

    By default, uv loads certificates from the bundled webpki-roots crate. The webpki-roots are a reliable set of trust roots from Mozilla, and including them in uv improves portability and performance (especially on macOS).

    -

    However, in some cases, you may want to use the platform's native certificate store, especially if you're relying on a corporate trust root (e.g., for a mandatory proxy) that's included in your system's certificate store.

    -

    May also be set with the UV_NATIVE_TLS environment variable.

    --no-binary

    Don't install pre-built wheels.

    -

    The given packages will be built and installed from source. The resolver will still use pre-built wheels to extract package metadata, if available.

    -

    May also be set with the UV_NO_BINARY environment variable.

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

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

    -

    May also be set with the UV_NO_BINARY_PACKAGE environment variable.

    --no-build

    Don't build source distributions.

    -

    When enabled, resolving will not run arbitrary Python code. The cached wheels of already-built source distributions will be reused, but operations that require building distributions will exit with an error.

    -

    May also be set with the UV_NO_BUILD environment variable.

    --no-build-isolation

    Disable isolation when building source distributions.

    -

    Assumes that build dependencies specified by PEP 518 are already installed.

    -

    May also be set with the UV_NO_BUILD_ISOLATION environment variable.

    --no-build-isolation-package no-build-isolation-package

    Disable isolation when building source distributions for a specific package.

    -

    Assumes that the packages' build dependencies specified by PEP 518 are already installed.

    -
    --no-build-package no-build-package

    Don't build source distributions for a specific package

    -

    May also be set with the UV_NO_BUILD_PACKAGE environment variable.

    --no-cache, --no-cache-dir, -n

    Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation

    -

    May also be set with the UV_NO_CACHE environment variable.

    --no-config

    Avoid discovering configuration files (pyproject.toml, uv.toml).

    -

    Normally, configuration files are discovered in the current directory, parent directories, or user configuration directories.

    -

    May also be set with the UV_NO_CONFIG environment variable.

    --no-index

    Ignore the registry index (e.g., PyPI), instead relying on direct URL dependencies and those provided via --find-links

    -
    --no-managed-python

    Disable use of uv-managed Python versions.

    -

    Instead, uv will search for a suitable Python version on the system.

    -

    May also be set with the UV_NO_MANAGED_PYTHON environment variable.

    --no-progress

    Hide all progress outputs.

    -

    For example, spinners or progress bars.

    -

    May also be set with the UV_NO_PROGRESS environment variable.

    --no-python-downloads

    Disable automatic downloads of Python.

    -
    --no-sources

    Ignore the tool.uv.sources table when resolving dependencies. Used to lock against the standards-compliant, publishable package metadata, as opposed to using any workspace, Git, URL, or local path sources

    -

    May also be set with the UV_NO_SOURCES environment variable.

    --offline

    Disable network access.

    -

    When disabled, uv will only use locally cached data and locally available files.

    -

    May also be set with the UV_OFFLINE environment variable.

    --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).

    -

    May also be set with the UV_PRERELEASE environment variable.

    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
    • -
    --project project

    Discover a project in the given directory.

    -

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    -

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    -

    See --directory to change the working directory entirely.

    -

    This setting has no effect when used in the uv pip interface.

    -

    May also be set with the UV_PROJECT environment variable.

    --python, -p python

    The Python interpreter to use during resolution.

    -

    A Python interpreter is required for building source distributions to determine package -metadata when there are not wheels.

    -

    The interpreter is also used as the fallback value for the minimum Python version if -requires-python is not set.

    -

    See uv python for details on Python discovery and supported request formats.

    -

    May also be set with the UV_PYTHON environment variable.

    --quiet, -q

    Use quiet output.

    -

    Repeating this option, e.g., -qq, will enable a silent mode in which uv will write no output to stdout.

    -
    --refresh

    Refresh all cached data

    -
    --refresh-package refresh-package

    Refresh cached data for a specific package

    -
    --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).

    -

    May also be set with the UV_RESOLUTION environment variable.

    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
    • -
    --script script

    Lock the specified Python script, rather than the current project.

    -

    If provided, uv will lock the script (based on its inline metadata table, in adherence with PEP 723) to a .lock file adjacent to the script itself.

    -
    --upgrade, -U

    Allow package upgrades, ignoring pinned versions in any existing output file. Implies --refresh

    -
    --upgrade-package, -P upgrade-package

    Allow upgrades for a specific package, ignoring pinned versions in any existing output file. Implies --refresh-package

    -
    --verbose, -v

    Use verbose output.

    -

    You can configure fine-grained logging using the RUST_LOG environment variable. (https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#directives)

    -
    - -## uv export - -Export the project's lockfile to an alternate format. - -At present, both `requirements.txt` and `pylock.toml` (PEP 751) formats are supported. - -The project is re-locked before exporting unless the `--locked` or `--frozen` flag is provided. - -uv will search for a project in the current directory or any parent directory. If a project cannot be found, uv will exit with an error. - -If operating in a workspace, the root will be exported by default; however, specific members can be selected using the `--package` option. - -

    Usage

    - -``` -uv export [OPTIONS] -``` - -

    Options

    - -
    --all-extras

    Include all optional dependencies

    -
    --all-groups

    Include dependencies from all dependency groups.

    -

    --no-group can be used to exclude specific groups.

    -
    --all-packages

    Export the entire workspace.

    -

    The dependencies for all workspace members will be included in the exported requirements file.

    -

    Any extras or groups specified via --extra, --group, or related options will be applied to all workspace members.

    -
    --allow-insecure-host, --trusted-host allow-insecure-host

    Allow insecure connections to a host.

    -

    Can be provided multiple times.

    -

    Expects to receive either a hostname (e.g., localhost), a host-port pair (e.g., localhost:8080), or a URL (e.g., https://localhost).

    -

    WARNING: Hosts included in this list will not be verified against the system's certificate store. Only use --allow-insecure-host in a secure network with verified sources, as it bypasses SSL verification and could expose you to MITM attacks.

    -

    May also be set with the UV_INSECURE_HOST environment variable.

    --cache-dir cache-dir

    Path to the cache directory.

    -

    Defaults to $XDG_CACHE_HOME/uv or $HOME/.cache/uv on macOS and Linux, and %LOCALAPPDATA%\uv\cache on Windows.

    -

    To view the location of the cache directory, run uv cache dir.

    -

    May also be set with the UV_CACHE_DIR environment variable.

    --color color-choice

    Control the use of color in output.

    -

    By default, uv will automatically detect support for colors when writing to a terminal.

    -

    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.

    -

    While uv configuration can be included in a pyproject.toml file, it is not allowed in this context.

    -

    May also be set with the UV_CONFIG_FILE environment variable.

    --config-setting, --config-settings, -C config-setting

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

    -
    --config-settings-package, --config-settings-package config-settings-package

    Settings to pass to the PEP 517 build backend for a specific package, specified as PACKAGE:KEY=VALUE pairs

    -
    --default-index default-index

    The URL of the default package index (by default: https://pypi.org/simple).

    -

    Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

    -

    The index given by this flag is given lower priority than all other indexes specified via the --index flag.

    -

    May also be set with the UV_DEFAULT_INDEX environment variable.

    --directory directory

    Change to the given directory prior to running the command.

    -

    Relative paths are resolved with the given directory as the base.

    -

    See --project to only change the project root directory.

    -

    May also be set with the UV_WORKING_DIR environment variable.

    --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 local dates in the same format (e.g., 2006-12-02) in your system's configured time zone.

    -

    May also be set with the UV_EXCLUDE_NEWER environment variable.

    --exclude-newer-package exclude-newer-package

    Limit candidate packages for a specific package to those that were uploaded prior to the given date.

    -

    Accepts package-date pairs in the format PACKAGE=DATE, where DATE is an RFC 3339 timestamp (e.g., 2006-12-02T02:07:43Z) or local date (e.g., 2006-12-02) in your system's configured time zone.

    -

    Can be provided multiple times for different packages.

    -
    --extra extra

    Include optional dependencies from the specified extra name.

    -

    May be provided more than once.

    -
    --extra-index-url extra-index-url

    (Deprecated: use --index instead) Extra URLs of package indexes to use, in addition to --index-url.

    -

    Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

    -

    All indexes provided via this flag take priority over the index specified by --index-url (which defaults to PyPI). When multiple --extra-index-url flags are provided, earlier values take priority.

    -

    May also be set with the UV_EXTRA_INDEX_URL environment variable.

    Locations to search for candidate distributions, in addition to those found in the registry indexes.

    -

    If a path, the target must be a directory that contains packages as wheel files (.whl) or source distributions (e.g., .tar.gz or .zip) at the top level.

    -

    If a URL, the page must contain a flat list of links to package files adhering to the formats described above.

    -

    May also be set with the UV_FIND_LINKS environment variable.

    --fork-strategy fork-strategy

    The strategy to use when selecting multiple versions of a given package across Python versions and platforms.

    -

    By default, uv will optimize for selecting the latest version of each package for each supported Python version (requires-python), while minimizing the number of selected versions across platforms.

    -

    Under fewest, uv will minimize the number of selected versions for each package, preferring older versions that are compatible with a wider range of supported Python versions or platforms.

    -

    May also be set with the UV_FORK_STRATEGY environment variable.

    Possible values:

    -
      -
    • fewest: Optimize for selecting the fewest number of versions for each package. Older versions may be preferred if they are compatible with a wider range of supported Python versions or platforms
    • -
    • requires-python: Optimize for selecting latest supported version of each package, for each supported Python version
    • -
    --format format

    The format to which uv.lock should be exported.

    -

    Supports requirements.txt, pylock.toml (PEP 751) and CycloneDX v1.5 JSON output formats.

    -

    uv will infer the output format from the file extension of the output file, if provided. Otherwise, defaults to requirements.txt.

    -

    Possible values:

    -
      -
    • requirements.txt: Export in requirements.txt format
    • -
    • pylock.toml: Export in pylock.toml format
    • -
    • cyclonedx1.5: Export in CycloneDX v1.5 JSON format
    • -
    --frozen

    Do not update the uv.lock before exporting.

    -

    If a uv.lock does not exist, uv will exit with an error.

    -

    May also be set with the UV_FROZEN environment variable.

    --group group

    Include dependencies from the specified dependency group.

    -

    May be provided multiple times.

    -
    --help, -h

    Display the concise help for this command

    -
    --index index

    The URLs to use when resolving dependencies, in addition to the default index.

    -

    Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

    -

    All indexes provided via this flag take priority over the index specified by --default-index (which defaults to PyPI). When multiple --index flags are provided, earlier values take priority.

    -

    Index names are not supported as values. Relative paths must be disambiguated from index names with ./ or ../ on Unix or .\\, ..\\, ./ or ../ on Windows.

    -

    May also be set with the UV_INDEX environment variable.

    --index-strategy index-strategy

    The strategy to use when resolving against multiple index URLs.

    -

    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-index). This prevents "dependency confusion" attacks, whereby an attacker can upload a malicious package under the same name to an alternate index.

    -

    May also be set with the UV_INDEX_STRATEGY environment variable.

    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
    • -
    --index-url, -i index-url

    (Deprecated: use --default-index instead) The URL of the Python package index (by default: https://pypi.org/simple).

    -

    Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

    -

    The index given by this flag is given lower priority than all other indexes specified via the --extra-index-url flag.

    -

    May also be set with the UV_INDEX_URL environment variable.

    --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.

    -

    May also be set with the UV_KEYRING_PROVIDER environment variable.

    Possible values:

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

    The method to use when installing packages from the global cache.

    -

    This option is only used when building source distributions.

    -

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

    -

    WARNING: The use of symlink link mode is discouraged, as they create tight coupling between the cache and the target environment. For example, clearing the cache (uv cache clean) will break all installed packages by way of removing the underlying source files. Use symlinks with caution.

    -

    May also be set with the UV_LINK_MODE environment variable.

    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
    • -
    --locked

    Assert that the uv.lock will remain unchanged.

    -

    Requires that the lockfile is up-to-date. If the lockfile is missing or needs to be updated, uv will exit with an error.

    -

    May also be set with the UV_LOCKED environment variable.

    --managed-python

    Require use of uv-managed Python versions.

    -

    By default, uv prefers using Python versions it manages. However, it will use system Python versions if a uv-managed Python is not installed. This option disables use of system Python versions.

    -

    May also be set with the UV_MANAGED_PYTHON environment variable.

    --native-tls

    Whether to load TLS certificates from the platform's native certificate store.

    -

    By default, uv loads certificates from the bundled webpki-roots crate. The webpki-roots are a reliable set of trust roots from Mozilla, and including them in uv improves portability and performance (especially on macOS).

    -

    However, in some cases, you may want to use the platform's native certificate store, especially if you're relying on a corporate trust root (e.g., for a mandatory proxy) that's included in your system's certificate store.

    -

    May also be set with the UV_NATIVE_TLS environment variable.

    --no-annotate

    Exclude comment annotations indicating the source of each package

    -
    --no-binary

    Don't install pre-built wheels.

    -

    The given packages will be built and installed from source. The resolver will still use pre-built wheels to extract package metadata, if available.

    -

    May also be set with the UV_NO_BINARY environment variable.

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

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

    -

    May also be set with the UV_NO_BINARY_PACKAGE environment variable.

    --no-build

    Don't build source distributions.

    -

    When enabled, resolving will not run arbitrary Python code. The cached wheels of already-built source distributions will be reused, but operations that require building distributions will exit with an error.

    -

    May also be set with the UV_NO_BUILD environment variable.

    --no-build-isolation

    Disable isolation when building source distributions.

    -

    Assumes that build dependencies specified by PEP 518 are already installed.

    -

    May also be set with the UV_NO_BUILD_ISOLATION environment variable.

    --no-build-isolation-package no-build-isolation-package

    Disable isolation when building source distributions for a specific package.

    -

    Assumes that the packages' build dependencies specified by PEP 518 are already installed.

    -
    --no-build-package no-build-package

    Don't build source distributions for a specific package

    -

    May also be set with the UV_NO_BUILD_PACKAGE environment variable.

    --no-cache, --no-cache-dir, -n

    Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation

    -

    May also be set with the UV_NO_CACHE environment variable.

    --no-config

    Avoid discovering configuration files (pyproject.toml, uv.toml).

    -

    Normally, configuration files are discovered in the current directory, parent directories, or user configuration directories.

    -

    May also be set with the UV_NO_CONFIG environment variable.

    --no-default-groups

    Ignore the default dependency groups.

    -

    uv includes the groups defined in tool.uv.default-groups by default. This disables that option, however, specific groups can still be included with --group.

    -

    May also be set with the UV_NO_DEFAULT_GROUPS environment variable.

    --no-dev

    Disable the development dependency group.

    -

    This option is an alias of --no-group dev. See --no-default-groups to disable all default groups instead.

    -

    May also be set with the UV_NO_DEV environment variable.

    --no-editable

    Export any editable dependencies, including the project and any workspace members, as non-editable

    -

    May also be set with the UV_NO_EDITABLE environment variable.

    --no-emit-local, --no-install-local

    Do not include local path dependencies in the exported requirements.

    -

    Omits the current project, workspace members, and any other local (path or editable) packages from the export. Only remote/indexed dependencies are written. Useful for Docker and CI flows that want to export and cache third-party dependencies first.

    -

    The inverse --only-emit-local can be used to emit only local packages, excluding all remote dependencies.

    -
    --no-emit-package, --no-install-package no-emit-package

    Do not emit the given package(s).

    -

    By default, all project's dependencies are included in the exported requirements file. The --no-emit-package option allows exclusion of specific packages.

    -

    The inverse --only-emit-package can be used to emit only the specified packages, excluding all others.

    -
    --no-emit-project, --no-install-project

    Do not emit the current project.

    -

    By default, the current project is included in the exported requirements file with all of its dependencies. The --no-emit-project option allows the project to be excluded, but all of its dependencies to remain included.

    -

    The inverse --only-emit-project can be used to emit only the project itself, excluding all dependencies.

    -
    --no-emit-workspace, --no-install-workspace

    Do not emit any workspace members, including the root project.

    -

    By default, all workspace members and their dependencies are included in the exported requirements file, with all of their dependencies. The --no-emit-workspace option allows exclusion of all the workspace members while retaining their dependencies.

    -

    The inverse --only-emit-workspace can be used to emit only workspace members, excluding all other dependencies.

    -
    --no-extra no-extra

    Exclude the specified optional dependencies, if --all-extras is supplied.

    -

    May be provided multiple times.

    -
    --no-group no-group

    Disable the specified dependency group.

    -

    This option always takes precedence over default groups, --all-groups, and --group.

    -

    May be provided multiple times.

    -

    May also be set with the UV_NO_GROUP environment variable.

    --no-hashes

    Omit hashes in the generated output

    -
    --no-header

    Exclude the comment header at the top of the generated output file

    -
    --no-index

    Ignore the registry index (e.g., PyPI), instead relying on direct URL dependencies and those provided via --find-links

    -
    --no-managed-python

    Disable use of uv-managed Python versions.

    -

    Instead, uv will search for a suitable Python version on the system.

    -

    May also be set with the UV_NO_MANAGED_PYTHON environment variable.

    --no-progress

    Hide all progress outputs.

    -

    For example, spinners or progress bars.

    -

    May also be set with the UV_NO_PROGRESS environment variable.

    --no-python-downloads

    Disable automatic downloads of Python.

    -
    --no-sources

    Ignore the tool.uv.sources table when resolving dependencies. Used to lock against the standards-compliant, publishable package metadata, as opposed to using any workspace, Git, URL, or local path sources

    -

    May also be set with the UV_NO_SOURCES environment variable.

    --offline

    Disable network access.

    -

    When disabled, uv will only use locally cached data and locally available files.

    -

    May also be set with the UV_OFFLINE environment variable.

    --only-dev

    Only include the development dependency group.

    -

    The project and its dependencies will be omitted.

    -

    This option is an alias for --only-group dev. Implies --no-default-groups.

    -
    --only-group only-group

    Only include dependencies from the specified dependency group.

    -

    The project and its dependencies will be omitted.

    -

    May be provided multiple times. Implies --no-default-groups.

    -
    --output-file, -o output-file

    Write the exported requirements to the given file

    -
    --package package

    Export the dependencies for specific packages in the workspace.

    -

    If any workspace member does not exist, uv will exit with an error.

    -
    --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).

    -

    May also be set with the UV_PRERELEASE environment variable.

    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
    • -
    --project project

    Discover a project in the given directory.

    -

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    -

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    -

    See --directory to change the working directory entirely.

    -

    This setting has no effect when used in the uv pip interface.

    -

    May also be set with the UV_PROJECT environment variable.

    --prune package

    Prune the given package from the dependency tree.

    -

    Pruned packages will be excluded from the exported requirements file, as will any dependencies that are no longer required after the pruned package is removed.

    -
    --python, -p python

    The Python interpreter to use during resolution.

    -

    A Python interpreter is required for building source distributions to determine package -metadata when there are not wheels.

    -

    The interpreter is also used as the fallback value for the minimum Python version if -requires-python is not set.

    -

    See uv python for details on Python discovery and supported request formats.

    -

    May also be set with the UV_PYTHON environment variable.

    --quiet, -q

    Use quiet output.

    -

    Repeating this option, e.g., -qq, will enable a silent mode in which uv will write no output to stdout.

    -
    --refresh

    Refresh all cached data

    -
    --refresh-package refresh-package

    Refresh cached data for a specific package

    -
    --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).

    -

    May also be set with the UV_RESOLUTION environment variable.

    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
    • -
    --script script

    Export the dependencies for the specified PEP 723 Python script, rather than the current project.

    -

    If provided, uv will resolve the dependencies based on its inline metadata table, in adherence with PEP 723.

    -
    --upgrade, -U

    Allow package upgrades, ignoring pinned versions in any existing output file. Implies --refresh

    -
    --upgrade-package, -P upgrade-package

    Allow upgrades for a specific package, ignoring pinned versions in any existing output file. Implies --refresh-package

    -
    --verbose, -v

    Use verbose output.

    -

    You can configure fine-grained logging using the RUST_LOG environment variable. (https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#directives)

    -
    - -## uv tree - -Display the project's dependency tree - -

    Usage

    - -``` -uv tree [OPTIONS] -``` - -

    Options

    - -
    --all-groups

    Include dependencies from all dependency groups.

    -

    --no-group can be used to exclude specific groups.

    -
    --allow-insecure-host, --trusted-host allow-insecure-host

    Allow insecure connections to a host.

    -

    Can be provided multiple times.

    -

    Expects to receive either a hostname (e.g., localhost), a host-port pair (e.g., localhost:8080), or a URL (e.g., https://localhost).

    -

    WARNING: Hosts included in this list will not be verified against the system's certificate store. Only use --allow-insecure-host in a secure network with verified sources, as it bypasses SSL verification and could expose you to MITM attacks.

    -

    May also be set with the UV_INSECURE_HOST environment variable.

    --cache-dir cache-dir

    Path to the cache directory.

    -

    Defaults to $XDG_CACHE_HOME/uv or $HOME/.cache/uv on macOS and Linux, and %LOCALAPPDATA%\uv\cache on Windows.

    -

    To view the location of the cache directory, run uv cache dir.

    -

    May also be set with the UV_CACHE_DIR environment variable.

    --color color-choice

    Control the use of color in output.

    -

    By default, uv will automatically detect support for colors when writing to a terminal.

    -

    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.

    -

    While uv configuration can be included in a pyproject.toml file, it is not allowed in this context.

    -

    May also be set with the UV_CONFIG_FILE environment variable.

    --config-setting, --config-settings, -C config-setting

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

    -
    --config-settings-package, --config-settings-package config-settings-package

    Settings to pass to the PEP 517 build backend for a specific package, specified as PACKAGE:KEY=VALUE pairs

    -
    --default-index default-index

    The URL of the default package index (by default: https://pypi.org/simple).

    -

    Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

    -

    The index given by this flag is given lower priority than all other indexes specified via the --index flag.

    -

    May also be set with the UV_DEFAULT_INDEX environment variable.

    --depth, -d depth

    Maximum display depth of the dependency tree

    -

    [default: 255]

    --directory directory

    Change to the given directory prior to running the command.

    -

    Relative paths are resolved with the given directory as the base.

    -

    See --project to only change the project root directory.

    -

    May also be set with the UV_WORKING_DIR environment variable.

    --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 local dates in the same format (e.g., 2006-12-02) in your system's configured time zone.

    -

    May also be set with the UV_EXCLUDE_NEWER environment variable.

    --exclude-newer-package exclude-newer-package

    Limit candidate packages for a specific package to those that were uploaded prior to the given date.

    -

    Accepts package-date pairs in the format PACKAGE=DATE, where DATE is an RFC 3339 timestamp (e.g., 2006-12-02T02:07:43Z) or local date (e.g., 2006-12-02) in your system's configured time zone.

    -

    Can be provided multiple times for different packages.

    -
    --extra-index-url extra-index-url

    (Deprecated: use --index instead) Extra URLs of package indexes to use, in addition to --index-url.

    -

    Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

    -

    All indexes provided via this flag take priority over the index specified by --index-url (which defaults to PyPI). When multiple --extra-index-url flags are provided, earlier values take priority.

    -

    May also be set with the UV_EXTRA_INDEX_URL environment variable.

    Locations to search for candidate distributions, in addition to those found in the registry indexes.

    -

    If a path, the target must be a directory that contains packages as wheel files (.whl) or source distributions (e.g., .tar.gz or .zip) at the top level.

    -

    If a URL, the page must contain a flat list of links to package files adhering to the formats described above.

    -

    May also be set with the UV_FIND_LINKS environment variable.

    --fork-strategy fork-strategy

    The strategy to use when selecting multiple versions of a given package across Python versions and platforms.

    -

    By default, uv will optimize for selecting the latest version of each package for each supported Python version (requires-python), while minimizing the number of selected versions across platforms.

    -

    Under fewest, uv will minimize the number of selected versions for each package, preferring older versions that are compatible with a wider range of supported Python versions or platforms.

    -

    May also be set with the UV_FORK_STRATEGY environment variable.

    Possible values:

    -
      -
    • fewest: Optimize for selecting the fewest number of versions for each package. Older versions may be preferred if they are compatible with a wider range of supported Python versions or platforms
    • -
    • requires-python: Optimize for selecting latest supported version of each package, for each supported Python version
    • -
    --frozen

    Display the requirements without locking the project.

    -

    If the lockfile is missing, uv will exit with an error.

    -

    May also be set with the UV_FROZEN environment variable.

    --group group

    Include dependencies from the specified dependency group.

    -

    May be provided multiple times.

    -
    --help, -h

    Display the concise help for this command

    -
    --index index

    The URLs to use when resolving dependencies, in addition to the default index.

    -

    Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

    -

    All indexes provided via this flag take priority over the index specified by --default-index (which defaults to PyPI). When multiple --index flags are provided, earlier values take priority.

    -

    Index names are not supported as values. Relative paths must be disambiguated from index names with ./ or ../ on Unix or .\\, ..\\, ./ or ../ on Windows.

    -

    May also be set with the UV_INDEX environment variable.

    --index-strategy index-strategy

    The strategy to use when resolving against multiple index URLs.

    -

    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-index). This prevents "dependency confusion" attacks, whereby an attacker can upload a malicious package under the same name to an alternate index.

    -

    May also be set with the UV_INDEX_STRATEGY environment variable.

    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
    • -
    --index-url, -i index-url

    (Deprecated: use --default-index instead) The URL of the Python package index (by default: https://pypi.org/simple).

    -

    Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

    -

    The index given by this flag is given lower priority than all other indexes specified via the --extra-index-url flag.

    -

    May also be set with the UV_INDEX_URL environment variable.

    --invert, --reverse

    Show the reverse dependencies for the given package. This flag will invert the tree and display the packages that depend on the given package

    -
    --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.

    -

    May also be set with the UV_KEYRING_PROVIDER environment variable.

    Possible values:

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

    The method to use when installing packages from the global cache.

    -

    This option is only used when building source distributions.

    -

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

    -

    WARNING: The use of symlink link mode is discouraged, as they create tight coupling between the cache and the target environment. For example, clearing the cache (uv cache clean) will break all installed packages by way of removing the underlying source files. Use symlinks with caution.

    -

    May also be set with the UV_LINK_MODE environment variable.

    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
    • -
    --locked

    Assert that the uv.lock will remain unchanged.

    -

    Requires that the lockfile is up-to-date. If the lockfile is missing or needs to be updated, uv will exit with an error.

    -

    May also be set with the UV_LOCKED environment variable.

    --managed-python

    Require use of uv-managed Python versions.

    -

    By default, uv prefers using Python versions it manages. However, it will use system Python versions if a uv-managed Python is not installed. This option disables use of system Python versions.

    -

    May also be set with the UV_MANAGED_PYTHON environment variable.

    --native-tls

    Whether to load TLS certificates from the platform's native certificate store.

    -

    By default, uv loads certificates from the bundled webpki-roots crate. The webpki-roots are a reliable set of trust roots from Mozilla, and including them in uv improves portability and performance (especially on macOS).

    -

    However, in some cases, you may want to use the platform's native certificate store, especially if you're relying on a corporate trust root (e.g., for a mandatory proxy) that's included in your system's certificate store.

    -

    May also be set with the UV_NATIVE_TLS environment variable.

    --no-binary

    Don't install pre-built wheels.

    -

    The given packages will be built and installed from source. The resolver will still use pre-built wheels to extract package metadata, if available.

    -

    May also be set with the UV_NO_BINARY environment variable.

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

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

    -

    May also be set with the UV_NO_BINARY_PACKAGE environment variable.

    --no-build

    Don't build source distributions.

    -

    When enabled, resolving will not run arbitrary Python code. The cached wheels of already-built source distributions will be reused, but operations that require building distributions will exit with an error.

    -

    May also be set with the UV_NO_BUILD environment variable.

    --no-build-isolation

    Disable isolation when building source distributions.

    -

    Assumes that build dependencies specified by PEP 518 are already installed.

    -

    May also be set with the UV_NO_BUILD_ISOLATION environment variable.

    --no-build-isolation-package no-build-isolation-package

    Disable isolation when building source distributions for a specific package.

    -

    Assumes that the packages' build dependencies specified by PEP 518 are already installed.

    -
    --no-build-package no-build-package

    Don't build source distributions for a specific package

    -

    May also be set with the UV_NO_BUILD_PACKAGE environment variable.

    --no-cache, --no-cache-dir, -n

    Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation

    -

    May also be set with the UV_NO_CACHE environment variable.

    --no-config

    Avoid discovering configuration files (pyproject.toml, uv.toml).

    -

    Normally, configuration files are discovered in the current directory, parent directories, or user configuration directories.

    -

    May also be set with the UV_NO_CONFIG environment variable.

    --no-dedupe

    Do not de-duplicate repeated dependencies. Usually, when a package has already displayed its dependencies, further occurrences will not re-display its dependencies, and will include a (*) to indicate it has already been shown. This flag will cause those duplicates to be repeated

    -
    --no-default-groups

    Ignore the default dependency groups.

    -

    uv includes the groups defined in tool.uv.default-groups by default. This disables that option, however, specific groups can still be included with --group.

    -

    May also be set with the UV_NO_DEFAULT_GROUPS environment variable.

    --no-dev

    Disable the development dependency group.

    -

    This option is an alias of --no-group dev. See --no-default-groups to disable all default groups instead.

    -

    May also be set with the UV_NO_DEV environment variable.

    --no-group no-group

    Disable the specified dependency group.

    -

    This option always takes precedence over default groups, --all-groups, and --group.

    -

    May be provided multiple times.

    -

    May also be set with the UV_NO_GROUP environment variable.

    --no-index

    Ignore the registry index (e.g., PyPI), instead relying on direct URL dependencies and those provided via --find-links

    -
    --no-managed-python

    Disable use of uv-managed Python versions.

    -

    Instead, uv will search for a suitable Python version on the system.

    -

    May also be set with the UV_NO_MANAGED_PYTHON environment variable.

    --no-progress

    Hide all progress outputs.

    -

    For example, spinners or progress bars.

    -

    May also be set with the UV_NO_PROGRESS environment variable.

    --no-python-downloads

    Disable automatic downloads of Python.

    -
    --no-sources

    Ignore the tool.uv.sources table when resolving dependencies. Used to lock against the standards-compliant, publishable package metadata, as opposed to using any workspace, Git, URL, or local path sources

    -

    May also be set with the UV_NO_SOURCES environment variable.

    --offline

    Disable network access.

    -

    When disabled, uv will only use locally cached data and locally available files.

    -

    May also be set with the UV_OFFLINE environment variable.

    --only-dev

    Only include the development dependency group.

    -

    The project and its dependencies will be omitted.

    -

    This option is an alias for --only-group dev. Implies --no-default-groups.

    -
    --only-group only-group

    Only include dependencies from the specified dependency group.

    -

    The project and its dependencies will be omitted.

    -

    May be provided multiple times. Implies --no-default-groups.

    -
    --outdated

    Show the latest available version of each package in the tree

    -
    --package package

    Display only the specified packages

    -
    --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).

    -

    May also be set with the UV_PRERELEASE environment variable.

    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
    • -
    --project project

    Discover a project in the given directory.

    -

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    -

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    -

    See --directory to change the working directory entirely.

    -

    This setting has no effect when used in the uv pip interface.

    -

    May also be set with the UV_PROJECT environment variable.

    --prune prune

    Prune the given package from the display of the dependency tree

    -
    --python, -p python

    The Python interpreter to use for locking and filtering.

    -

    By default, the tree is filtered to match the platform as reported by the Python -interpreter. Use --universal to display the tree for all platforms, or use ---python-version or --python-platform to override a subset of markers.

    -

    See uv python for details on Python discovery and supported request formats.

    -

    May also be set with the UV_PYTHON environment variable.

    --python-platform python-platform

    The platform to use when filtering the tree.

    -

    For example, pass --platform windows to display the dependencies that would be included when installing on Windows.

    -

    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 aarch64-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: A 64-bit x86 Windows target
    • -
    • aarch64-pc-windows-msvc: An ARM64 Windows target
    • -
    • i686-pc-windows-msvc: A 32-bit x86 Windows target
    • -
    • x86_64-unknown-linux-gnu: An x86 Linux target. Equivalent to x86_64-manylinux_2_28
    • -
    • aarch64-apple-darwin: An ARM-based macOS target, as seen on Apple Silicon devices
    • -
    • x86_64-apple-darwin: An x86 macOS target
    • -
    • aarch64-unknown-linux-gnu: An ARM64 Linux target. Equivalent to aarch64-manylinux_2_28
    • -
    • aarch64-unknown-linux-musl: An ARM64 Linux target
    • -
    • x86_64-unknown-linux-musl: An x86_64 Linux target
    • -
    • riscv64-unknown-linux: A RISCV64 Linux target
    • -
    • x86_64-manylinux2014: An x86_64 target for the manylinux2014 platform. Equivalent to x86_64-manylinux_2_17
    • -
    • x86_64-manylinux_2_17: An x86_64 target for the manylinux_2_17 platform
    • -
    • x86_64-manylinux_2_28: An x86_64 target for the manylinux_2_28 platform
    • -
    • x86_64-manylinux_2_31: An x86_64 target for the manylinux_2_31 platform
    • -
    • x86_64-manylinux_2_32: An x86_64 target for the manylinux_2_32 platform
    • -
    • x86_64-manylinux_2_33: An x86_64 target for the manylinux_2_33 platform
    • -
    • x86_64-manylinux_2_34: An x86_64 target for the manylinux_2_34 platform
    • -
    • x86_64-manylinux_2_35: An x86_64 target for the manylinux_2_35 platform
    • -
    • x86_64-manylinux_2_36: An x86_64 target for the manylinux_2_36 platform
    • -
    • x86_64-manylinux_2_37: An x86_64 target for the manylinux_2_37 platform
    • -
    • x86_64-manylinux_2_38: An x86_64 target for the manylinux_2_38 platform
    • -
    • x86_64-manylinux_2_39: An x86_64 target for the manylinux_2_39 platform
    • -
    • x86_64-manylinux_2_40: An x86_64 target for the manylinux_2_40 platform
    • -
    • aarch64-manylinux2014: An ARM64 target for the manylinux2014 platform. Equivalent to aarch64-manylinux_2_17
    • -
    • aarch64-manylinux_2_17: An ARM64 target for the manylinux_2_17 platform
    • -
    • aarch64-manylinux_2_28: An ARM64 target for the manylinux_2_28 platform
    • -
    • aarch64-manylinux_2_31: An ARM64 target for the manylinux_2_31 platform
    • -
    • aarch64-manylinux_2_32: An ARM64 target for the manylinux_2_32 platform
    • -
    • aarch64-manylinux_2_33: An ARM64 target for the manylinux_2_33 platform
    • -
    • aarch64-manylinux_2_34: An ARM64 target for the manylinux_2_34 platform
    • -
    • aarch64-manylinux_2_35: An ARM64 target for the manylinux_2_35 platform
    • -
    • aarch64-manylinux_2_36: An ARM64 target for the manylinux_2_36 platform
    • -
    • aarch64-manylinux_2_37: An ARM64 target for the manylinux_2_37 platform
    • -
    • aarch64-manylinux_2_38: An ARM64 target for the manylinux_2_38 platform
    • -
    • aarch64-manylinux_2_39: An ARM64 target for the manylinux_2_39 platform
    • -
    • aarch64-manylinux_2_40: An ARM64 target for the manylinux_2_40 platform
    • -
    • aarch64-linux-android: An ARM64 Android target
    • -
    • x86_64-linux-android: An x86_64 Android target
    • -
    • wasm32-pyodide2024: A wasm32 target using the Pyodide 2024 platform. Meant for use with Python 3.12
    • -
    • arm64-apple-ios: An ARM64 target for iOS device
    • -
    • arm64-apple-ios-simulator: An ARM64 target for iOS simulator
    • -
    • x86_64-apple-ios-simulator: An x86_64 target for iOS simulator
    • -
    --python-version python-version

    The Python version to use when filtering the tree.

    -

    For example, pass --python-version 3.10 to display the dependencies that would be included when installing on Python 3.10.

    -

    Defaults to the version of the discovered Python interpreter.

    -
    --quiet, -q

    Use quiet output.

    -

    Repeating this option, e.g., -qq, will enable a silent mode in which uv will write no output to stdout.

    -
    --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).

    -

    May also be set with the UV_RESOLUTION environment variable.

    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
    • -
    --script script

    Show the dependency tree the specified PEP 723 Python script, rather than the current project.

    -

    If provided, uv will resolve the dependencies based on its inline metadata table, in adherence with PEP 723.

    -
    --show-sizes

    Show compressed wheel sizes for packages in the tree

    -
    --universal

    Show a platform-independent dependency tree.

    -

    Shows resolved package versions for all Python versions and platforms, rather than filtering to those that are relevant for the current environment.

    -

    Multiple versions may be shown for a each package.

    -
    --upgrade, -U

    Allow package upgrades, ignoring pinned versions in any existing output file. Implies --refresh

    -
    --upgrade-package, -P upgrade-package

    Allow upgrades for a specific package, ignoring pinned versions in any existing output file. Implies --refresh-package

    -
    --verbose, -v

    Use verbose output.

    -

    You can configure fine-grained logging using the RUST_LOG environment variable. (https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#directives)

    -
    - -## uv format - -Format Python code in the project. - -Formats Python code using the Ruff formatter. By default, all Python files in the project are formatted. This command has the same behavior as running `ruff format` in the project root. - -To check if files are formatted without modifying them, use `--check`. To see a diff of formatting changes, use `--diff`. - -Additional arguments can be passed to Ruff after `--`. - -

    Usage

    - -``` -uv format [OPTIONS] [-- ...] -``` - -

    Arguments

    - -
    EXTRA_ARGS

    Additional arguments to pass to Ruff.

    -

    For example, use uv format -- --line-length 100 to set the line length or uv format -- src/module/foo.py to format a specific file.

    -
    - -

    Options

    - -
    --allow-insecure-host, --trusted-host allow-insecure-host

    Allow insecure connections to a host.

    -

    Can be provided multiple times.

    -

    Expects to receive either a hostname (e.g., localhost), a host-port pair (e.g., localhost:8080), or a URL (e.g., https://localhost).

    -

    WARNING: Hosts included in this list will not be verified against the system's certificate store. Only use --allow-insecure-host in a secure network with verified sources, as it bypasses SSL verification and could expose you to MITM attacks.

    -

    May also be set with the UV_INSECURE_HOST environment variable.

    --cache-dir cache-dir

    Path to the cache directory.

    -

    Defaults to $XDG_CACHE_HOME/uv or $HOME/.cache/uv on macOS and Linux, and %LOCALAPPDATA%\uv\cache on Windows.

    -

    To view the location of the cache directory, run uv cache dir.

    -

    May also be set with the UV_CACHE_DIR environment variable.

    --check

    Check if files are formatted without applying changes

    -
    --color color-choice

    Control the use of color in output.

    -

    By default, uv will automatically detect support for colors when writing to a terminal.

    -

    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.

    -

    While uv configuration can be included in a pyproject.toml file, it is not allowed in this context.

    -

    May also be set with the UV_CONFIG_FILE environment variable.

    --diff

    Show a diff of formatting changes without applying them.

    -

    Implies --check.

    -
    --directory directory

    Change to the given directory prior to running the command.

    -

    Relative paths are resolved with the given directory as the base.

    -

    See --project to only change the project root directory.

    -

    May also be set with the UV_WORKING_DIR environment variable.

    --help, -h

    Display the concise help for this command

    -
    --managed-python

    Require use of uv-managed Python versions.

    -

    By default, uv prefers using Python versions it manages. However, it will use system Python versions if a uv-managed Python is not installed. This option disables use of system Python versions.

    -

    May also be set with the UV_MANAGED_PYTHON environment variable.

    --native-tls

    Whether to load TLS certificates from the platform's native certificate store.

    -

    By default, uv loads certificates from the bundled webpki-roots crate. The webpki-roots are a reliable set of trust roots from Mozilla, and including them in uv improves portability and performance (especially on macOS).

    -

    However, in some cases, you may want to use the platform's native certificate store, especially if you're relying on a corporate trust root (e.g., for a mandatory proxy) that's included in your system's certificate store.

    -

    May also be set with the UV_NATIVE_TLS environment variable.

    --no-cache, --no-cache-dir, -n

    Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation

    -

    May also be set with the UV_NO_CACHE environment variable.

    --no-config

    Avoid discovering configuration files (pyproject.toml, uv.toml).

    -

    Normally, configuration files are discovered in the current directory, parent directories, or user configuration directories.

    -

    May also be set with the UV_NO_CONFIG environment variable.

    --no-managed-python

    Disable use of uv-managed Python versions.

    -

    Instead, uv will search for a suitable Python version on the system.

    -

    May also be set with the UV_NO_MANAGED_PYTHON environment variable.

    --no-progress

    Hide all progress outputs.

    -

    For example, spinners or progress bars.

    -

    May also be set with the UV_NO_PROGRESS environment variable.

    --no-project

    Avoid discovering a project or workspace.

    -

    Instead of running the formatter in the context of the current project, run it in the context of the current directory. This is useful when the current directory is not a project.

    -
    --no-python-downloads

    Disable automatic downloads of Python.

    -
    --offline

    Disable network access.

    -

    When disabled, uv will only use locally cached data and locally available files.

    -

    May also be set with the UV_OFFLINE environment variable.

    --project project

    Discover a project in the given directory.

    -

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    -

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    -

    See --directory to change the working directory entirely.

    -

    This setting has no effect when used in the uv pip interface.

    -

    May also be set with the UV_PROJECT environment variable.

    --quiet, -q

    Use quiet output.

    -

    Repeating this option, e.g., -qq, will enable a silent mode in which uv will write no output to stdout.

    -
    --verbose, -v

    Use verbose output.

    -

    You can configure fine-grained logging using the RUST_LOG environment variable. (https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#directives)

    -
    --version version

    The version of Ruff to use for formatting.

    -

    By default, a version of Ruff pinned by uv will be used.

    -
    - -## uv tool - -Run and install commands provided by Python packages - -

    Usage

    - -``` -uv tool [OPTIONS] -``` - -

    Commands

    - -
    uv tool run

    Run a command provided by a Python package

    -
    uv tool install

    Install commands provided by a Python package

    -
    uv tool upgrade

    Upgrade installed tools

    -
    uv tool list

    List installed tools

    -
    uv tool uninstall

    Uninstall a tool

    -
    uv tool update-shell

    Ensure that the tool executable directory is on the PATH

    -
    uv tool dir

    Show the path to the uv tools directory

    -
    - -### uv tool run - -Run a command provided by a Python package. - -By default, the package to install is assumed to match the command name. - -The name of the command can include an exact version in the format `@`, e.g., `uv tool run ruff@0.3.0`. If more complex version specification is desired or if the command is provided by a different package, use `--from`. - -`uvx` can be used to invoke Python, e.g., with `uvx python` or `uvx python@`. A Python interpreter will be started in an isolated virtual environment. - -If the tool was previously installed, i.e., via `uv tool install`, the installed version will be used unless a version is requested or the `--isolated` flag is used. - -`uvx` is provided as a convenient alias for `uv tool run`, their behavior is identical. - -If no command is provided, the installed tools are displayed. - -Packages are installed into an ephemeral virtual environment in the uv cache directory. - -

    Usage

    - -``` -uv tool run [OPTIONS] [COMMAND] -``` - -

    Options

    - -
    --allow-insecure-host, --trusted-host allow-insecure-host

    Allow insecure connections to a host.

    -

    Can be provided multiple times.

    -

    Expects to receive either a hostname (e.g., localhost), a host-port pair (e.g., localhost:8080), or a URL (e.g., https://localhost).

    -

    WARNING: Hosts included in this list will not be verified against the system's certificate store. Only use --allow-insecure-host in a secure network with verified sources, as it bypasses SSL verification and could expose you to MITM attacks.

    -

    May also be set with the UV_INSECURE_HOST environment variable.

    --build-constraints, --build-constraint, -b build-constraints

    Constrain build dependencies using the given requirements files when building source distributions.

    -

    Constraints files are requirements.txt-like files that only control the version of a requirement that's installed. However, including a package in a constraints file will not trigger the installation of that package.

    -

    May also be set with the UV_BUILD_CONSTRAINT environment variable.

    --cache-dir cache-dir

    Path to the cache directory.

    -

    Defaults to $XDG_CACHE_HOME/uv or $HOME/.cache/uv on macOS and Linux, and %LOCALAPPDATA%\uv\cache on Windows.

    -

    To view the location of the cache directory, run uv cache dir.

    -

    May also be set with the UV_CACHE_DIR environment variable.

    --color color-choice

    Control the use of color in output.

    -

    By default, uv will automatically detect support for colors when writing to a terminal.

    -

    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
    • -
    --compile-bytecode, --compile

    Compile Python files to bytecode after installation.

    -

    By default, uv does not compile Python (.py) files to bytecode (__pycache__/*.pyc); instead, compilation is performed lazily the first time a module is imported. For use-cases in which start time is critical, such as CLI applications and Docker containers, this option can be enabled to trade longer installation times for faster start times.

    -

    When enabled, uv will process the entire site-packages directory (including packages that are not being modified by the current operation) for consistency. Like pip, it will also ignore errors.

    -

    May also be set with the UV_COMPILE_BYTECODE environment variable.

    --config-file config-file

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

    -

    While uv configuration can be included in a pyproject.toml file, it is not allowed in this context.

    -

    May also be set with the UV_CONFIG_FILE environment variable.

    --config-setting, --config-settings, -C config-setting

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

    -
    --config-settings-package, --config-settings-package config-settings-package

    Settings to pass to the PEP 517 build backend for a specific package, specified as PACKAGE:KEY=VALUE pairs

    -
    --constraints, --constraint, -c constraints

    Constrain versions using the given requirements files.

    -

    Constraints files are requirements.txt-like files that only control the version of a requirement that's installed. However, including a package in a constraints file will not trigger the installation of that package.

    -

    This is equivalent to pip's --constraint option.

    -

    May also be set with the UV_CONSTRAINT environment variable.

    --default-index default-index

    The URL of the default package index (by default: https://pypi.org/simple).

    -

    Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

    -

    The index given by this flag is given lower priority than all other indexes specified via the --index flag.

    -

    May also be set with the UV_DEFAULT_INDEX environment variable.

    --directory directory

    Change to the given directory prior to running the command.

    -

    Relative paths are resolved with the given directory as the base.

    -

    See --project to only change the project root directory.

    -

    May also be set with the UV_WORKING_DIR environment variable.

    --env-file env-file

    Load environment variables from a .env file.

    -

    Can be provided multiple times, with subsequent files overriding values defined in previous files.

    -

    May also be set with the UV_ENV_FILE environment variable.

    --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 local dates in the same format (e.g., 2006-12-02) in your system's configured time zone.

    -

    May also be set with the UV_EXCLUDE_NEWER environment variable.

    --exclude-newer-package exclude-newer-package

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

    -

    Accepts package-date pairs in the format PACKAGE=DATE, where DATE is an RFC 3339 timestamp (e.g., 2006-12-02T02:07:43Z) or local date (e.g., 2006-12-02) in your system's configured time zone.

    -

    Can be provided multiple times for different packages.

    -
    --extra-index-url extra-index-url

    (Deprecated: use --index instead) Extra URLs of package indexes to use, in addition to --index-url.

    -

    Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

    -

    All indexes provided via this flag take priority over the index specified by --index-url (which defaults to PyPI). When multiple --extra-index-url flags are provided, earlier values take priority.

    -

    May also be set with the UV_EXTRA_INDEX_URL environment variable.

    Locations to search for candidate distributions, in addition to those found in the registry indexes.

    -

    If a path, the target must be a directory that contains packages as wheel files (.whl) or source distributions (e.g., .tar.gz or .zip) at the top level.

    -

    If a URL, the page must contain a flat list of links to package files adhering to the formats described above.

    -

    May also be set with the UV_FIND_LINKS environment variable.

    --fork-strategy fork-strategy

    The strategy to use when selecting multiple versions of a given package across Python versions and platforms.

    -

    By default, uv will optimize for selecting the latest version of each package for each supported Python version (requires-python), while minimizing the number of selected versions across platforms.

    -

    Under fewest, uv will minimize the number of selected versions for each package, preferring older versions that are compatible with a wider range of supported Python versions or platforms.

    -

    May also be set with the UV_FORK_STRATEGY environment variable.

    Possible values:

    -
      -
    • fewest: Optimize for selecting the fewest number of versions for each package. Older versions may be preferred if they are compatible with a wider range of supported Python versions or platforms
    • -
    • requires-python: Optimize for selecting latest supported version of each package, for each supported Python version
    • -
    --from from

    Use the given package to provide the command.

    -

    By default, the package name is assumed to match the command name.

    -
    --help, -h

    Display the concise help for this command

    -
    --index index

    The URLs to use when resolving dependencies, in addition to the default index.

    -

    Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

    -

    All indexes provided via this flag take priority over the index specified by --default-index (which defaults to PyPI). When multiple --index flags are provided, earlier values take priority.

    -

    Index names are not supported as values. Relative paths must be disambiguated from index names with ./ or ../ on Unix or .\\, ..\\, ./ or ../ on Windows.

    -

    May also be set with the UV_INDEX environment variable.

    --index-strategy index-strategy

    The strategy to use when resolving against multiple index URLs.

    -

    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-index). This prevents "dependency confusion" attacks, whereby an attacker can upload a malicious package under the same name to an alternate index.

    -

    May also be set with the UV_INDEX_STRATEGY environment variable.

    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
    • -
    --index-url, -i index-url

    (Deprecated: use --default-index instead) The URL of the Python package index (by default: https://pypi.org/simple).

    -

    Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

    -

    The index given by this flag is given lower priority than all other indexes specified via the --extra-index-url flag.

    -

    May also be set with the UV_INDEX_URL environment variable.

    --isolated

    Run the tool in an isolated virtual environment, ignoring any already-installed tools

    -

    May also be set with the UV_ISOLATED environment variable.

    --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.

    -

    May also be set with the UV_KEYRING_PROVIDER environment variable.

    Possible values:

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

    Whether to use Git LFS when adding a dependency from Git

    -

    May also be set with the UV_GIT_LFS environment variable.

    The method to use when installing packages from the global cache.

    -

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

    -

    WARNING: The use of symlink link mode is discouraged, as they create tight coupling between the cache and the target environment. For example, clearing the cache (uv cache clean) will break all installed packages by way of removing the underlying source files. Use symlinks with caution.

    -

    May also be set with the UV_LINK_MODE environment variable.

    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
    • -
    --managed-python

    Require use of uv-managed Python versions.

    -

    By default, uv prefers using Python versions it manages. However, it will use system Python versions if a uv-managed Python is not installed. This option disables use of system Python versions.

    -

    May also be set with the UV_MANAGED_PYTHON environment variable.

    --native-tls

    Whether to load TLS certificates from the platform's native certificate store.

    -

    By default, uv loads certificates from the bundled webpki-roots crate. The webpki-roots are a reliable set of trust roots from Mozilla, and including them in uv improves portability and performance (especially on macOS).

    -

    However, in some cases, you may want to use the platform's native certificate store, especially if you're relying on a corporate trust root (e.g., for a mandatory proxy) that's included in your system's certificate store.

    -

    May also be set with the UV_NATIVE_TLS environment variable.

    --no-binary

    Don't install pre-built wheels.

    -

    The given packages will be built and installed from source. The resolver will still use pre-built wheels to extract package metadata, if available.

    -

    May also be set with the UV_NO_BINARY environment variable.

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

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

    -

    May also be set with the UV_NO_BINARY_PACKAGE environment variable.

    --no-build

    Don't build source distributions.

    -

    When enabled, resolving will not run arbitrary Python code. The cached wheels of already-built source distributions will be reused, but operations that require building distributions will exit with an error.

    -

    May also be set with the UV_NO_BUILD environment variable.

    --no-build-isolation

    Disable isolation when building source distributions.

    -

    Assumes that build dependencies specified by PEP 518 are already installed.

    -

    May also be set with the UV_NO_BUILD_ISOLATION environment variable.

    --no-build-isolation-package no-build-isolation-package

    Disable isolation when building source distributions for a specific package.

    -

    Assumes that the packages' build dependencies specified by PEP 518 are already installed.

    -
    --no-build-package no-build-package

    Don't build source distributions for a specific package

    -

    May also be set with the UV_NO_BUILD_PACKAGE environment variable.

    --no-cache, --no-cache-dir, -n

    Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation

    -

    May also be set with the UV_NO_CACHE environment variable.

    --no-config

    Avoid discovering configuration files (pyproject.toml, uv.toml).

    -

    Normally, configuration files are discovered in the current directory, parent directories, or user configuration directories.

    -

    May also be set with the UV_NO_CONFIG environment variable.

    --no-env-file

    Avoid reading environment variables from a .env file

    -

    May also be set with the UV_NO_ENV_FILE environment variable.

    --no-index

    Ignore the registry index (e.g., PyPI), instead relying on direct URL dependencies and those provided via --find-links

    -
    --no-managed-python

    Disable use of uv-managed Python versions.

    -

    Instead, uv will search for a suitable Python version on the system.

    -

    May also be set with the UV_NO_MANAGED_PYTHON environment variable.

    --no-progress

    Hide all progress outputs.

    -

    For example, spinners or progress bars.

    -

    May also be set with the UV_NO_PROGRESS environment variable.

    --no-python-downloads

    Disable automatic downloads of Python.

    -
    --no-sources

    Ignore the tool.uv.sources table when resolving dependencies. Used to lock against the standards-compliant, publishable package metadata, as opposed to using any workspace, Git, URL, or local path sources

    -

    May also be set with the UV_NO_SOURCES environment variable.

    --offline

    Disable network access.

    -

    When disabled, uv will only use locally cached data and locally available files.

    -

    May also be set with the UV_OFFLINE environment variable.

    --overrides, --override overrides

    Override versions using the given requirements files.

    -

    Overrides files are requirements.txt-like files that force a specific version of a requirement to be installed, regardless of the requirements declared by any constituent package, and regardless of whether this would be considered an invalid resolution.

    -

    While constraints are additive, in that they're combined with the requirements of the constituent packages, overrides are absolute, in that they completely replace the requirements of the constituent packages.

    -

    May also be set with the UV_OVERRIDE environment variable.

    --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).

    -

    May also be set with the UV_PRERELEASE environment variable.

    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
    • -
    --project project

    Discover a project in the given directory.

    -

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    -

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    -

    See --directory to change the working directory entirely.

    -

    This setting has no effect when used in the uv pip interface.

    -

    May also be set with the UV_PROJECT environment variable.

    --python, -p python

    The Python interpreter to use to build the run environment.

    -

    See uv python for details on Python discovery and supported request formats.

    -

    May also be set with the UV_PYTHON environment variable.

    --python-platform python-platform

    The platform for which requirements should be installed.

    -

    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 aarch64-apple-darwin.

    -

    When targeting macOS (Darwin), the default minimum version is 13.0. Use MACOSX_DEPLOYMENT_TARGET to specify a different minimum version, e.g., 14.0.

    -

    When targeting iOS, the default minimum version is 13.0. Use IPHONEOS_DEPLOYMENT_TARGET to specify a different minimum version, e.g., 14.0.

    -

    When targeting Android, the default minimum Android API level is 24. Use ANDROID_API_LEVEL to specify a different minimum version, e.g., 26.

    -

    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: A 64-bit x86 Windows target
    • -
    • aarch64-pc-windows-msvc: An ARM64 Windows target
    • -
    • i686-pc-windows-msvc: A 32-bit x86 Windows target
    • -
    • x86_64-unknown-linux-gnu: An x86 Linux target. Equivalent to x86_64-manylinux_2_28
    • -
    • aarch64-apple-darwin: An ARM-based macOS target, as seen on Apple Silicon devices
    • -
    • x86_64-apple-darwin: An x86 macOS target
    • -
    • aarch64-unknown-linux-gnu: An ARM64 Linux target. Equivalent to aarch64-manylinux_2_28
    • -
    • aarch64-unknown-linux-musl: An ARM64 Linux target
    • -
    • x86_64-unknown-linux-musl: An x86_64 Linux target
    • -
    • riscv64-unknown-linux: A RISCV64 Linux target
    • -
    • x86_64-manylinux2014: An x86_64 target for the manylinux2014 platform. Equivalent to x86_64-manylinux_2_17
    • -
    • x86_64-manylinux_2_17: An x86_64 target for the manylinux_2_17 platform
    • -
    • x86_64-manylinux_2_28: An x86_64 target for the manylinux_2_28 platform
    • -
    • x86_64-manylinux_2_31: An x86_64 target for the manylinux_2_31 platform
    • -
    • x86_64-manylinux_2_32: An x86_64 target for the manylinux_2_32 platform
    • -
    • x86_64-manylinux_2_33: An x86_64 target for the manylinux_2_33 platform
    • -
    • x86_64-manylinux_2_34: An x86_64 target for the manylinux_2_34 platform
    • -
    • x86_64-manylinux_2_35: An x86_64 target for the manylinux_2_35 platform
    • -
    • x86_64-manylinux_2_36: An x86_64 target for the manylinux_2_36 platform
    • -
    • x86_64-manylinux_2_37: An x86_64 target for the manylinux_2_37 platform
    • -
    • x86_64-manylinux_2_38: An x86_64 target for the manylinux_2_38 platform
    • -
    • x86_64-manylinux_2_39: An x86_64 target for the manylinux_2_39 platform
    • -
    • x86_64-manylinux_2_40: An x86_64 target for the manylinux_2_40 platform
    • -
    • aarch64-manylinux2014: An ARM64 target for the manylinux2014 platform. Equivalent to aarch64-manylinux_2_17
    • -
    • aarch64-manylinux_2_17: An ARM64 target for the manylinux_2_17 platform
    • -
    • aarch64-manylinux_2_28: An ARM64 target for the manylinux_2_28 platform
    • -
    • aarch64-manylinux_2_31: An ARM64 target for the manylinux_2_31 platform
    • -
    • aarch64-manylinux_2_32: An ARM64 target for the manylinux_2_32 platform
    • -
    • aarch64-manylinux_2_33: An ARM64 target for the manylinux_2_33 platform
    • -
    • aarch64-manylinux_2_34: An ARM64 target for the manylinux_2_34 platform
    • -
    • aarch64-manylinux_2_35: An ARM64 target for the manylinux_2_35 platform
    • -
    • aarch64-manylinux_2_36: An ARM64 target for the manylinux_2_36 platform
    • -
    • aarch64-manylinux_2_37: An ARM64 target for the manylinux_2_37 platform
    • -
    • aarch64-manylinux_2_38: An ARM64 target for the manylinux_2_38 platform
    • -
    • aarch64-manylinux_2_39: An ARM64 target for the manylinux_2_39 platform
    • -
    • aarch64-manylinux_2_40: An ARM64 target for the manylinux_2_40 platform
    • -
    • aarch64-linux-android: An ARM64 Android target
    • -
    • x86_64-linux-android: An x86_64 Android target
    • -
    • wasm32-pyodide2024: A wasm32 target using the Pyodide 2024 platform. Meant for use with Python 3.12
    • -
    • arm64-apple-ios: An ARM64 target for iOS device
    • -
    • arm64-apple-ios-simulator: An ARM64 target for iOS simulator
    • -
    • x86_64-apple-ios-simulator: An x86_64 target for iOS simulator
    • -
    --quiet, -q

    Use quiet output.

    -

    Repeating this option, e.g., -qq, will enable a silent mode in which uv will write no output to stdout.

    -
    --refresh

    Refresh all cached data

    -
    --refresh-package refresh-package

    Refresh cached data for a specific package

    -
    --reinstall, --force-reinstall

    Reinstall all packages, regardless of whether they're already installed. Implies --refresh

    -
    --reinstall-package reinstall-package

    Reinstall a specific package, regardless of whether it's already installed. Implies --refresh-package

    -
    --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).

    -

    May also be set with the UV_RESOLUTION environment variable.

    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
    • -
    --upgrade, -U

    Allow package upgrades, ignoring pinned versions in any existing output file. Implies --refresh

    -
    --upgrade-package, -P upgrade-package

    Allow upgrades for a specific package, ignoring pinned versions in any existing output file. Implies --refresh-package

    -
    --verbose, -v

    Use verbose output.

    -

    You can configure fine-grained logging using the RUST_LOG environment variable. (https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#directives)

    -
    --with, -w with

    Run with the given packages installed

    -
    --with-editable with-editable

    Run with the given packages installed in editable mode

    -

    When used in a project, these dependencies will be layered on top of the uv tool's environment in a separate, ephemeral environment. These dependencies are allowed to conflict with those specified.

    -
    --with-requirements with-requirements

    Run with the packages listed in the given files.

    -

    The following formats are supported: requirements.txt, .py files with inline metadata, and pylock.toml.

    -
    - -### uv tool install - -Install commands provided by a Python package. - -Packages are installed into an isolated virtual environment in the uv tools directory. The executables are linked the tool executable directory, which is determined according to the XDG standard and can be retrieved with `uv tool dir --bin`. - -If the tool was previously installed, the existing tool will generally be replaced. - -

    Usage

    - -``` -uv tool install [OPTIONS] -``` - -

    Arguments

    - -
    PACKAGE

    The package to install commands from

    -
    - -

    Options

    - -
    --allow-insecure-host, --trusted-host allow-insecure-host

    Allow insecure connections to a host.

    -

    Can be provided multiple times.

    -

    Expects to receive either a hostname (e.g., localhost), a host-port pair (e.g., localhost:8080), or a URL (e.g., https://localhost).

    -

    WARNING: Hosts included in this list will not be verified against the system's certificate store. Only use --allow-insecure-host in a secure network with verified sources, as it bypasses SSL verification and could expose you to MITM attacks.

    -

    May also be set with the UV_INSECURE_HOST environment variable.

    --build-constraints, --build-constraint, -b build-constraints

    Constrain build dependencies using the given requirements files when building source distributions.

    -

    Constraints files are requirements.txt-like files that only control the version of a requirement that's installed. However, including a package in a constraints file will not trigger the installation of that package.

    -

    May also be set with the UV_BUILD_CONSTRAINT environment variable.

    --cache-dir cache-dir

    Path to the cache directory.

    -

    Defaults to $XDG_CACHE_HOME/uv or $HOME/.cache/uv on macOS and Linux, and %LOCALAPPDATA%\uv\cache on Windows.

    -

    To view the location of the cache directory, run uv cache dir.

    -

    May also be set with the UV_CACHE_DIR environment variable.

    --color color-choice

    Control the use of color in output.

    -

    By default, uv will automatically detect support for colors when writing to a terminal.

    -

    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
    • -
    --compile-bytecode, --compile

    Compile Python files to bytecode after installation.

    -

    By default, uv does not compile Python (.py) files to bytecode (__pycache__/*.pyc); instead, compilation is performed lazily the first time a module is imported. For use-cases in which start time is critical, such as CLI applications and Docker containers, this option can be enabled to trade longer installation times for faster start times.

    -

    When enabled, uv will process the entire site-packages directory (including packages that are not being modified by the current operation) for consistency. Like pip, it will also ignore errors.

    -

    May also be set with the UV_COMPILE_BYTECODE environment variable.

    --config-file config-file

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

    -

    While uv configuration can be included in a pyproject.toml file, it is not allowed in this context.

    -

    May also be set with the UV_CONFIG_FILE environment variable.

    --config-setting, --config-settings, -C config-setting

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

    -
    --config-settings-package, --config-settings-package config-settings-package

    Settings to pass to the PEP 517 build backend for a specific package, specified as PACKAGE:KEY=VALUE pairs

    -
    --constraints, --constraint, -c constraints

    Constrain versions using the given requirements files.

    -

    Constraints files are requirements.txt-like files that only control the version of a requirement that's installed. However, including a package in a constraints file will not trigger the installation of that package.

    -

    This is equivalent to pip's --constraint option.

    -

    May also be set with the UV_CONSTRAINT environment variable.

    --default-index default-index

    The URL of the default package index (by default: https://pypi.org/simple).

    -

    Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

    -

    The index given by this flag is given lower priority than all other indexes specified via the --index flag.

    -

    May also be set with the UV_DEFAULT_INDEX environment variable.

    --directory directory

    Change to the given directory prior to running the command.

    -

    Relative paths are resolved with the given directory as the base.

    -

    See --project to only change the project root directory.

    -

    May also be set with the UV_WORKING_DIR environment variable.

    --editable, -e

    Install the target package in editable mode, such that changes in the package's source directory are reflected without reinstallation

    -
    --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 local dates in the same format (e.g., 2006-12-02) in your system's configured time zone.

    -

    May also be set with the UV_EXCLUDE_NEWER environment variable.

    --exclude-newer-package exclude-newer-package

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

    -

    Accepts package-date pairs in the format PACKAGE=DATE, where DATE is an RFC 3339 timestamp (e.g., 2006-12-02T02:07:43Z) or local date (e.g., 2006-12-02) in your system's configured time zone.

    -

    Can be provided multiple times for different packages.

    -
    --excludes, --exclude excludes

    Exclude packages from resolution using the given requirements files.

    -

    Excludes files are requirements.txt-like files that specify packages to exclude from the resolution. When a package is excluded, it will be omitted from the dependency list entirely and its own dependencies will be ignored during the resolution phase. Excludes are unconditional in that requirement specifiers and markers are ignored; any package listed in the provided file will be omitted from all resolved environments.

    -

    May also be set with the UV_EXCLUDE environment variable.

    --extra-index-url extra-index-url

    (Deprecated: use --index instead) Extra URLs of package indexes to use, in addition to --index-url.

    -

    Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

    -

    All indexes provided via this flag take priority over the index specified by --index-url (which defaults to PyPI). When multiple --extra-index-url flags are provided, earlier values take priority.

    -

    May also be set with the UV_EXTRA_INDEX_URL environment variable.

    Locations to search for candidate distributions, in addition to those found in the registry indexes.

    -

    If a path, the target must be a directory that contains packages as wheel files (.whl) or source distributions (e.g., .tar.gz or .zip) at the top level.

    -

    If a URL, the page must contain a flat list of links to package files adhering to the formats described above.

    -

    May also be set with the UV_FIND_LINKS environment variable.

    --force

    Force installation of the tool.

    -

    Will replace any existing entry points with the same name in the executable directory.

    -
    --fork-strategy fork-strategy

    The strategy to use when selecting multiple versions of a given package across Python versions and platforms.

    -

    By default, uv will optimize for selecting the latest version of each package for each supported Python version (requires-python), while minimizing the number of selected versions across platforms.

    -

    Under fewest, uv will minimize the number of selected versions for each package, preferring older versions that are compatible with a wider range of supported Python versions or platforms.

    -

    May also be set with the UV_FORK_STRATEGY environment variable.

    Possible values:

    -
      -
    • fewest: Optimize for selecting the fewest number of versions for each package. Older versions may be preferred if they are compatible with a wider range of supported Python versions or platforms
    • -
    • requires-python: Optimize for selecting latest supported version of each package, for each supported Python version
    • -
    --help, -h

    Display the concise help for this command

    -
    --index index

    The URLs to use when resolving dependencies, in addition to the default index.

    -

    Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

    -

    All indexes provided via this flag take priority over the index specified by --default-index (which defaults to PyPI). When multiple --index flags are provided, earlier values take priority.

    -

    Index names are not supported as values. Relative paths must be disambiguated from index names with ./ or ../ on Unix or .\\, ..\\, ./ or ../ on Windows.

    -

    May also be set with the UV_INDEX environment variable.

    --index-strategy index-strategy

    The strategy to use when resolving against multiple index URLs.

    -

    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-index). This prevents "dependency confusion" attacks, whereby an attacker can upload a malicious package under the same name to an alternate index.

    -

    May also be set with the UV_INDEX_STRATEGY environment variable.

    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
    • -
    --index-url, -i index-url

    (Deprecated: use --default-index instead) The URL of the Python package index (by default: https://pypi.org/simple).

    -

    Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

    -

    The index given by this flag is given lower priority than all other indexes specified via the --extra-index-url flag.

    -

    May also be set with the UV_INDEX_URL environment variable.

    --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.

    -

    May also be set with the UV_KEYRING_PROVIDER environment variable.

    Possible values:

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

    Whether to use Git LFS when adding a dependency from Git

    -

    May also be set with the UV_GIT_LFS environment variable.

    The method to use when installing packages from the global cache.

    -

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

    -

    WARNING: The use of symlink link mode is discouraged, as they create tight coupling between the cache and the target environment. For example, clearing the cache (uv cache clean) will break all installed packages by way of removing the underlying source files. Use symlinks with caution.

    -

    May also be set with the UV_LINK_MODE environment variable.

    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
    • -
    --managed-python

    Require use of uv-managed Python versions.

    -

    By default, uv prefers using Python versions it manages. However, it will use system Python versions if a uv-managed Python is not installed. This option disables use of system Python versions.

    -

    May also be set with the UV_MANAGED_PYTHON environment variable.

    --native-tls

    Whether to load TLS certificates from the platform's native certificate store.

    -

    By default, uv loads certificates from the bundled webpki-roots crate. The webpki-roots are a reliable set of trust roots from Mozilla, and including them in uv improves portability and performance (especially on macOS).

    -

    However, in some cases, you may want to use the platform's native certificate store, especially if you're relying on a corporate trust root (e.g., for a mandatory proxy) that's included in your system's certificate store.

    -

    May also be set with the UV_NATIVE_TLS environment variable.

    --no-binary

    Don't install pre-built wheels.

    -

    The given packages will be built and installed from source. The resolver will still use pre-built wheels to extract package metadata, if available.

    -

    May also be set with the UV_NO_BINARY environment variable.

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

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

    -

    May also be set with the UV_NO_BINARY_PACKAGE environment variable.

    --no-build

    Don't build source distributions.

    -

    When enabled, resolving will not run arbitrary Python code. The cached wheels of already-built source distributions will be reused, but operations that require building distributions will exit with an error.

    -

    May also be set with the UV_NO_BUILD environment variable.

    --no-build-isolation

    Disable isolation when building source distributions.

    -

    Assumes that build dependencies specified by PEP 518 are already installed.

    -

    May also be set with the UV_NO_BUILD_ISOLATION environment variable.

    --no-build-isolation-package no-build-isolation-package

    Disable isolation when building source distributions for a specific package.

    -

    Assumes that the packages' build dependencies specified by PEP 518 are already installed.

    -
    --no-build-package no-build-package

    Don't build source distributions for a specific package

    -

    May also be set with the UV_NO_BUILD_PACKAGE environment variable.

    --no-cache, --no-cache-dir, -n

    Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation

    -

    May also be set with the UV_NO_CACHE environment variable.

    --no-config

    Avoid discovering configuration files (pyproject.toml, uv.toml).

    -

    Normally, configuration files are discovered in the current directory, parent directories, or user configuration directories.

    -

    May also be set with the UV_NO_CONFIG environment variable.

    --no-index

    Ignore the registry index (e.g., PyPI), instead relying on direct URL dependencies and those provided via --find-links

    -
    --no-managed-python

    Disable use of uv-managed Python versions.

    -

    Instead, uv will search for a suitable Python version on the system.

    -

    May also be set with the UV_NO_MANAGED_PYTHON environment variable.

    --no-progress

    Hide all progress outputs.

    -

    For example, spinners or progress bars.

    -

    May also be set with the UV_NO_PROGRESS environment variable.

    --no-python-downloads

    Disable automatic downloads of Python.

    -
    --no-sources

    Ignore the tool.uv.sources table when resolving dependencies. Used to lock against the standards-compliant, publishable package metadata, as opposed to using any workspace, Git, URL, or local path sources

    -

    May also be set with the UV_NO_SOURCES environment variable.

    --offline

    Disable network access.

    -

    When disabled, uv will only use locally cached data and locally available files.

    -

    May also be set with the UV_OFFLINE environment variable.

    --overrides, --override overrides

    Override versions using the given requirements files.

    -

    Overrides files are requirements.txt-like files that force a specific version of a requirement to be installed, regardless of the requirements declared by any constituent package, and regardless of whether this would be considered an invalid resolution.

    -

    While constraints are additive, in that they're combined with the requirements of the constituent packages, overrides are absolute, in that they completely replace the requirements of the constituent packages.

    -

    May also be set with the UV_OVERRIDE environment variable.

    --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).

    -

    May also be set with the UV_PRERELEASE environment variable.

    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
    • -
    --project project

    Discover a project in the given directory.

    -

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    -

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    -

    See --directory to change the working directory entirely.

    -

    This setting has no effect when used in the uv pip interface.

    -

    May also be set with the UV_PROJECT environment variable.

    --python, -p python

    The Python interpreter to use to build the tool environment.

    -

    See uv python for details on Python discovery and supported request formats.

    -

    May also be set with the UV_PYTHON environment variable.

    --python-platform python-platform

    The platform for which requirements should be installed.

    -

    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 aarch64-apple-darwin.

    -

    When targeting macOS (Darwin), the default minimum version is 13.0. Use MACOSX_DEPLOYMENT_TARGET to specify a different minimum version, e.g., 14.0.

    -

    When targeting iOS, the default minimum version is 13.0. Use IPHONEOS_DEPLOYMENT_TARGET to specify a different minimum version, e.g., 14.0.

    -

    When targeting Android, the default minimum Android API level is 24. Use ANDROID_API_LEVEL to specify a different minimum version, e.g., 26.

    -

    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: A 64-bit x86 Windows target
    • -
    • aarch64-pc-windows-msvc: An ARM64 Windows target
    • -
    • i686-pc-windows-msvc: A 32-bit x86 Windows target
    • -
    • x86_64-unknown-linux-gnu: An x86 Linux target. Equivalent to x86_64-manylinux_2_28
    • -
    • aarch64-apple-darwin: An ARM-based macOS target, as seen on Apple Silicon devices
    • -
    • x86_64-apple-darwin: An x86 macOS target
    • -
    • aarch64-unknown-linux-gnu: An ARM64 Linux target. Equivalent to aarch64-manylinux_2_28
    • -
    • aarch64-unknown-linux-musl: An ARM64 Linux target
    • -
    • x86_64-unknown-linux-musl: An x86_64 Linux target
    • -
    • riscv64-unknown-linux: A RISCV64 Linux target
    • -
    • x86_64-manylinux2014: An x86_64 target for the manylinux2014 platform. Equivalent to x86_64-manylinux_2_17
    • -
    • x86_64-manylinux_2_17: An x86_64 target for the manylinux_2_17 platform
    • -
    • x86_64-manylinux_2_28: An x86_64 target for the manylinux_2_28 platform
    • -
    • x86_64-manylinux_2_31: An x86_64 target for the manylinux_2_31 platform
    • -
    • x86_64-manylinux_2_32: An x86_64 target for the manylinux_2_32 platform
    • -
    • x86_64-manylinux_2_33: An x86_64 target for the manylinux_2_33 platform
    • -
    • x86_64-manylinux_2_34: An x86_64 target for the manylinux_2_34 platform
    • -
    • x86_64-manylinux_2_35: An x86_64 target for the manylinux_2_35 platform
    • -
    • x86_64-manylinux_2_36: An x86_64 target for the manylinux_2_36 platform
    • -
    • x86_64-manylinux_2_37: An x86_64 target for the manylinux_2_37 platform
    • -
    • x86_64-manylinux_2_38: An x86_64 target for the manylinux_2_38 platform
    • -
    • x86_64-manylinux_2_39: An x86_64 target for the manylinux_2_39 platform
    • -
    • x86_64-manylinux_2_40: An x86_64 target for the manylinux_2_40 platform
    • -
    • aarch64-manylinux2014: An ARM64 target for the manylinux2014 platform. Equivalent to aarch64-manylinux_2_17
    • -
    • aarch64-manylinux_2_17: An ARM64 target for the manylinux_2_17 platform
    • -
    • aarch64-manylinux_2_28: An ARM64 target for the manylinux_2_28 platform
    • -
    • aarch64-manylinux_2_31: An ARM64 target for the manylinux_2_31 platform
    • -
    • aarch64-manylinux_2_32: An ARM64 target for the manylinux_2_32 platform
    • -
    • aarch64-manylinux_2_33: An ARM64 target for the manylinux_2_33 platform
    • -
    • aarch64-manylinux_2_34: An ARM64 target for the manylinux_2_34 platform
    • -
    • aarch64-manylinux_2_35: An ARM64 target for the manylinux_2_35 platform
    • -
    • aarch64-manylinux_2_36: An ARM64 target for the manylinux_2_36 platform
    • -
    • aarch64-manylinux_2_37: An ARM64 target for the manylinux_2_37 platform
    • -
    • aarch64-manylinux_2_38: An ARM64 target for the manylinux_2_38 platform
    • -
    • aarch64-manylinux_2_39: An ARM64 target for the manylinux_2_39 platform
    • -
    • aarch64-manylinux_2_40: An ARM64 target for the manylinux_2_40 platform
    • -
    • aarch64-linux-android: An ARM64 Android target
    • -
    • x86_64-linux-android: An x86_64 Android target
    • -
    • wasm32-pyodide2024: A wasm32 target using the Pyodide 2024 platform. Meant for use with Python 3.12
    • -
    • arm64-apple-ios: An ARM64 target for iOS device
    • -
    • arm64-apple-ios-simulator: An ARM64 target for iOS simulator
    • -
    • x86_64-apple-ios-simulator: An x86_64 target for iOS simulator
    • -
    --quiet, -q

    Use quiet output.

    -

    Repeating this option, e.g., -qq, will enable a silent mode in which uv will write no output to stdout.

    -
    --refresh

    Refresh all cached data

    -
    --refresh-package refresh-package

    Refresh cached data for a specific package

    -
    --reinstall, --force-reinstall

    Reinstall all packages, regardless of whether they're already installed. Implies --refresh

    -
    --reinstall-package reinstall-package

    Reinstall a specific package, regardless of whether it's already installed. Implies --refresh-package

    -
    --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).

    -

    May also be set with the UV_RESOLUTION environment variable.

    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
    • -
    --upgrade, -U

    Allow package upgrades, ignoring pinned versions in any existing output file. Implies --refresh

    -
    --upgrade-package, -P upgrade-package

    Allow upgrades for a specific package, ignoring pinned versions in any existing output file. Implies --refresh-package

    -
    --verbose, -v

    Use verbose output.

    -

    You can configure fine-grained logging using the RUST_LOG environment variable. (https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#directives)

    -
    --with, -w with

    Include the following additional requirements

    -
    --with-editable with-editable

    Include the given packages in editable mode

    -
    --with-executables-from with-executables-from

    Install executables from the following packages

    -
    --with-requirements with-requirements

    Run with the packages listed in the given files.

    -

    The following formats are supported: requirements.txt, .py files with inline metadata, and pylock.toml.

    -
    - -### uv tool upgrade - -Upgrade installed tools. - -If a tool was installed with version constraints, they will be respected on upgrade — to upgrade a tool beyond the originally provided constraints, use `uv tool install` again. - -If a tool was installed with specific settings, they will be respected on upgraded. For example, if `--prereleases allow` was provided during installation, it will continue to be respected in upgrades. - -

    Usage

    - -``` -uv tool upgrade [OPTIONS] ... -``` - -

    Arguments

    - -
    NAME

    The name of the tool to upgrade, along with an optional version specifier

    -
    - -

    Options

    - -
    --all

    Upgrade all tools

    -
    --allow-insecure-host, --trusted-host allow-insecure-host

    Allow insecure connections to a host.

    -

    Can be provided multiple times.

    -

    Expects to receive either a hostname (e.g., localhost), a host-port pair (e.g., localhost:8080), or a URL (e.g., https://localhost).

    -

    WARNING: Hosts included in this list will not be verified against the system's certificate store. Only use --allow-insecure-host in a secure network with verified sources, as it bypasses SSL verification and could expose you to MITM attacks.

    -

    May also be set with the UV_INSECURE_HOST environment variable.

    --cache-dir cache-dir

    Path to the cache directory.

    -

    Defaults to $XDG_CACHE_HOME/uv or $HOME/.cache/uv on macOS and Linux, and %LOCALAPPDATA%\uv\cache on Windows.

    -

    To view the location of the cache directory, run uv cache dir.

    -

    May also be set with the UV_CACHE_DIR environment variable.

    --color color-choice

    Control the use of color in output.

    -

    By default, uv will automatically detect support for colors when writing to a terminal.

    -

    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
    • -
    --compile-bytecode, --compile

    Compile Python files to bytecode after installation.

    -

    By default, uv does not compile Python (.py) files to bytecode (__pycache__/*.pyc); instead, compilation is performed lazily the first time a module is imported. For use-cases in which start time is critical, such as CLI applications and Docker containers, this option can be enabled to trade longer installation times for faster start times.

    -

    When enabled, uv will process the entire site-packages directory (including packages that are not being modified by the current operation) for consistency. Like pip, it will also ignore errors.

    -

    May also be set with the UV_COMPILE_BYTECODE environment variable.

    --config-file config-file

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

    -

    While uv configuration can be included in a pyproject.toml file, it is not allowed in this context.

    -

    May also be set with the UV_CONFIG_FILE environment variable.

    --config-setting, --config-settings, -C config-setting

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

    -
    --config-setting-package, --config-settings-package config-setting-package

    Settings to pass to the PEP 517 build backend for a specific package, specified as PACKAGE:KEY=VALUE pairs

    -
    --default-index default-index

    The URL of the default package index (by default: https://pypi.org/simple).

    -

    Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

    -

    The index given by this flag is given lower priority than all other indexes specified via the --index flag.

    -

    May also be set with the UV_DEFAULT_INDEX environment variable.

    --directory directory

    Change to the given directory prior to running the command.

    -

    Relative paths are resolved with the given directory as the base.

    -

    See --project to only change the project root directory.

    -

    May also be set with the UV_WORKING_DIR environment variable.

    --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 local dates in the same format (e.g., 2006-12-02) in your system's configured time zone.

    -

    May also be set with the UV_EXCLUDE_NEWER environment variable.

    --exclude-newer-package exclude-newer-package

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

    -

    Accepts package-date pairs in the format PACKAGE=DATE, where DATE is an RFC 3339 timestamp (e.g., 2006-12-02T02:07:43Z) or local date (e.g., 2006-12-02) in your system's configured time zone.

    -

    Can be provided multiple times for different packages.

    -
    --extra-index-url extra-index-url

    (Deprecated: use --index instead) Extra URLs of package indexes to use, in addition to --index-url.

    -

    Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

    -

    All indexes provided via this flag take priority over the index specified by --index-url (which defaults to PyPI). When multiple --extra-index-url flags are provided, earlier values take priority.

    -

    May also be set with the UV_EXTRA_INDEX_URL environment variable.

    Locations to search for candidate distributions, in addition to those found in the registry indexes.

    -

    If a path, the target must be a directory that contains packages as wheel files (.whl) or source distributions (e.g., .tar.gz or .zip) at the top level.

    -

    If a URL, the page must contain a flat list of links to package files adhering to the formats described above.

    -

    May also be set with the UV_FIND_LINKS environment variable.

    --fork-strategy fork-strategy

    The strategy to use when selecting multiple versions of a given package across Python versions and platforms.

    -

    By default, uv will optimize for selecting the latest version of each package for each supported Python version (requires-python), while minimizing the number of selected versions across platforms.

    -

    Under fewest, uv will minimize the number of selected versions for each package, preferring older versions that are compatible with a wider range of supported Python versions or platforms.

    -

    May also be set with the UV_FORK_STRATEGY environment variable.

    Possible values:

    -
      -
    • fewest: Optimize for selecting the fewest number of versions for each package. Older versions may be preferred if they are compatible with a wider range of supported Python versions or platforms
    • -
    • requires-python: Optimize for selecting latest supported version of each package, for each supported Python version
    • -
    --help, -h

    Display the concise help for this command

    -
    --index index

    The URLs to use when resolving dependencies, in addition to the default index.

    -

    Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

    -

    All indexes provided via this flag take priority over the index specified by --default-index (which defaults to PyPI). When multiple --index flags are provided, earlier values take priority.

    -

    Index names are not supported as values. Relative paths must be disambiguated from index names with ./ or ../ on Unix or .\\, ..\\, ./ or ../ on Windows.

    -

    May also be set with the UV_INDEX environment variable.

    --index-strategy index-strategy

    The strategy to use when resolving against multiple index URLs.

    -

    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-index). This prevents "dependency confusion" attacks, whereby an attacker can upload a malicious package under the same name to an alternate index.

    -

    May also be set with the UV_INDEX_STRATEGY environment variable.

    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
    • -
    --index-url, -i index-url

    (Deprecated: use --default-index instead) The URL of the Python package index (by default: https://pypi.org/simple).

    -

    Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

    -

    The index given by this flag is given lower priority than all other indexes specified via the --extra-index-url flag.

    -

    May also be set with the UV_INDEX_URL environment variable.

    --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.

    -

    May also be set with the UV_KEYRING_PROVIDER environment variable.

    Possible values:

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

    The method to use when installing packages from the global cache.

    -

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

    -

    WARNING: The use of symlink link mode is discouraged, as they create tight coupling between the cache and the target environment. For example, clearing the cache (uv cache clean) will break all installed packages by way of removing the underlying source files. Use symlinks with caution.

    -

    May also be set with the UV_LINK_MODE environment variable.

    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
    • -
    --managed-python

    Require use of uv-managed Python versions.

    -

    By default, uv prefers using Python versions it manages. However, it will use system Python versions if a uv-managed Python is not installed. This option disables use of system Python versions.

    -

    May also be set with the UV_MANAGED_PYTHON environment variable.

    --native-tls

    Whether to load TLS certificates from the platform's native certificate store.

    -

    By default, uv loads certificates from the bundled webpki-roots crate. The webpki-roots are a reliable set of trust roots from Mozilla, and including them in uv improves portability and performance (especially on macOS).

    -

    However, in some cases, you may want to use the platform's native certificate store, especially if you're relying on a corporate trust root (e.g., for a mandatory proxy) that's included in your system's certificate store.

    -

    May also be set with the UV_NATIVE_TLS environment variable.

    --no-binary

    Don't install pre-built wheels.

    -

    The given packages will be built and installed from source. The resolver will still use pre-built wheels to extract package metadata, if available.

    -

    May also be set with the UV_NO_BINARY environment variable.

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

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

    -

    May also be set with the UV_NO_BINARY_PACKAGE environment variable.

    --no-build

    Don't build source distributions.

    -

    When enabled, resolving will not run arbitrary Python code. The cached wheels of already-built source distributions will be reused, but operations that require building distributions will exit with an error.

    -

    May also be set with the UV_NO_BUILD environment variable.

    --no-build-isolation

    Disable isolation when building source distributions.

    -

    Assumes that build dependencies specified by PEP 518 are already installed.

    -

    May also be set with the UV_NO_BUILD_ISOLATION environment variable.

    --no-build-isolation-package no-build-isolation-package

    Disable isolation when building source distributions for a specific package.

    -

    Assumes that the packages' build dependencies specified by PEP 518 are already installed.

    -
    --no-build-package no-build-package

    Don't build source distributions for a specific package

    -

    May also be set with the UV_NO_BUILD_PACKAGE environment variable.

    --no-cache, --no-cache-dir, -n

    Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation

    -

    May also be set with the UV_NO_CACHE environment variable.

    --no-config

    Avoid discovering configuration files (pyproject.toml, uv.toml).

    -

    Normally, configuration files are discovered in the current directory, parent directories, or user configuration directories.

    -

    May also be set with the UV_NO_CONFIG environment variable.

    --no-index

    Ignore the registry index (e.g., PyPI), instead relying on direct URL dependencies and those provided via --find-links

    -
    --no-managed-python

    Disable use of uv-managed Python versions.

    -

    Instead, uv will search for a suitable Python version on the system.

    -

    May also be set with the UV_NO_MANAGED_PYTHON environment variable.

    --no-progress

    Hide all progress outputs.

    -

    For example, spinners or progress bars.

    -

    May also be set with the UV_NO_PROGRESS environment variable.

    --no-python-downloads

    Disable automatic downloads of Python.

    -
    --no-sources

    Ignore the tool.uv.sources table when resolving dependencies. Used to lock against the standards-compliant, publishable package metadata, as opposed to using any workspace, Git, URL, or local path sources

    -

    May also be set with the UV_NO_SOURCES environment variable.

    --offline

    Disable network access.

    -

    When disabled, uv will only use locally cached data and locally available files.

    -

    May also be set with the UV_OFFLINE environment variable.

    --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).

    -

    May also be set with the UV_PRERELEASE environment variable.

    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
    • -
    --project project

    Discover a project in the given directory.

    -

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    -

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    -

    See --directory to change the working directory entirely.

    -

    This setting has no effect when used in the uv pip interface.

    -

    May also be set with the UV_PROJECT environment variable.

    --python, -p python

    Upgrade a tool, and specify it to use the given Python interpreter to build its environment. -Use with --all to apply to all tools.

    -

    See uv python for details on Python discovery and supported request formats.

    -

    May also be set with the UV_PYTHON environment variable.

    --python-platform python-platform

    The platform for which requirements should be installed.

    -

    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 aarch64-apple-darwin.

    -

    When targeting macOS (Darwin), the default minimum version is 13.0. Use MACOSX_DEPLOYMENT_TARGET to specify a different minimum version, e.g., 14.0.

    -

    When targeting iOS, the default minimum version is 13.0. Use IPHONEOS_DEPLOYMENT_TARGET to specify a different minimum version, e.g., 14.0.

    -

    When targeting Android, the default minimum Android API level is 24. Use ANDROID_API_LEVEL to specify a different minimum version, e.g., 26.

    -

    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: A 64-bit x86 Windows target
    • -
    • aarch64-pc-windows-msvc: An ARM64 Windows target
    • -
    • i686-pc-windows-msvc: A 32-bit x86 Windows target
    • -
    • x86_64-unknown-linux-gnu: An x86 Linux target. Equivalent to x86_64-manylinux_2_28
    • -
    • aarch64-apple-darwin: An ARM-based macOS target, as seen on Apple Silicon devices
    • -
    • x86_64-apple-darwin: An x86 macOS target
    • -
    • aarch64-unknown-linux-gnu: An ARM64 Linux target. Equivalent to aarch64-manylinux_2_28
    • -
    • aarch64-unknown-linux-musl: An ARM64 Linux target
    • -
    • x86_64-unknown-linux-musl: An x86_64 Linux target
    • -
    • riscv64-unknown-linux: A RISCV64 Linux target
    • -
    • x86_64-manylinux2014: An x86_64 target for the manylinux2014 platform. Equivalent to x86_64-manylinux_2_17
    • -
    • x86_64-manylinux_2_17: An x86_64 target for the manylinux_2_17 platform
    • -
    • x86_64-manylinux_2_28: An x86_64 target for the manylinux_2_28 platform
    • -
    • x86_64-manylinux_2_31: An x86_64 target for the manylinux_2_31 platform
    • -
    • x86_64-manylinux_2_32: An x86_64 target for the manylinux_2_32 platform
    • -
    • x86_64-manylinux_2_33: An x86_64 target for the manylinux_2_33 platform
    • -
    • x86_64-manylinux_2_34: An x86_64 target for the manylinux_2_34 platform
    • -
    • x86_64-manylinux_2_35: An x86_64 target for the manylinux_2_35 platform
    • -
    • x86_64-manylinux_2_36: An x86_64 target for the manylinux_2_36 platform
    • -
    • x86_64-manylinux_2_37: An x86_64 target for the manylinux_2_37 platform
    • -
    • x86_64-manylinux_2_38: An x86_64 target for the manylinux_2_38 platform
    • -
    • x86_64-manylinux_2_39: An x86_64 target for the manylinux_2_39 platform
    • -
    • x86_64-manylinux_2_40: An x86_64 target for the manylinux_2_40 platform
    • -
    • aarch64-manylinux2014: An ARM64 target for the manylinux2014 platform. Equivalent to aarch64-manylinux_2_17
    • -
    • aarch64-manylinux_2_17: An ARM64 target for the manylinux_2_17 platform
    • -
    • aarch64-manylinux_2_28: An ARM64 target for the manylinux_2_28 platform
    • -
    • aarch64-manylinux_2_31: An ARM64 target for the manylinux_2_31 platform
    • -
    • aarch64-manylinux_2_32: An ARM64 target for the manylinux_2_32 platform
    • -
    • aarch64-manylinux_2_33: An ARM64 target for the manylinux_2_33 platform
    • -
    • aarch64-manylinux_2_34: An ARM64 target for the manylinux_2_34 platform
    • -
    • aarch64-manylinux_2_35: An ARM64 target for the manylinux_2_35 platform
    • -
    • aarch64-manylinux_2_36: An ARM64 target for the manylinux_2_36 platform
    • -
    • aarch64-manylinux_2_37: An ARM64 target for the manylinux_2_37 platform
    • -
    • aarch64-manylinux_2_38: An ARM64 target for the manylinux_2_38 platform
    • -
    • aarch64-manylinux_2_39: An ARM64 target for the manylinux_2_39 platform
    • -
    • aarch64-manylinux_2_40: An ARM64 target for the manylinux_2_40 platform
    • -
    • aarch64-linux-android: An ARM64 Android target
    • -
    • x86_64-linux-android: An x86_64 Android target
    • -
    • wasm32-pyodide2024: A wasm32 target using the Pyodide 2024 platform. Meant for use with Python 3.12
    • -
    • arm64-apple-ios: An ARM64 target for iOS device
    • -
    • arm64-apple-ios-simulator: An ARM64 target for iOS simulator
    • -
    • x86_64-apple-ios-simulator: An x86_64 target for iOS simulator
    • -
    --quiet, -q

    Use quiet output.

    -

    Repeating this option, e.g., -qq, will enable a silent mode in which uv will write no output to stdout.

    -
    --reinstall, --force-reinstall

    Reinstall all packages, regardless of whether they're already installed. Implies --refresh

    -
    --reinstall-package reinstall-package

    Reinstall a specific package, regardless of whether it's already installed. Implies --refresh-package

    -
    --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).

    -

    May also be set with the UV_RESOLUTION environment variable.

    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
    • -
    --verbose, -v

    Use verbose output.

    -

    You can configure fine-grained logging using the RUST_LOG environment variable. (https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#directives)

    -
    - -### uv tool list - -List installed tools - -

    Usage

    - -``` -uv tool list [OPTIONS] -``` - -

    Options

    - -
    --allow-insecure-host, --trusted-host allow-insecure-host

    Allow insecure connections to a host.

    -

    Can be provided multiple times.

    -

    Expects to receive either a hostname (e.g., localhost), a host-port pair (e.g., localhost:8080), or a URL (e.g., https://localhost).

    -

    WARNING: Hosts included in this list will not be verified against the system's certificate store. Only use --allow-insecure-host in a secure network with verified sources, as it bypasses SSL verification and could expose you to MITM attacks.

    -

    May also be set with the UV_INSECURE_HOST environment variable.

    --cache-dir cache-dir

    Path to the cache directory.

    -

    Defaults to $XDG_CACHE_HOME/uv or $HOME/.cache/uv on macOS and Linux, and %LOCALAPPDATA%\uv\cache on Windows.

    -

    To view the location of the cache directory, run uv cache dir.

    -

    May also be set with the UV_CACHE_DIR environment variable.

    --color color-choice

    Control the use of color in output.

    -

    By default, uv will automatically detect support for colors when writing to a terminal.

    -

    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.

    -

    While uv configuration can be included in a pyproject.toml file, it is not allowed in this context.

    -

    May also be set with the UV_CONFIG_FILE environment variable.

    --directory directory

    Change to the given directory prior to running the command.

    -

    Relative paths are resolved with the given directory as the base.

    -

    See --project to only change the project root directory.

    -

    May also be set with the UV_WORKING_DIR environment variable.

    --help, -h

    Display the concise help for this command

    -
    --managed-python

    Require use of uv-managed Python versions.

    -

    By default, uv prefers using Python versions it manages. However, it will use system Python versions if a uv-managed Python is not installed. This option disables use of system Python versions.

    -

    May also be set with the UV_MANAGED_PYTHON environment variable.

    --native-tls

    Whether to load TLS certificates from the platform's native certificate store.

    -

    By default, uv loads certificates from the bundled webpki-roots crate. The webpki-roots are a reliable set of trust roots from Mozilla, and including them in uv improves portability and performance (especially on macOS).

    -

    However, in some cases, you may want to use the platform's native certificate store, especially if you're relying on a corporate trust root (e.g., for a mandatory proxy) that's included in your system's certificate store.

    -

    May also be set with the UV_NATIVE_TLS environment variable.

    --no-cache, --no-cache-dir, -n

    Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation

    -

    May also be set with the UV_NO_CACHE environment variable.

    --no-config

    Avoid discovering configuration files (pyproject.toml, uv.toml).

    -

    Normally, configuration files are discovered in the current directory, parent directories, or user configuration directories.

    -

    May also be set with the UV_NO_CONFIG environment variable.

    --no-managed-python

    Disable use of uv-managed Python versions.

    -

    Instead, uv will search for a suitable Python version on the system.

    -

    May also be set with the UV_NO_MANAGED_PYTHON environment variable.

    --no-progress

    Hide all progress outputs.

    -

    For example, spinners or progress bars.

    -

    May also be set with the UV_NO_PROGRESS environment variable.

    --offline

    Disable network access.

    -

    When disabled, uv will only use locally cached data and locally available files.

    -

    May also be set with the UV_OFFLINE environment variable.

    --project project

    Discover a project in the given directory.

    -

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    -

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    -

    See --directory to change the working directory entirely.

    -

    This setting has no effect when used in the uv pip interface.

    -

    May also be set with the UV_PROJECT environment variable.

    --quiet, -q

    Use quiet output.

    -

    Repeating this option, e.g., -qq, will enable a silent mode in which uv will write no output to stdout.

    -
    --show-extras

    Whether to display the extra requirements installed with each tool

    -
    --show-paths

    Whether to display the path to each tool environment and installed executable

    -
    --show-python

    Whether to display the Python version associated with each tool

    -
    --show-version-specifiers

    Whether to display the version specifier(s) used to install each tool

    -
    --show-with

    Whether to display the additional requirements installed with each tool

    -
    --verbose, -v

    Use verbose output.

    -

    You can configure fine-grained logging using the RUST_LOG environment variable. (https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#directives)

    -
    - -### uv tool uninstall - -Uninstall a tool - -

    Usage

    - -``` -uv tool uninstall [OPTIONS] ... -``` - -

    Arguments

    - -
    NAME

    The name of the tool to uninstall

    -
    - -

    Options

    - -
    --all

    Uninstall all tools

    -
    --allow-insecure-host, --trusted-host allow-insecure-host

    Allow insecure connections to a host.

    -

    Can be provided multiple times.

    -

    Expects to receive either a hostname (e.g., localhost), a host-port pair (e.g., localhost:8080), or a URL (e.g., https://localhost).

    -

    WARNING: Hosts included in this list will not be verified against the system's certificate store. Only use --allow-insecure-host in a secure network with verified sources, as it bypasses SSL verification and could expose you to MITM attacks.

    -

    May also be set with the UV_INSECURE_HOST environment variable.

    --cache-dir cache-dir

    Path to the cache directory.

    -

    Defaults to $XDG_CACHE_HOME/uv or $HOME/.cache/uv on macOS and Linux, and %LOCALAPPDATA%\uv\cache on Windows.

    -

    To view the location of the cache directory, run uv cache dir.

    -

    May also be set with the UV_CACHE_DIR environment variable.

    --color color-choice

    Control the use of color in output.

    -

    By default, uv will automatically detect support for colors when writing to a terminal.

    -

    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.

    -

    While uv configuration can be included in a pyproject.toml file, it is not allowed in this context.

    -

    May also be set with the UV_CONFIG_FILE environment variable.

    --directory directory

    Change to the given directory prior to running the command.

    -

    Relative paths are resolved with the given directory as the base.

    -

    See --project to only change the project root directory.

    -

    May also be set with the UV_WORKING_DIR environment variable.

    --help, -h

    Display the concise help for this command

    -
    --managed-python

    Require use of uv-managed Python versions.

    -

    By default, uv prefers using Python versions it manages. However, it will use system Python versions if a uv-managed Python is not installed. This option disables use of system Python versions.

    -

    May also be set with the UV_MANAGED_PYTHON environment variable.

    --native-tls

    Whether to load TLS certificates from the platform's native certificate store.

    -

    By default, uv loads certificates from the bundled webpki-roots crate. The webpki-roots are a reliable set of trust roots from Mozilla, and including them in uv improves portability and performance (especially on macOS).

    -

    However, in some cases, you may want to use the platform's native certificate store, especially if you're relying on a corporate trust root (e.g., for a mandatory proxy) that's included in your system's certificate store.

    -

    May also be set with the UV_NATIVE_TLS environment variable.

    --no-cache, --no-cache-dir, -n

    Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation

    -

    May also be set with the UV_NO_CACHE environment variable.

    --no-config

    Avoid discovering configuration files (pyproject.toml, uv.toml).

    -

    Normally, configuration files are discovered in the current directory, parent directories, or user configuration directories.

    -

    May also be set with the UV_NO_CONFIG environment variable.

    --no-managed-python

    Disable use of uv-managed Python versions.

    -

    Instead, uv will search for a suitable Python version on the system.

    -

    May also be set with the UV_NO_MANAGED_PYTHON environment variable.

    --no-progress

    Hide all progress outputs.

    -

    For example, spinners or progress bars.

    -

    May also be set with the UV_NO_PROGRESS environment variable.

    --no-python-downloads

    Disable automatic downloads of Python.

    -
    --offline

    Disable network access.

    -

    When disabled, uv will only use locally cached data and locally available files.

    -

    May also be set with the UV_OFFLINE environment variable.

    --project project

    Discover a project in the given directory.

    -

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    -

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    -

    See --directory to change the working directory entirely.

    -

    This setting has no effect when used in the uv pip interface.

    -

    May also be set with the UV_PROJECT environment variable.

    --quiet, -q

    Use quiet output.

    -

    Repeating this option, e.g., -qq, will enable a silent mode in which uv will write no output to stdout.

    -
    --verbose, -v

    Use verbose output.

    -

    You can configure fine-grained logging using the RUST_LOG environment variable. (https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#directives)

    -
    - -### uv tool update-shell - -Ensure that the tool executable directory is on the `PATH`. - -If the tool executable directory is not present on the `PATH`, uv will attempt to add it to the relevant shell configuration files. - -If the shell configuration files already include a blurb to add the executable directory to the path, but the directory is not present on the `PATH`, uv will exit with an error. - -The tool executable directory is determined according to the XDG standard and can be retrieved with `uv tool dir --bin`. - -

    Usage

    - -``` -uv tool update-shell [OPTIONS] -``` - -

    Options

    - -
    --allow-insecure-host, --trusted-host allow-insecure-host

    Allow insecure connections to a host.

    -

    Can be provided multiple times.

    -

    Expects to receive either a hostname (e.g., localhost), a host-port pair (e.g., localhost:8080), or a URL (e.g., https://localhost).

    -

    WARNING: Hosts included in this list will not be verified against the system's certificate store. Only use --allow-insecure-host in a secure network with verified sources, as it bypasses SSL verification and could expose you to MITM attacks.

    -

    May also be set with the UV_INSECURE_HOST environment variable.

    --cache-dir cache-dir

    Path to the cache directory.

    -

    Defaults to $XDG_CACHE_HOME/uv or $HOME/.cache/uv on macOS and Linux, and %LOCALAPPDATA%\uv\cache on Windows.

    -

    To view the location of the cache directory, run uv cache dir.

    -

    May also be set with the UV_CACHE_DIR environment variable.

    --color color-choice

    Control the use of color in output.

    -

    By default, uv will automatically detect support for colors when writing to a terminal.

    -

    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.

    -

    While uv configuration can be included in a pyproject.toml file, it is not allowed in this context.

    -

    May also be set with the UV_CONFIG_FILE environment variable.

    --directory directory

    Change to the given directory prior to running the command.

    -

    Relative paths are resolved with the given directory as the base.

    -

    See --project to only change the project root directory.

    -

    May also be set with the UV_WORKING_DIR environment variable.

    --help, -h

    Display the concise help for this command

    -
    --managed-python

    Require use of uv-managed Python versions.

    -

    By default, uv prefers using Python versions it manages. However, it will use system Python versions if a uv-managed Python is not installed. This option disables use of system Python versions.

    -

    May also be set with the UV_MANAGED_PYTHON environment variable.

    --native-tls

    Whether to load TLS certificates from the platform's native certificate store.

    -

    By default, uv loads certificates from the bundled webpki-roots crate. The webpki-roots are a reliable set of trust roots from Mozilla, and including them in uv improves portability and performance (especially on macOS).

    -

    However, in some cases, you may want to use the platform's native certificate store, especially if you're relying on a corporate trust root (e.g., for a mandatory proxy) that's included in your system's certificate store.

    -

    May also be set with the UV_NATIVE_TLS environment variable.

    --no-cache, --no-cache-dir, -n

    Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation

    -

    May also be set with the UV_NO_CACHE environment variable.

    --no-config

    Avoid discovering configuration files (pyproject.toml, uv.toml).

    -

    Normally, configuration files are discovered in the current directory, parent directories, or user configuration directories.

    -

    May also be set with the UV_NO_CONFIG environment variable.

    --no-managed-python

    Disable use of uv-managed Python versions.

    -

    Instead, uv will search for a suitable Python version on the system.

    -

    May also be set with the UV_NO_MANAGED_PYTHON environment variable.

    --no-progress

    Hide all progress outputs.

    -

    For example, spinners or progress bars.

    -

    May also be set with the UV_NO_PROGRESS environment variable.

    --no-python-downloads

    Disable automatic downloads of Python.

    -
    --offline

    Disable network access.

    -

    When disabled, uv will only use locally cached data and locally available files.

    -

    May also be set with the UV_OFFLINE environment variable.

    --project project

    Discover a project in the given directory.

    -

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    -

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    -

    See --directory to change the working directory entirely.

    -

    This setting has no effect when used in the uv pip interface.

    -

    May also be set with the UV_PROJECT environment variable.

    --quiet, -q

    Use quiet output.

    -

    Repeating this option, e.g., -qq, will enable a silent mode in which uv will write no output to stdout.

    -
    --verbose, -v

    Use verbose output.

    -

    You can configure fine-grained logging using the RUST_LOG environment variable. (https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#directives)

    -
    - -### uv tool dir - -Show the path to the uv tools directory. - -The tools directory is used to store environments and metadata for installed tools. - -By default, tools are stored in the uv data directory at `$XDG_DATA_HOME/uv/tools` or `$HOME/.local/share/uv/tools` on Unix and `%APPDATA%\uv\data\tools` on Windows. - -The tool installation directory may be overridden with `$UV_TOOL_DIR`. - -To instead view the directory uv installs executables into, use the `--bin` flag. - -

    Usage

    - -``` -uv tool dir [OPTIONS] -``` - -

    Options

    - -
    --allow-insecure-host, --trusted-host allow-insecure-host

    Allow insecure connections to a host.

    -

    Can be provided multiple times.

    -

    Expects to receive either a hostname (e.g., localhost), a host-port pair (e.g., localhost:8080), or a URL (e.g., https://localhost).

    -

    WARNING: Hosts included in this list will not be verified against the system's certificate store. Only use --allow-insecure-host in a secure network with verified sources, as it bypasses SSL verification and could expose you to MITM attacks.

    -

    May also be set with the UV_INSECURE_HOST environment variable.

    --bin

    Show the directory into which uv tool will install executables.

    -

    By default, uv tool dir shows the directory into which the tool Python environments -themselves are installed, rather than the directory containing the linked executables.

    -

    The tool executable directory is determined according to the XDG standard and is derived -from the following environment variables, in order of preference:

    -
      -
    • $UV_TOOL_BIN_DIR
    • -
    • $XDG_BIN_HOME
    • -
    • $XDG_DATA_HOME/../bin
    • -
    • $HOME/.local/bin
    • -
    -
    --cache-dir cache-dir

    Path to the cache directory.

    -

    Defaults to $XDG_CACHE_HOME/uv or $HOME/.cache/uv on macOS and Linux, and %LOCALAPPDATA%\uv\cache on Windows.

    -

    To view the location of the cache directory, run uv cache dir.

    -

    May also be set with the UV_CACHE_DIR environment variable.

    --color color-choice

    Control the use of color in output.

    -

    By default, uv will automatically detect support for colors when writing to a terminal.

    -

    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.

    -

    While uv configuration can be included in a pyproject.toml file, it is not allowed in this context.

    -

    May also be set with the UV_CONFIG_FILE environment variable.

    --directory directory

    Change to the given directory prior to running the command.

    -

    Relative paths are resolved with the given directory as the base.

    -

    See --project to only change the project root directory.

    -

    May also be set with the UV_WORKING_DIR environment variable.

    --help, -h

    Display the concise help for this command

    -
    --managed-python

    Require use of uv-managed Python versions.

    -

    By default, uv prefers using Python versions it manages. However, it will use system Python versions if a uv-managed Python is not installed. This option disables use of system Python versions.

    -

    May also be set with the UV_MANAGED_PYTHON environment variable.

    --native-tls

    Whether to load TLS certificates from the platform's native certificate store.

    -

    By default, uv loads certificates from the bundled webpki-roots crate. The webpki-roots are a reliable set of trust roots from Mozilla, and including them in uv improves portability and performance (especially on macOS).

    -

    However, in some cases, you may want to use the platform's native certificate store, especially if you're relying on a corporate trust root (e.g., for a mandatory proxy) that's included in your system's certificate store.

    -

    May also be set with the UV_NATIVE_TLS environment variable.

    --no-cache, --no-cache-dir, -n

    Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation

    -

    May also be set with the UV_NO_CACHE environment variable.

    --no-config

    Avoid discovering configuration files (pyproject.toml, uv.toml).

    -

    Normally, configuration files are discovered in the current directory, parent directories, or user configuration directories.

    -

    May also be set with the UV_NO_CONFIG environment variable.

    --no-managed-python

    Disable use of uv-managed Python versions.

    -

    Instead, uv will search for a suitable Python version on the system.

    -

    May also be set with the UV_NO_MANAGED_PYTHON environment variable.

    --no-progress

    Hide all progress outputs.

    -

    For example, spinners or progress bars.

    -

    May also be set with the UV_NO_PROGRESS environment variable.

    --no-python-downloads

    Disable automatic downloads of Python.

    -
    --offline

    Disable network access.

    -

    When disabled, uv will only use locally cached data and locally available files.

    -

    May also be set with the UV_OFFLINE environment variable.

    --project project

    Discover a project in the given directory.

    -

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    -

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    -

    See --directory to change the working directory entirely.

    -

    This setting has no effect when used in the uv pip interface.

    -

    May also be set with the UV_PROJECT environment variable.

    --quiet, -q

    Use quiet output.

    -

    Repeating this option, e.g., -qq, will enable a silent mode in which uv will write no output to stdout.

    -
    --verbose, -v

    Use verbose output.

    -

    You can configure fine-grained logging using the RUST_LOG environment variable. (https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#directives)

    -
    - -## uv python - -Manage Python versions and installations - -Generally, uv first searches for Python in a virtual environment, either active or in a -`.venv` directory in the current working directory or any parent directory. If a virtual -environment is not required, uv will then search for a Python interpreter. Python -interpreters are found by searching for Python executables in the `PATH` environment -variable. - -On Windows, the registry is also searched for Python executables. - -By default, uv will download Python if a version cannot be found. This behavior can be -disabled with the `--no-python-downloads` flag or the `python-downloads` setting. - -The `--python` option allows requesting a different interpreter. - -The following Python version request formats are supported: - -- `` e.g. `3`, `3.12`, `3.12.3` -- `` e.g. `>=3.12,<3.13` -- `` (e.g., `3.13t`, `3.12.0d`) -- `+` (e.g., `3.13+freethreaded`, `3.12.0+debug`) -- `` e.g. `cpython` or `cp` -- `@` e.g. `cpython@3.12` -- `` e.g. `cpython3.12` or `cp312` -- `` e.g. `cpython>=3.12,<3.13` -- `----` e.g. `cpython-3.12.3-macos-aarch64-none` - -Additionally, a specific system Python interpreter can often be requested with: - -- `` e.g. `/opt/homebrew/bin/python3` -- `` e.g. `mypython3` -- `` e.g. `/some/environment/` - -When the `--python` option is used, normal discovery rules apply but discovered interpreters -are checked for compatibility with the request, e.g., if `pypy` is requested, uv will first -check if the virtual environment contains a PyPy interpreter then check if each executable -in the path is a PyPy interpreter. - -uv supports discovering CPython, PyPy, and GraalPy interpreters. Unsupported interpreters -will be skipped during discovery. If an unsupported interpreter implementation is requested, -uv will exit with an error. - -

    Usage

    - -``` -uv python [OPTIONS] -``` - -

    Commands

    - -
    uv python list

    List the available Python installations

    -
    uv python install

    Download and install Python versions

    -
    uv python upgrade

    Upgrade installed Python versions

    -
    uv python find

    Search for a Python installation

    -
    uv python pin

    Pin to a specific Python version

    -
    uv python dir

    Show the uv Python installation directory

    -
    uv python uninstall

    Uninstall Python versions

    -
    uv python update-shell

    Ensure that the Python executable directory is on the PATH

    -
    - -### uv python list - -List the available Python installations. - -By default, installed Python versions and the downloads for latest available patch version of each supported Python major version are shown. - -Use `--managed-python` to view only managed Python versions. - -Use `--no-managed-python` to omit managed Python versions. - -Use `--all-versions` to view all available patch versions. - -Use `--only-installed` to omit available downloads. - -

    Usage

    - -``` -uv python list [OPTIONS] [REQUEST] -``` - -

    Arguments

    - -
    REQUEST

    A Python request to filter by.

    -

    See uv python to view supported request formats.

    -
    - -

    Options

    - -
    --all-arches, --all_architectures

    List Python downloads for all architectures.

    -

    By default, only downloads for the current architecture are shown.

    -
    --all-platforms

    List Python downloads for all platforms.

    -

    By default, only downloads for the current platform are shown.

    -
    --all-versions

    List all Python versions, including old patch versions.

    -

    By default, only the latest patch version is shown for each minor version.

    -
    --allow-insecure-host, --trusted-host allow-insecure-host

    Allow insecure connections to a host.

    -

    Can be provided multiple times.

    -

    Expects to receive either a hostname (e.g., localhost), a host-port pair (e.g., localhost:8080), or a URL (e.g., https://localhost).

    -

    WARNING: Hosts included in this list will not be verified against the system's certificate store. Only use --allow-insecure-host in a secure network with verified sources, as it bypasses SSL verification and could expose you to MITM attacks.

    -

    May also be set with the UV_INSECURE_HOST environment variable.

    --cache-dir cache-dir

    Path to the cache directory.

    -

    Defaults to $XDG_CACHE_HOME/uv or $HOME/.cache/uv on macOS and Linux, and %LOCALAPPDATA%\uv\cache on Windows.

    -

    To view the location of the cache directory, run uv cache dir.

    -

    May also be set with the UV_CACHE_DIR environment variable.

    --color color-choice

    Control the use of color in output.

    -

    By default, uv will automatically detect support for colors when writing to a terminal.

    -

    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.

    -

    While uv configuration can be included in a pyproject.toml file, it is not allowed in this context.

    -

    May also be set with the UV_CONFIG_FILE environment variable.

    --directory directory

    Change to the given directory prior to running the command.

    -

    Relative paths are resolved with the given directory as the base.

    -

    See --project to only change the project root directory.

    -

    May also be set with the UV_WORKING_DIR environment variable.

    --help, -h

    Display the concise help for this command

    -
    --managed-python

    Require use of uv-managed Python versions.

    -

    By default, uv prefers using Python versions it manages. However, it will use system Python versions if a uv-managed Python is not installed. This option disables use of system Python versions.

    -

    May also be set with the UV_MANAGED_PYTHON environment variable.

    --native-tls

    Whether to load TLS certificates from the platform's native certificate store.

    -

    By default, uv loads certificates from the bundled webpki-roots crate. The webpki-roots are a reliable set of trust roots from Mozilla, and including them in uv improves portability and performance (especially on macOS).

    -

    However, in some cases, you may want to use the platform's native certificate store, especially if you're relying on a corporate trust root (e.g., for a mandatory proxy) that's included in your system's certificate store.

    -

    May also be set with the UV_NATIVE_TLS environment variable.

    --no-cache, --no-cache-dir, -n

    Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation

    -

    May also be set with the UV_NO_CACHE environment variable.

    --no-config

    Avoid discovering configuration files (pyproject.toml, uv.toml).

    -

    Normally, configuration files are discovered in the current directory, parent directories, or user configuration directories.

    -

    May also be set with the UV_NO_CONFIG environment variable.

    --no-managed-python

    Disable use of uv-managed Python versions.

    -

    Instead, uv will search for a suitable Python version on the system.

    -

    May also be set with the UV_NO_MANAGED_PYTHON environment variable.

    --no-progress

    Hide all progress outputs.

    -

    For example, spinners or progress bars.

    -

    May also be set with the UV_NO_PROGRESS environment variable.

    --no-python-downloads

    Disable automatic downloads of Python.

    -
    --offline

    Disable network access.

    -

    When disabled, uv will only use locally cached data and locally available files.

    -

    May also be set with the UV_OFFLINE environment variable.

    --only-downloads

    Only show available Python downloads.

    -

    By default, installed distributions and available downloads for the current platform are shown.

    -
    --only-installed

    Only show installed Python versions.

    -

    By default, installed distributions and available downloads for the current platform are shown.

    -
    --output-format output-format

    Select the output format

    -

    [default: text]

    Possible values:

    -
      -
    • text: Plain text (for humans)
    • -
    • json: JSON (for computers)
    • -
    --project project

    Discover a project in the given directory.

    -

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    -

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    -

    See --directory to change the working directory entirely.

    -

    This setting has no effect when used in the uv pip interface.

    -

    May also be set with the UV_PROJECT environment variable.

    --python-downloads-json-url python-downloads-json-url

    URL pointing to JSON of custom Python installations

    -
    --quiet, -q

    Use quiet output.

    -

    Repeating this option, e.g., -qq, will enable a silent mode in which uv will write no output to stdout.

    -
    --show-urls

    Show the URLs of available Python downloads.

    -

    By default, these display as <download available>.

    -
    --verbose, -v

    Use verbose output.

    -

    You can configure fine-grained logging using the RUST_LOG environment variable. (https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#directives)

    -
    - -### uv python install - -Download and install Python versions. - -Supports CPython and PyPy. CPython distributions are downloaded from the Astral `python-build-standalone` project. PyPy distributions are downloaded from `python.org`. The available Python versions are bundled with each uv release. To install new Python versions, you may need upgrade uv. - -Python versions are installed into the uv Python directory, which can be retrieved with `uv python dir`. - -By default, Python executables are added to a directory on the path with a minor version suffix, e.g., `python3.13`. To install `python3` and `python`, use the `--default` flag. Use `uv python dir --bin` to see the target directory. - -Multiple Python versions may be requested. - -See `uv help python` to view supported request formats. - -

    Usage

    - -``` -uv python install [OPTIONS] [TARGETS]... -``` - -

    Arguments

    - -
    TARGETS

    The Python version(s) to install.

    -

    If not provided, the requested Python version(s) will be read from the UV_PYTHON environment variable then .python-versions or .python-version files. If none of the above are present, uv will check if it has installed any Python versions. If not, it will install the latest stable version of Python.

    -

    See uv python to view supported request formats.

    -
    - -

    Options

    - -
    --allow-insecure-host, --trusted-host allow-insecure-host

    Allow insecure connections to a host.

    -

    Can be provided multiple times.

    -

    Expects to receive either a hostname (e.g., localhost), a host-port pair (e.g., localhost:8080), or a URL (e.g., https://localhost).

    -

    WARNING: Hosts included in this list will not be verified against the system's certificate store. Only use --allow-insecure-host in a secure network with verified sources, as it bypasses SSL verification and could expose you to MITM attacks.

    -

    May also be set with the UV_INSECURE_HOST environment variable.

    --cache-dir cache-dir

    Path to the cache directory.

    -

    Defaults to $XDG_CACHE_HOME/uv or $HOME/.cache/uv on macOS and Linux, and %LOCALAPPDATA%\uv\cache on Windows.

    -

    To view the location of the cache directory, run uv cache dir.

    -

    May also be set with the UV_CACHE_DIR environment variable.

    --color color-choice

    Control the use of color in output.

    -

    By default, uv will automatically detect support for colors when writing to a terminal.

    -

    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.

    -

    While uv configuration can be included in a pyproject.toml file, it is not allowed in this context.

    -

    May also be set with the UV_CONFIG_FILE environment variable.

    --default

    Use as the default Python version.

    -

    By default, only a python{major}.{minor} executable is installed, e.g., python3.10. When the --default flag is used, python{major}, e.g., python3, and python executables are also installed.

    -

    Alternative Python variants will still include their tag. For example, installing 3.13+freethreaded with --default will include in python3t and pythont, not python3 and python.

    -

    If multiple Python versions are requested, uv will exit with an error.

    -
    --directory directory

    Change to the given directory prior to running the command.

    -

    Relative paths are resolved with the given directory as the base.

    -

    See --project to only change the project root directory.

    -

    May also be set with the UV_WORKING_DIR environment variable.

    --force, -f

    Replace existing Python executables during installation.

    -

    By default, uv will refuse to replace executables that it does not manage.

    -

    Implies --reinstall.

    -
    --help, -h

    Display the concise help for this command

    -
    --install-dir, -i install-dir

    The directory to store the Python installation in.

    -

    If provided, UV_PYTHON_INSTALL_DIR will need to be set for subsequent operations for uv to discover the Python installation.

    -

    See uv python dir to view the current Python installation directory. Defaults to ~/.local/share/uv/python.

    -

    May also be set with the UV_PYTHON_INSTALL_DIR environment variable.

    --managed-python

    Require use of uv-managed Python versions.

    -

    By default, uv prefers using Python versions it manages. However, it will use system Python versions if a uv-managed Python is not installed. This option disables use of system Python versions.

    -

    May also be set with the UV_MANAGED_PYTHON environment variable.

    --mirror mirror

    Set the URL to use as the source for downloading Python installations.

    -

    The provided URL will replace https://github.com/astral-sh/python-build-standalone/releases/download in, e.g., https://github.com/astral-sh/python-build-standalone/releases/download/20240713/cpython-3.12.4%2B20240713-aarch64-apple-darwin-install_only.tar.gz.

    -

    Distributions can be read from a local directory by using the file:// URL scheme.

    -
    --native-tls

    Whether to load TLS certificates from the platform's native certificate store.

    -

    By default, uv loads certificates from the bundled webpki-roots crate. The webpki-roots are a reliable set of trust roots from Mozilla, and including them in uv improves portability and performance (especially on macOS).

    -

    However, in some cases, you may want to use the platform's native certificate store, especially if you're relying on a corporate trust root (e.g., for a mandatory proxy) that's included in your system's certificate store.

    -

    May also be set with the UV_NATIVE_TLS environment variable.

    --no-bin

    Do not install a Python executable into the bin directory.

    -

    This can also be set with UV_PYTHON_INSTALL_BIN=0.

    -
    --no-cache, --no-cache-dir, -n

    Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation

    -

    May also be set with the UV_NO_CACHE environment variable.

    --no-config

    Avoid discovering configuration files (pyproject.toml, uv.toml).

    -

    Normally, configuration files are discovered in the current directory, parent directories, or user configuration directories.

    -

    May also be set with the UV_NO_CONFIG environment variable.

    --no-managed-python

    Disable use of uv-managed Python versions.

    -

    Instead, uv will search for a suitable Python version on the system.

    -

    May also be set with the UV_NO_MANAGED_PYTHON environment variable.

    --no-progress

    Hide all progress outputs.

    -

    For example, spinners or progress bars.

    -

    May also be set with the UV_NO_PROGRESS environment variable.

    --no-python-downloads

    Disable automatic downloads of Python.

    -
    --no-registry

    Do not register the Python installation in the Windows registry.

    -

    This can also be set with UV_PYTHON_INSTALL_REGISTRY=0.

    -
    --offline

    Disable network access.

    -

    When disabled, uv will only use locally cached data and locally available files.

    -

    May also be set with the UV_OFFLINE environment variable.

    --project project

    Discover a project in the given directory.

    -

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    -

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    -

    See --directory to change the working directory entirely.

    -

    This setting has no effect when used in the uv pip interface.

    -

    May also be set with the UV_PROJECT environment variable.

    --pypy-mirror pypy-mirror

    Set the URL to use as the source for downloading PyPy installations.

    -

    The provided URL will replace https://downloads.python.org/pypy in, e.g., https://downloads.python.org/pypy/pypy3.8-v7.3.7-osx64.tar.bz2.

    -

    Distributions can be read from a local directory by using the file:// URL scheme.

    -
    --python-downloads-json-url python-downloads-json-url

    URL pointing to JSON of custom Python installations

    -
    --quiet, -q

    Use quiet output.

    -

    Repeating this option, e.g., -qq, will enable a silent mode in which uv will write no output to stdout.

    -
    --reinstall, -r

    Reinstall the requested Python version, if it's already installed.

    -

    By default, uv will exit successfully if the version is already installed.

    -
    --upgrade, -U

    Upgrade existing Python installations to the latest patch version.

    -

    By default, uv will not upgrade already-installed Python versions to newer patch releases. With --upgrade, uv will upgrade to the latest available patch version for the specified minor version(s).

    -

    If the requested versions are not yet installed, uv will install them.

    -

    This option is only supported for minor version requests, e.g., 3.12; uv will exit with an error if a patch version, e.g., 3.12.2, is requested.

    -
    --verbose, -v

    Use verbose output.

    -

    You can configure fine-grained logging using the RUST_LOG environment variable. (https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#directives)

    -
    - -### uv python upgrade - -Upgrade installed Python versions. - -Upgrades versions to the latest supported patch release. Requires the `python-upgrade` preview feature. - -A target Python minor version to upgrade may be provided, e.g., `3.13`. Multiple versions may be provided to perform more than one upgrade. - -If no target version is provided, then uv will upgrade all managed CPython versions. - -During an upgrade, uv will not uninstall outdated patch versions. - -When an upgrade is performed, virtual environments created by uv will automatically use the new version. However, if the virtual environment was created before the upgrade functionality was added, it will continue to use the old Python version; to enable upgrades, the environment must be recreated. - -Upgrades are not yet supported for alternative implementations, like PyPy. - -

    Usage

    - -``` -uv python upgrade [OPTIONS] [TARGETS]... -``` - -

    Arguments

    - -
    TARGETS

    The Python minor version(s) to upgrade.

    -

    If no target version is provided, then uv will upgrade all managed CPython versions.

    -
    - -

    Options

    - -
    --allow-insecure-host, --trusted-host allow-insecure-host

    Allow insecure connections to a host.

    -

    Can be provided multiple times.

    -

    Expects to receive either a hostname (e.g., localhost), a host-port pair (e.g., localhost:8080), or a URL (e.g., https://localhost).

    -

    WARNING: Hosts included in this list will not be verified against the system's certificate store. Only use --allow-insecure-host in a secure network with verified sources, as it bypasses SSL verification and could expose you to MITM attacks.

    -

    May also be set with the UV_INSECURE_HOST environment variable.

    --cache-dir cache-dir

    Path to the cache directory.

    -

    Defaults to $XDG_CACHE_HOME/uv or $HOME/.cache/uv on macOS and Linux, and %LOCALAPPDATA%\uv\cache on Windows.

    -

    To view the location of the cache directory, run uv cache dir.

    -

    May also be set with the UV_CACHE_DIR environment variable.

    --color color-choice

    Control the use of color in output.

    -

    By default, uv will automatically detect support for colors when writing to a terminal.

    -

    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.

    -

    While uv configuration can be included in a pyproject.toml file, it is not allowed in this context.

    -

    May also be set with the UV_CONFIG_FILE environment variable.

    --directory directory

    Change to the given directory prior to running the command.

    -

    Relative paths are resolved with the given directory as the base.

    -

    See --project to only change the project root directory.

    -

    May also be set with the UV_WORKING_DIR environment variable.

    --help, -h

    Display the concise help for this command

    -
    --install-dir, -i install-dir

    The directory Python installations are stored in.

    -

    If provided, UV_PYTHON_INSTALL_DIR will need to be set for subsequent operations for uv to discover the Python installation.

    -

    See uv python dir to view the current Python installation directory. Defaults to ~/.local/share/uv/python.

    -

    May also be set with the UV_PYTHON_INSTALL_DIR environment variable.

    --managed-python

    Require use of uv-managed Python versions.

    -

    By default, uv prefers using Python versions it manages. However, it will use system Python versions if a uv-managed Python is not installed. This option disables use of system Python versions.

    -

    May also be set with the UV_MANAGED_PYTHON environment variable.

    --mirror mirror

    Set the URL to use as the source for downloading Python installations.

    -

    The provided URL will replace https://github.com/astral-sh/python-build-standalone/releases/download in, e.g., https://github.com/astral-sh/python-build-standalone/releases/download/20240713/cpython-3.12.4%2B20240713-aarch64-apple-darwin-install_only.tar.gz.

    -

    Distributions can be read from a local directory by using the file:// URL scheme.

    -
    --native-tls

    Whether to load TLS certificates from the platform's native certificate store.

    -

    By default, uv loads certificates from the bundled webpki-roots crate. The webpki-roots are a reliable set of trust roots from Mozilla, and including them in uv improves portability and performance (especially on macOS).

    -

    However, in some cases, you may want to use the platform's native certificate store, especially if you're relying on a corporate trust root (e.g., for a mandatory proxy) that's included in your system's certificate store.

    -

    May also be set with the UV_NATIVE_TLS environment variable.

    --no-cache, --no-cache-dir, -n

    Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation

    -

    May also be set with the UV_NO_CACHE environment variable.

    --no-config

    Avoid discovering configuration files (pyproject.toml, uv.toml).

    -

    Normally, configuration files are discovered in the current directory, parent directories, or user configuration directories.

    -

    May also be set with the UV_NO_CONFIG environment variable.

    --no-managed-python

    Disable use of uv-managed Python versions.

    -

    Instead, uv will search for a suitable Python version on the system.

    -

    May also be set with the UV_NO_MANAGED_PYTHON environment variable.

    --no-progress

    Hide all progress outputs.

    -

    For example, spinners or progress bars.

    -

    May also be set with the UV_NO_PROGRESS environment variable.

    --no-python-downloads

    Disable automatic downloads of Python.

    -
    --offline

    Disable network access.

    -

    When disabled, uv will only use locally cached data and locally available files.

    -

    May also be set with the UV_OFFLINE environment variable.

    --project project

    Discover a project in the given directory.

    -

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    -

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    -

    See --directory to change the working directory entirely.

    -

    This setting has no effect when used in the uv pip interface.

    -

    May also be set with the UV_PROJECT environment variable.

    --pypy-mirror pypy-mirror

    Set the URL to use as the source for downloading PyPy installations.

    -

    The provided URL will replace https://downloads.python.org/pypy in, e.g., https://downloads.python.org/pypy/pypy3.8-v7.3.7-osx64.tar.bz2.

    -

    Distributions can be read from a local directory by using the file:// URL scheme.

    -
    --python-downloads-json-url python-downloads-json-url

    URL pointing to JSON of custom Python installations

    -
    --quiet, -q

    Use quiet output.

    -

    Repeating this option, e.g., -qq, will enable a silent mode in which uv will write no output to stdout.

    -
    --reinstall, -r

    Reinstall the latest Python patch, if it's already installed.

    -

    By default, uv will exit successfully if the latest patch is already installed.

    -
    --verbose, -v

    Use verbose output.

    -

    You can configure fine-grained logging using the RUST_LOG environment variable. (https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#directives)

    -
    - -### uv python find - -Search for a Python installation. - -Displays the path to the Python executable. - -See `uv help python` to view supported request formats and details on discovery behavior. - -

    Usage

    - -``` -uv python find [OPTIONS] [REQUEST] -``` - -

    Arguments

    - -
    REQUEST

    The Python request.

    -

    See uv python to view supported request formats.

    -
    - -

    Options

    - -
    --allow-insecure-host, --trusted-host allow-insecure-host

    Allow insecure connections to a host.

    -

    Can be provided multiple times.

    -

    Expects to receive either a hostname (e.g., localhost), a host-port pair (e.g., localhost:8080), or a URL (e.g., https://localhost).

    -

    WARNING: Hosts included in this list will not be verified against the system's certificate store. Only use --allow-insecure-host in a secure network with verified sources, as it bypasses SSL verification and could expose you to MITM attacks.

    -

    May also be set with the UV_INSECURE_HOST environment variable.

    --cache-dir cache-dir

    Path to the cache directory.

    -

    Defaults to $XDG_CACHE_HOME/uv or $HOME/.cache/uv on macOS and Linux, and %LOCALAPPDATA%\uv\cache on Windows.

    -

    To view the location of the cache directory, run uv cache dir.

    -

    May also be set with the UV_CACHE_DIR environment variable.

    --color color-choice

    Control the use of color in output.

    -

    By default, uv will automatically detect support for colors when writing to a terminal.

    -

    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.

    -

    While uv configuration can be included in a pyproject.toml file, it is not allowed in this context.

    -

    May also be set with the UV_CONFIG_FILE environment variable.

    --directory directory

    Change to the given directory prior to running the command.

    -

    Relative paths are resolved with the given directory as the base.

    -

    See --project to only change the project root directory.

    -

    May also be set with the UV_WORKING_DIR environment variable.

    --help, -h

    Display the concise help for this command

    -
    --managed-python

    Require use of uv-managed Python versions.

    -

    By default, uv prefers using Python versions it manages. However, it will use system Python versions if a uv-managed Python is not installed. This option disables use of system Python versions.

    -

    May also be set with the UV_MANAGED_PYTHON environment variable.

    --native-tls

    Whether to load TLS certificates from the platform's native certificate store.

    -

    By default, uv loads certificates from the bundled webpki-roots crate. The webpki-roots are a reliable set of trust roots from Mozilla, and including them in uv improves portability and performance (especially on macOS).

    -

    However, in some cases, you may want to use the platform's native certificate store, especially if you're relying on a corporate trust root (e.g., for a mandatory proxy) that's included in your system's certificate store.

    -

    May also be set with the UV_NATIVE_TLS environment variable.

    --no-cache, --no-cache-dir, -n

    Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation

    -

    May also be set with the UV_NO_CACHE environment variable.

    --no-config

    Avoid discovering configuration files (pyproject.toml, uv.toml).

    -

    Normally, configuration files are discovered in the current directory, parent directories, or user configuration directories.

    -

    May also be set with the UV_NO_CONFIG environment variable.

    --no-managed-python

    Disable use of uv-managed Python versions.

    -

    Instead, uv will search for a suitable Python version on the system.

    -

    May also be set with the UV_NO_MANAGED_PYTHON environment variable.

    --no-progress

    Hide all progress outputs.

    -

    For example, spinners or progress bars.

    -

    May also be set with the UV_NO_PROGRESS environment variable.

    --no-project, --no_workspace

    Avoid discovering a project or workspace.

    -

    Otherwise, when no request is provided, the Python requirement of a project in the current directory or parent directories will be used.

    -
    --no-python-downloads

    Disable automatic downloads of Python.

    -
    --offline

    Disable network access.

    -

    When disabled, uv will only use locally cached data and locally available files.

    -

    May also be set with the UV_OFFLINE environment variable.

    --project project

    Discover a project in the given directory.

    -

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    -

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    -

    See --directory to change the working directory entirely.

    -

    This setting has no effect when used in the uv pip interface.

    -

    May also be set with the UV_PROJECT environment variable.

    --python-downloads-json-url python-downloads-json-url

    URL pointing to JSON of custom Python installations

    -
    --quiet, -q

    Use quiet output.

    -

    Repeating this option, e.g., -qq, will enable a silent mode in which uv will write no output to stdout.

    -
    --script script

    Find the environment for a Python script, rather than the current project

    -
    --show-version

    Show the Python version that would be used instead of the path to the interpreter

    -
    --system

    Only find system Python interpreters.

    -

    By default, uv will report the first Python interpreter it would use, including those in an active virtual environment or a virtual environment in the current working directory or any parent directory.

    -

    The --system option instructs uv to skip virtual environment Python interpreters and restrict its search to the system path.

    -

    May also be set with the UV_SYSTEM_PYTHON environment variable.

    --verbose, -v

    Use verbose output.

    -

    You can configure fine-grained logging using the RUST_LOG environment variable. (https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#directives)

    -
    - -### uv python pin - -Pin to a specific Python version. - -Writes the pinned Python version to a `.python-version` file, which is used by other uv commands to determine the required Python version. - -If no version is provided, uv will look for an existing `.python-version` file and display the currently pinned version. If no `.python-version` file is found, uv will exit with an error. - -See `uv help python` to view supported request formats. - -

    Usage

    - -``` -uv python pin [OPTIONS] [REQUEST] -``` - -

    Arguments

    - -
    REQUEST

    The Python version request.

    -

    uv supports more formats than other tools that read .python-version files, i.e., pyenv. If compatibility with those tools is needed, only use version numbers instead of complex requests such as cpython@3.10.

    -

    If no request is provided, the currently pinned version will be shown.

    -

    See uv python to view supported request formats.

    -
    - -

    Options

    - -
    --allow-insecure-host, --trusted-host allow-insecure-host

    Allow insecure connections to a host.

    -

    Can be provided multiple times.

    -

    Expects to receive either a hostname (e.g., localhost), a host-port pair (e.g., localhost:8080), or a URL (e.g., https://localhost).

    -

    WARNING: Hosts included in this list will not be verified against the system's certificate store. Only use --allow-insecure-host in a secure network with verified sources, as it bypasses SSL verification and could expose you to MITM attacks.

    -

    May also be set with the UV_INSECURE_HOST environment variable.

    --cache-dir cache-dir

    Path to the cache directory.

    -

    Defaults to $XDG_CACHE_HOME/uv or $HOME/.cache/uv on macOS and Linux, and %LOCALAPPDATA%\uv\cache on Windows.

    -

    To view the location of the cache directory, run uv cache dir.

    -

    May also be set with the UV_CACHE_DIR environment variable.

    --color color-choice

    Control the use of color in output.

    -

    By default, uv will automatically detect support for colors when writing to a terminal.

    -

    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.

    -

    While uv configuration can be included in a pyproject.toml file, it is not allowed in this context.

    -

    May also be set with the UV_CONFIG_FILE environment variable.

    --directory directory

    Change to the given directory prior to running the command.

    -

    Relative paths are resolved with the given directory as the base.

    -

    See --project to only change the project root directory.

    -

    May also be set with the UV_WORKING_DIR environment variable.

    --global

    Update the global Python version pin.

    -

    Writes the pinned Python version to a .python-version file in the uv user configuration directory: XDG_CONFIG_HOME/uv on Linux/macOS and %APPDATA%/uv on Windows.

    -

    When a local Python version pin is not found in the working directory or an ancestor directory, this version will be used instead.

    -
    --help, -h

    Display the concise help for this command

    -
    --managed-python

    Require use of uv-managed Python versions.

    -

    By default, uv prefers using Python versions it manages. However, it will use system Python versions if a uv-managed Python is not installed. This option disables use of system Python versions.

    -

    May also be set with the UV_MANAGED_PYTHON environment variable.

    --native-tls

    Whether to load TLS certificates from the platform's native certificate store.

    -

    By default, uv loads certificates from the bundled webpki-roots crate. The webpki-roots are a reliable set of trust roots from Mozilla, and including them in uv improves portability and performance (especially on macOS).

    -

    However, in some cases, you may want to use the platform's native certificate store, especially if you're relying on a corporate trust root (e.g., for a mandatory proxy) that's included in your system's certificate store.

    -

    May also be set with the UV_NATIVE_TLS environment variable.

    --no-cache, --no-cache-dir, -n

    Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation

    -

    May also be set with the UV_NO_CACHE environment variable.

    --no-config

    Avoid discovering configuration files (pyproject.toml, uv.toml).

    -

    Normally, configuration files are discovered in the current directory, parent directories, or user configuration directories.

    -

    May also be set with the UV_NO_CONFIG environment variable.

    --no-managed-python

    Disable use of uv-managed Python versions.

    -

    Instead, uv will search for a suitable Python version on the system.

    -

    May also be set with the UV_NO_MANAGED_PYTHON environment variable.

    --no-progress

    Hide all progress outputs.

    -

    For example, spinners or progress bars.

    -

    May also be set with the UV_NO_PROGRESS environment variable.

    --no-project, --no-workspace

    Avoid validating the Python pin is compatible with the project or workspace.

    -

    By default, a project or workspace is discovered in the current directory or any parent directory. If a workspace is found, the Python pin is validated against the workspace's requires-python constraint.

    -
    --no-python-downloads

    Disable automatic downloads of Python.

    -
    --offline

    Disable network access.

    -

    When disabled, uv will only use locally cached data and locally available files.

    -

    May also be set with the UV_OFFLINE environment variable.

    --project project

    Discover a project in the given directory.

    -

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    -

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    -

    See --directory to change the working directory entirely.

    -

    This setting has no effect when used in the uv pip interface.

    -

    May also be set with the UV_PROJECT environment variable.

    --quiet, -q

    Use quiet output.

    -

    Repeating this option, e.g., -qq, will enable a silent mode in which uv will write no output to stdout.

    -
    --resolved

    Write the resolved Python interpreter path instead of the request.

    -

    Ensures that the exact same interpreter is used.

    -

    This option is usually not safe to use when committing the .python-version file to version control.

    -
    --rm

    Remove the Python version pin

    -
    --verbose, -v

    Use verbose output.

    -

    You can configure fine-grained logging using the RUST_LOG environment variable. (https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#directives)

    -
    - -### uv python dir - -Show the uv Python installation directory. - -By default, Python installations are stored in the uv data directory at `$XDG_DATA_HOME/uv/python` or `$HOME/.local/share/uv/python` on Unix and `%APPDATA%\uv\data\python` on Windows. - -The Python installation directory may be overridden with `$UV_PYTHON_INSTALL_DIR`. - -To view the directory where uv installs Python executables instead, use the `--bin` flag. The Python executable directory may be overridden with `$UV_PYTHON_BIN_DIR`. Note that Python executables are only installed when preview mode is enabled. - -

    Usage

    - -``` -uv python dir [OPTIONS] -``` - -

    Options

    - -
    --allow-insecure-host, --trusted-host allow-insecure-host

    Allow insecure connections to a host.

    -

    Can be provided multiple times.

    -

    Expects to receive either a hostname (e.g., localhost), a host-port pair (e.g., localhost:8080), or a URL (e.g., https://localhost).

    -

    WARNING: Hosts included in this list will not be verified against the system's certificate store. Only use --allow-insecure-host in a secure network with verified sources, as it bypasses SSL verification and could expose you to MITM attacks.

    -

    May also be set with the UV_INSECURE_HOST environment variable.

    --bin

    Show the directory into which uv python will install Python executables.

    -

    Note that this directory is only used when installing Python with preview mode enabled.

    -

    The Python executable directory is determined according to the XDG standard and is derived -from the following environment variables, in order of preference:

    -
      -
    • $UV_PYTHON_BIN_DIR
    • -
    • $XDG_BIN_HOME
    • -
    • $XDG_DATA_HOME/../bin
    • -
    • $HOME/.local/bin
    • -
    -
    --cache-dir cache-dir

    Path to the cache directory.

    -

    Defaults to $XDG_CACHE_HOME/uv or $HOME/.cache/uv on macOS and Linux, and %LOCALAPPDATA%\uv\cache on Windows.

    -

    To view the location of the cache directory, run uv cache dir.

    -

    May also be set with the UV_CACHE_DIR environment variable.

    --color color-choice

    Control the use of color in output.

    -

    By default, uv will automatically detect support for colors when writing to a terminal.

    -

    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.

    -

    While uv configuration can be included in a pyproject.toml file, it is not allowed in this context.

    -

    May also be set with the UV_CONFIG_FILE environment variable.

    --directory directory

    Change to the given directory prior to running the command.

    -

    Relative paths are resolved with the given directory as the base.

    -

    See --project to only change the project root directory.

    -

    May also be set with the UV_WORKING_DIR environment variable.

    --help, -h

    Display the concise help for this command

    -
    --managed-python

    Require use of uv-managed Python versions.

    -

    By default, uv prefers using Python versions it manages. However, it will use system Python versions if a uv-managed Python is not installed. This option disables use of system Python versions.

    -

    May also be set with the UV_MANAGED_PYTHON environment variable.

    --native-tls

    Whether to load TLS certificates from the platform's native certificate store.

    -

    By default, uv loads certificates from the bundled webpki-roots crate. The webpki-roots are a reliable set of trust roots from Mozilla, and including them in uv improves portability and performance (especially on macOS).

    -

    However, in some cases, you may want to use the platform's native certificate store, especially if you're relying on a corporate trust root (e.g., for a mandatory proxy) that's included in your system's certificate store.

    -

    May also be set with the UV_NATIVE_TLS environment variable.

    --no-cache, --no-cache-dir, -n

    Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation

    -

    May also be set with the UV_NO_CACHE environment variable.

    --no-config

    Avoid discovering configuration files (pyproject.toml, uv.toml).

    -

    Normally, configuration files are discovered in the current directory, parent directories, or user configuration directories.

    -

    May also be set with the UV_NO_CONFIG environment variable.

    --no-managed-python

    Disable use of uv-managed Python versions.

    -

    Instead, uv will search for a suitable Python version on the system.

    -

    May also be set with the UV_NO_MANAGED_PYTHON environment variable.

    --no-progress

    Hide all progress outputs.

    -

    For example, spinners or progress bars.

    -

    May also be set with the UV_NO_PROGRESS environment variable.

    --no-python-downloads

    Disable automatic downloads of Python.

    -
    --offline

    Disable network access.

    -

    When disabled, uv will only use locally cached data and locally available files.

    -

    May also be set with the UV_OFFLINE environment variable.

    --project project

    Discover a project in the given directory.

    -

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    -

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    -

    See --directory to change the working directory entirely.

    -

    This setting has no effect when used in the uv pip interface.

    -

    May also be set with the UV_PROJECT environment variable.

    --quiet, -q

    Use quiet output.

    -

    Repeating this option, e.g., -qq, will enable a silent mode in which uv will write no output to stdout.

    -
    --verbose, -v

    Use verbose output.

    -

    You can configure fine-grained logging using the RUST_LOG environment variable. (https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#directives)

    -
    - -### uv python uninstall - -Uninstall Python versions - -

    Usage

    - -``` -uv python uninstall [OPTIONS] ... -``` - -

    Arguments

    - -
    TARGETS

    The Python version(s) to uninstall.

    -

    See uv python to view supported request formats.

    -
    - -

    Options

    - -
    --all

    Uninstall all managed Python versions

    -
    --allow-insecure-host, --trusted-host allow-insecure-host

    Allow insecure connections to a host.

    -

    Can be provided multiple times.

    -

    Expects to receive either a hostname (e.g., localhost), a host-port pair (e.g., localhost:8080), or a URL (e.g., https://localhost).

    -

    WARNING: Hosts included in this list will not be verified against the system's certificate store. Only use --allow-insecure-host in a secure network with verified sources, as it bypasses SSL verification and could expose you to MITM attacks.

    -

    May also be set with the UV_INSECURE_HOST environment variable.

    --cache-dir cache-dir

    Path to the cache directory.

    -

    Defaults to $XDG_CACHE_HOME/uv or $HOME/.cache/uv on macOS and Linux, and %LOCALAPPDATA%\uv\cache on Windows.

    -

    To view the location of the cache directory, run uv cache dir.

    -

    May also be set with the UV_CACHE_DIR environment variable.

    --color color-choice

    Control the use of color in output.

    -

    By default, uv will automatically detect support for colors when writing to a terminal.

    -

    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.

    -

    While uv configuration can be included in a pyproject.toml file, it is not allowed in this context.

    -

    May also be set with the UV_CONFIG_FILE environment variable.

    --directory directory

    Change to the given directory prior to running the command.

    -

    Relative paths are resolved with the given directory as the base.

    -

    See --project to only change the project root directory.

    -

    May also be set with the UV_WORKING_DIR environment variable.

    --help, -h

    Display the concise help for this command

    -
    --install-dir, -i install-dir

    The directory where the Python was installed

    -

    May also be set with the UV_PYTHON_INSTALL_DIR environment variable.

    --managed-python

    Require use of uv-managed Python versions.

    -

    By default, uv prefers using Python versions it manages. However, it will use system Python versions if a uv-managed Python is not installed. This option disables use of system Python versions.

    -

    May also be set with the UV_MANAGED_PYTHON environment variable.

    --native-tls

    Whether to load TLS certificates from the platform's native certificate store.

    -

    By default, uv loads certificates from the bundled webpki-roots crate. The webpki-roots are a reliable set of trust roots from Mozilla, and including them in uv improves portability and performance (especially on macOS).

    -

    However, in some cases, you may want to use the platform's native certificate store, especially if you're relying on a corporate trust root (e.g., for a mandatory proxy) that's included in your system's certificate store.

    -

    May also be set with the UV_NATIVE_TLS environment variable.

    --no-cache, --no-cache-dir, -n

    Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation

    -

    May also be set with the UV_NO_CACHE environment variable.

    --no-config

    Avoid discovering configuration files (pyproject.toml, uv.toml).

    -

    Normally, configuration files are discovered in the current directory, parent directories, or user configuration directories.

    -

    May also be set with the UV_NO_CONFIG environment variable.

    --no-managed-python

    Disable use of uv-managed Python versions.

    -

    Instead, uv will search for a suitable Python version on the system.

    -

    May also be set with the UV_NO_MANAGED_PYTHON environment variable.

    --no-progress

    Hide all progress outputs.

    -

    For example, spinners or progress bars.

    -

    May also be set with the UV_NO_PROGRESS environment variable.

    --no-python-downloads

    Disable automatic downloads of Python.

    -
    --offline

    Disable network access.

    -

    When disabled, uv will only use locally cached data and locally available files.

    -

    May also be set with the UV_OFFLINE environment variable.

    --project project

    Discover a project in the given directory.

    -

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    -

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    -

    See --directory to change the working directory entirely.

    -

    This setting has no effect when used in the uv pip interface.

    -

    May also be set with the UV_PROJECT environment variable.

    --quiet, -q

    Use quiet output.

    -

    Repeating this option, e.g., -qq, will enable a silent mode in which uv will write no output to stdout.

    -
    --verbose, -v

    Use verbose output.

    -

    You can configure fine-grained logging using the RUST_LOG environment variable. (https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#directives)

    -
    - -### uv python update-shell - -Ensure that the Python executable directory is on the `PATH`. - -If the Python executable directory is not present on the `PATH`, uv will attempt to add it to the relevant shell configuration files. - -If the shell configuration files already include a blurb to add the executable directory to the path, but the directory is not present on the `PATH`, uv will exit with an error. - -The Python executable directory is determined according to the XDG standard and can be retrieved with `uv python dir --bin`. - -

    Usage

    - -``` -uv python update-shell [OPTIONS] -``` - -

    Options

    - -
    --allow-insecure-host, --trusted-host allow-insecure-host

    Allow insecure connections to a host.

    -

    Can be provided multiple times.

    -

    Expects to receive either a hostname (e.g., localhost), a host-port pair (e.g., localhost:8080), or a URL (e.g., https://localhost).

    -

    WARNING: Hosts included in this list will not be verified against the system's certificate store. Only use --allow-insecure-host in a secure network with verified sources, as it bypasses SSL verification and could expose you to MITM attacks.

    -

    May also be set with the UV_INSECURE_HOST environment variable.

    --cache-dir cache-dir

    Path to the cache directory.

    -

    Defaults to $XDG_CACHE_HOME/uv or $HOME/.cache/uv on macOS and Linux, and %LOCALAPPDATA%\uv\cache on Windows.

    -

    To view the location of the cache directory, run uv cache dir.

    -

    May also be set with the UV_CACHE_DIR environment variable.

    --color color-choice

    Control the use of color in output.

    -

    By default, uv will automatically detect support for colors when writing to a terminal.

    -

    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.

    -

    While uv configuration can be included in a pyproject.toml file, it is not allowed in this context.

    -

    May also be set with the UV_CONFIG_FILE environment variable.

    --directory directory

    Change to the given directory prior to running the command.

    -

    Relative paths are resolved with the given directory as the base.

    -

    See --project to only change the project root directory.

    -

    May also be set with the UV_WORKING_DIR environment variable.

    --help, -h

    Display the concise help for this command

    -
    --managed-python

    Require use of uv-managed Python versions.

    -

    By default, uv prefers using Python versions it manages. However, it will use system Python versions if a uv-managed Python is not installed. This option disables use of system Python versions.

    -

    May also be set with the UV_MANAGED_PYTHON environment variable.

    --native-tls

    Whether to load TLS certificates from the platform's native certificate store.

    -

    By default, uv loads certificates from the bundled webpki-roots crate. The webpki-roots are a reliable set of trust roots from Mozilla, and including them in uv improves portability and performance (especially on macOS).

    -

    However, in some cases, you may want to use the platform's native certificate store, especially if you're relying on a corporate trust root (e.g., for a mandatory proxy) that's included in your system's certificate store.

    -

    May also be set with the UV_NATIVE_TLS environment variable.

    --no-cache, --no-cache-dir, -n

    Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation

    -

    May also be set with the UV_NO_CACHE environment variable.

    --no-config

    Avoid discovering configuration files (pyproject.toml, uv.toml).

    -

    Normally, configuration files are discovered in the current directory, parent directories, or user configuration directories.

    -

    May also be set with the UV_NO_CONFIG environment variable.

    --no-managed-python

    Disable use of uv-managed Python versions.

    -

    Instead, uv will search for a suitable Python version on the system.

    -

    May also be set with the UV_NO_MANAGED_PYTHON environment variable.

    --no-progress

    Hide all progress outputs.

    -

    For example, spinners or progress bars.

    -

    May also be set with the UV_NO_PROGRESS environment variable.

    --no-python-downloads

    Disable automatic downloads of Python.

    -
    --offline

    Disable network access.

    -

    When disabled, uv will only use locally cached data and locally available files.

    -

    May also be set with the UV_OFFLINE environment variable.

    --project project

    Discover a project in the given directory.

    -

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    -

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    -

    See --directory to change the working directory entirely.

    -

    This setting has no effect when used in the uv pip interface.

    -

    May also be set with the UV_PROJECT environment variable.

    --quiet, -q

    Use quiet output.

    -

    Repeating this option, e.g., -qq, will enable a silent mode in which uv will write no output to stdout.

    -
    --verbose, -v

    Use verbose output.

    -

    You can configure fine-grained logging using the RUST_LOG environment variable. (https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#directives)

    -
    - -## uv pip - -Manage Python packages with a pip-compatible interface - -

    Usage

    - -``` -uv pip [OPTIONS] -``` - -

    Commands

    - -
    uv pip compile

    Compile a requirements.in file to a requirements.txt or pylock.toml file

    -
    uv pip sync

    Sync an environment with a requirements.txt or pylock.toml file

    -
    uv pip install

    Install packages into an environment

    -
    uv pip uninstall

    Uninstall packages from an environment

    -
    uv pip freeze

    List, in requirements format, packages installed in an environment

    -
    uv pip list

    List, in tabular format, packages installed in an environment

    -
    uv pip show

    Show information about one or more installed packages

    -
    uv pip tree

    Display the dependency tree for an environment

    -
    uv pip check

    Verify installed packages have compatible dependencies

    -
    - -### uv pip compile - -Compile a `requirements.in` file to a `requirements.txt` or `pylock.toml` file - -

    Usage

    - -``` -uv pip compile [OPTIONS] > -``` - -

    Arguments

    - -
    SRC_FILE

    Include the packages listed in the given files.

    -

    The following formats are supported: requirements.txt, .py files with inline metadata, pylock.toml, pyproject.toml, setup.py, and setup.cfg.

    -

    If a pyproject.toml, setup.py, or setup.cfg file is provided, uv will extract the requirements for the relevant project.

    -

    If - is provided, then requirements will be read from stdin.

    -

    The order of the requirements files and the requirements in them is used to determine priority during resolution.

    -
    - -

    Options

    - -
    --all-extras

    Include all optional dependencies.

    -

    Only applies to pyproject.toml, setup.py, and setup.cfg sources.

    -
    --allow-insecure-host, --trusted-host allow-insecure-host

    Allow insecure connections to a host.

    -

    Can be provided multiple times.

    -

    Expects to receive either a hostname (e.g., localhost), a host-port pair (e.g., localhost:8080), or a URL (e.g., https://localhost).

    -

    WARNING: Hosts included in this list will not be verified against the system's certificate store. Only use --allow-insecure-host in a secure network with verified sources, as it bypasses SSL verification and could expose you to MITM attacks.

    -

    May also be set with the UV_INSECURE_HOST environment variable.

    --annotation-style annotation-style

    The style of the annotation comments included in the output file, used to indicate the source of each package.

    -

    Defaults to split.

    -

    Possible values:

    -
      -
    • line: Render the annotations on a single, comma-separated line
    • -
    • split: Render each annotation on its own line
    • -
    --build-constraints, --build-constraint, -b build-constraints

    Constrain build dependencies using the given requirements files when building source distributions.

    -

    Constraints files are requirements.txt-like files that only control the version of a requirement that's installed. However, including a package in a constraints file will not trigger the installation of that package.

    -

    May also be set with the UV_BUILD_CONSTRAINT environment variable.

    --cache-dir cache-dir

    Path to the cache directory.

    -

    Defaults to $XDG_CACHE_HOME/uv or $HOME/.cache/uv on macOS and Linux, and %LOCALAPPDATA%\uv\cache on Windows.

    -

    To view the location of the cache directory, run uv cache dir.

    -

    May also be set with the UV_CACHE_DIR environment variable.

    --color color-choice

    Control the use of color in output.

    -

    By default, uv will automatically detect support for colors when writing to a terminal.

    -

    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.

    -

    While uv configuration can be included in a pyproject.toml file, it is not allowed in this context.

    -

    May also be set with the UV_CONFIG_FILE environment variable.

    --config-setting, --config-settings, -C config-setting

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

    -
    --config-settings-package, --config-settings-package config-settings-package

    Settings to pass to the PEP 517 build backend for a specific package, specified as PACKAGE:KEY=VALUE pairs

    -
    --constraints, --constraint, -c constraints

    Constrain versions using the given requirements files.

    -

    Constraints files are requirements.txt-like files that only control the version of a requirement that's installed. However, including a package in a constraints file will not trigger the installation of that package.

    -

    This is equivalent to pip's --constraint option.

    -

    May also be set with the UV_CONSTRAINT environment variable.

    --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.

    -

    May also be set with the UV_CUSTOM_COMPILE_COMMAND environment variable.

    --default-index default-index

    The URL of the default package index (by default: https://pypi.org/simple).

    -

    Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

    -

    The index given by this flag is given lower priority than all other indexes specified via the --index flag.

    -

    May also be set with the UV_DEFAULT_INDEX environment variable.

    --directory directory

    Change to the given directory prior to running the command.

    -

    Relative paths are resolved with the given directory as the base.

    -

    See --project to only change the project root directory.

    -

    May also be set with the UV_WORKING_DIR environment variable.

    --emit-build-options

    Include --no-binary and --only-binary entries in the generated output file

    -

    Include --find-links entries in the generated output file

    -
    --emit-index-annotation

    Include comment annotations indicating the index used to resolve each package (e.g., # from https://pypi.org/simple)

    -
    --emit-index-url

    Include --index-url and --extra-index-url entries in the generated output file

    -
    --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 local dates in the same format (e.g., 2006-12-02) in your system's configured time zone.

    -

    May also be set with the UV_EXCLUDE_NEWER environment variable.

    --exclude-newer-package exclude-newer-package

    Limit candidate packages for a specific package to those that were uploaded prior to the given date.

    -

    Accepts package-date pairs in the format PACKAGE=DATE, where DATE is an RFC 3339 timestamp (e.g., 2006-12-02T02:07:43Z) or local date (e.g., 2006-12-02) in your system's configured time zone.

    -

    Can be provided multiple times for different packages.

    -
    --excludes, --exclude excludes

    Exclude packages from resolution using the given requirements files.

    -

    Excludes files are requirements.txt-like files that specify packages to exclude from the resolution. When a package is excluded, it will be omitted from the dependency list entirely and its own dependencies will be ignored during the resolution phase. Excludes are unconditional in that requirement specifiers and markers are ignored; any package listed in the provided file will be omitted from all resolved environments.

    -

    May also be set with the UV_EXCLUDE environment variable.

    --extra extra

    Include optional dependencies from the specified extra name; may be provided more than once.

    -

    Only applies to pyproject.toml, setup.py, and setup.cfg sources.

    -
    --extra-index-url extra-index-url

    (Deprecated: use --index instead) Extra URLs of package indexes to use, in addition to --index-url.

    -

    Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

    -

    All indexes provided via this flag take priority over the index specified by --index-url (which defaults to PyPI). When multiple --extra-index-url flags are provided, earlier values take priority.

    -

    May also be set with the UV_EXTRA_INDEX_URL environment variable.

    Locations to search for candidate distributions, in addition to those found in the registry indexes.

    -

    If a path, the target must be a directory that contains packages as wheel files (.whl) or source distributions (e.g., .tar.gz or .zip) at the top level.

    -

    If a URL, the page must contain a flat list of links to package files adhering to the formats described above.

    -

    May also be set with the UV_FIND_LINKS environment variable.

    --fork-strategy fork-strategy

    The strategy to use when selecting multiple versions of a given package across Python versions and platforms.

    -

    By default, uv will optimize for selecting the latest version of each package for each supported Python version (requires-python), while minimizing the number of selected versions across platforms.

    -

    Under fewest, uv will minimize the number of selected versions for each package, preferring older versions that are compatible with a wider range of supported Python versions or platforms.

    -

    May also be set with the UV_FORK_STRATEGY environment variable.

    Possible values:

    -
      -
    • fewest: Optimize for selecting the fewest number of versions for each package. Older versions may be preferred if they are compatible with a wider range of supported Python versions or platforms
    • -
    • requires-python: Optimize for selecting latest supported version of each package, for each supported Python version
    • -
    --format format

    The format in which the resolution should be output.

    -

    Supports both requirements.txt and pylock.toml (PEP 751) output formats.

    -

    uv will infer the output format from the file extension of the output file, if provided. Otherwise, defaults to requirements.txt.

    -

    Possible values:

    -
      -
    • requirements.txt: Export in requirements.txt format
    • -
    • pylock.toml: Export in pylock.toml format
    • -
    --generate-hashes

    Include distribution hashes in the output file

    -
    --group group

    Install the specified dependency group from a pyproject.toml.

    -

    If no path is provided, the pyproject.toml in the working directory is used.

    -

    May be provided multiple times.

    -
    --help, -h

    Display the concise help for this command

    -
    --index index

    The URLs to use when resolving dependencies, in addition to the default index.

    -

    Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

    -

    All indexes provided via this flag take priority over the index specified by --default-index (which defaults to PyPI). When multiple --index flags are provided, earlier values take priority.

    -

    Index names are not supported as values. Relative paths must be disambiguated from index names with ./ or ../ on Unix or .\\, ..\\, ./ or ../ on Windows.

    -

    May also be set with the UV_INDEX environment variable.

    --index-strategy index-strategy

    The strategy to use when resolving against multiple index URLs.

    -

    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-index). This prevents "dependency confusion" attacks, whereby an attacker can upload a malicious package under the same name to an alternate index.

    -

    May also be set with the UV_INDEX_STRATEGY environment variable.

    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
    • -
    --index-url, -i index-url

    (Deprecated: use --default-index instead) The URL of the Python package index (by default: https://pypi.org/simple).

    -

    Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

    -

    The index given by this flag is given lower priority than all other indexes specified via the --extra-index-url flag.

    -

    May also be set with the UV_INDEX_URL environment variable.

    --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.

    -

    May also be set with the UV_KEYRING_PROVIDER environment variable.

    Possible values:

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

    The method to use when installing packages from the global cache.

    -

    This option is only used when building source distributions.

    -

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

    -

    WARNING: The use of symlink link mode is discouraged, as they create tight coupling between the cache and the target environment. For example, clearing the cache (uv cache clean) will break all installed packages by way of removing the underlying source files. Use symlinks with caution.

    -

    May also be set with the UV_LINK_MODE environment variable.

    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
    • -
    --managed-python

    Require use of uv-managed Python versions.

    -

    By default, uv prefers using Python versions it manages. However, it will use system Python versions if a uv-managed Python is not installed. This option disables use of system Python versions.

    -

    May also be set with the UV_MANAGED_PYTHON environment variable.

    --native-tls

    Whether to load TLS certificates from the platform's native certificate store.

    -

    By default, uv loads certificates from the bundled webpki-roots crate. The webpki-roots are a reliable set of trust roots from Mozilla, and including them in uv improves portability and performance (especially on macOS).

    -

    However, in some cases, you may want to use the platform's native certificate store, especially if you're relying on a corporate trust root (e.g., for a mandatory proxy) that's included in your system's certificate store.

    -

    May also be set with the UV_NATIVE_TLS environment variable.

    --no-annotate

    Exclude comment annotations indicating the source of each package

    -
    --no-binary no-binary

    Don't install pre-built wheels.

    -

    The given packages will be built and installed from source. The resolver will still use pre-built wheels to extract package metadata, if available.

    -

    Multiple packages may be provided. Disable binaries for all packages with :all:. Clear previously specified packages with :none:.

    -
    --no-build

    Don't build source distributions.

    -

    When enabled, resolving will not run arbitrary Python code. The cached wheels of already-built source distributions will be reused, but operations that require building distributions will exit with an error.

    -

    Alias for --only-binary :all:.

    -
    --no-build-isolation

    Disable isolation when building source distributions.

    -

    Assumes that build dependencies specified by PEP 518 are already installed.

    -

    May also be set with the UV_NO_BUILD_ISOLATION environment variable.

    --no-build-isolation-package no-build-isolation-package

    Disable isolation when building source distributions for a specific package.

    -

    Assumes that the packages' build dependencies specified by PEP 518 are already installed.

    -
    --no-cache, --no-cache-dir, -n

    Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation

    -

    May also be set with the UV_NO_CACHE environment variable.

    --no-deps

    Ignore package dependencies, instead only add those packages explicitly listed on the command line to the resulting requirements file

    -
    --no-emit-package, --unsafe-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

    -
    --no-header

    Exclude the comment header at the top of the generated output file

    -
    --no-index

    Ignore the registry index (e.g., PyPI), instead relying on direct URL dependencies and those provided via --find-links

    -
    --no-managed-python

    Disable use of uv-managed Python versions.

    -

    Instead, uv will search for a suitable Python version on the system.

    -

    May also be set with the UV_NO_MANAGED_PYTHON environment variable.

    --no-progress

    Hide all progress outputs.

    -

    For example, spinners or progress bars.

    -

    May also be set with the UV_NO_PROGRESS environment variable.

    --no-python-downloads

    Disable automatic downloads of Python.

    -
    --no-sources

    Ignore the tool.uv.sources table when resolving dependencies. Used to lock against the standards-compliant, publishable package metadata, as opposed to using any workspace, Git, URL, or local path sources

    -

    May also be set with the UV_NO_SOURCES environment variable.

    --no-strip-extras

    Include extras in the output file.

    -

    By default, uv strips extras, as any packages pulled in by the extras are already included as dependencies in the output file directly. Further, output files generated with --no-strip-extras cannot be used as constraints files in install and sync invocations.

    -
    --no-strip-markers

    Include environment markers in the output file.

    -

    By default, uv strips environment markers, as the resolution generated by compile is only guaranteed to be correct for the target environment.

    -
    --offline

    Disable network access.

    -

    When disabled, uv will only use locally cached data and locally available files.

    -

    May also be set with the UV_OFFLINE environment variable.

    --only-binary only-binary

    Only use pre-built wheels; don't build source distributions.

    -

    When enabled, resolving will not run code from the given packages. The cached wheels of already-built source distributions will be reused, but operations that require building distributions will exit with an error.

    -

    Multiple packages may be provided. Disable binaries for all packages with :all:. Clear previously specified packages with :none:.

    -
    --output-file, -o output-file

    Write the compiled requirements to the given requirements.txt or pylock.toml file.

    -

    If the file already exists, the existing versions will be preferred when resolving dependencies, unless --upgrade is also specified.

    -
    --overrides, --override overrides

    Override versions using the given requirements files.

    -

    Overrides files are requirements.txt-like files that force a specific version of a requirement to be installed, regardless of the requirements declared by any constituent package, and regardless of whether this would be considered an invalid resolution.

    -

    While constraints are additive, in that they're combined with the requirements of the constituent packages, overrides are absolute, in that they completely replace the requirements of the constituent packages.

    -

    May also be set with the UV_OVERRIDE environment variable.

    --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).

    -

    May also be set with the UV_PRERELEASE environment variable.

    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
    • -
    --project project

    Discover a project in the given directory.

    -

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    -

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    -

    See --directory to change the working directory entirely.

    -

    This setting has no effect when used in the uv pip interface.

    -

    May also be set with the UV_PROJECT environment variable.

    --python, -p python

    The Python interpreter to use during resolution.

    -

    A Python interpreter is required for building source distributions to determine package -metadata when there are not wheels.

    -

    The interpreter is also used to determine the default minimum Python version, unless ---python-version is provided.

    -

    This option respects UV_PYTHON, but when set via environment variable, it is overridden -by --python-version.

    -

    See uv python for details on Python discovery and supported request formats.

    -
    --python-platform python-platform

    The platform for which requirements should be resolved.

    -

    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 aarch64-apple-darwin.

    -

    When targeting macOS (Darwin), the default minimum version is 13.0. Use MACOSX_DEPLOYMENT_TARGET to specify a different minimum version, e.g., 14.0.

    -

    When targeting iOS, the default minimum version is 13.0. Use IPHONEOS_DEPLOYMENT_TARGET to specify a different minimum version, e.g., 14.0.

    -

    When targeting Android, the default minimum Android API level is 24. Use ANDROID_API_LEVEL to specify a different minimum version, e.g., 26.

    -

    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: A 64-bit x86 Windows target
    • -
    • aarch64-pc-windows-msvc: An ARM64 Windows target
    • -
    • i686-pc-windows-msvc: A 32-bit x86 Windows target
    • -
    • x86_64-unknown-linux-gnu: An x86 Linux target. Equivalent to x86_64-manylinux_2_28
    • -
    • aarch64-apple-darwin: An ARM-based macOS target, as seen on Apple Silicon devices
    • -
    • x86_64-apple-darwin: An x86 macOS target
    • -
    • aarch64-unknown-linux-gnu: An ARM64 Linux target. Equivalent to aarch64-manylinux_2_28
    • -
    • aarch64-unknown-linux-musl: An ARM64 Linux target
    • -
    • x86_64-unknown-linux-musl: An x86_64 Linux target
    • -
    • riscv64-unknown-linux: A RISCV64 Linux target
    • -
    • x86_64-manylinux2014: An x86_64 target for the manylinux2014 platform. Equivalent to x86_64-manylinux_2_17
    • -
    • x86_64-manylinux_2_17: An x86_64 target for the manylinux_2_17 platform
    • -
    • x86_64-manylinux_2_28: An x86_64 target for the manylinux_2_28 platform
    • -
    • x86_64-manylinux_2_31: An x86_64 target for the manylinux_2_31 platform
    • -
    • x86_64-manylinux_2_32: An x86_64 target for the manylinux_2_32 platform
    • -
    • x86_64-manylinux_2_33: An x86_64 target for the manylinux_2_33 platform
    • -
    • x86_64-manylinux_2_34: An x86_64 target for the manylinux_2_34 platform
    • -
    • x86_64-manylinux_2_35: An x86_64 target for the manylinux_2_35 platform
    • -
    • x86_64-manylinux_2_36: An x86_64 target for the manylinux_2_36 platform
    • -
    • x86_64-manylinux_2_37: An x86_64 target for the manylinux_2_37 platform
    • -
    • x86_64-manylinux_2_38: An x86_64 target for the manylinux_2_38 platform
    • -
    • x86_64-manylinux_2_39: An x86_64 target for the manylinux_2_39 platform
    • -
    • x86_64-manylinux_2_40: An x86_64 target for the manylinux_2_40 platform
    • -
    • aarch64-manylinux2014: An ARM64 target for the manylinux2014 platform. Equivalent to aarch64-manylinux_2_17
    • -
    • aarch64-manylinux_2_17: An ARM64 target for the manylinux_2_17 platform
    • -
    • aarch64-manylinux_2_28: An ARM64 target for the manylinux_2_28 platform
    • -
    • aarch64-manylinux_2_31: An ARM64 target for the manylinux_2_31 platform
    • -
    • aarch64-manylinux_2_32: An ARM64 target for the manylinux_2_32 platform
    • -
    • aarch64-manylinux_2_33: An ARM64 target for the manylinux_2_33 platform
    • -
    • aarch64-manylinux_2_34: An ARM64 target for the manylinux_2_34 platform
    • -
    • aarch64-manylinux_2_35: An ARM64 target for the manylinux_2_35 platform
    • -
    • aarch64-manylinux_2_36: An ARM64 target for the manylinux_2_36 platform
    • -
    • aarch64-manylinux_2_37: An ARM64 target for the manylinux_2_37 platform
    • -
    • aarch64-manylinux_2_38: An ARM64 target for the manylinux_2_38 platform
    • -
    • aarch64-manylinux_2_39: An ARM64 target for the manylinux_2_39 platform
    • -
    • aarch64-manylinux_2_40: An ARM64 target for the manylinux_2_40 platform
    • -
    • aarch64-linux-android: An ARM64 Android target
    • -
    • x86_64-linux-android: An x86_64 Android target
    • -
    • wasm32-pyodide2024: A wasm32 target using the Pyodide 2024 platform. Meant for use with Python 3.12
    • -
    • arm64-apple-ios: An ARM64 target for iOS device
    • -
    • arm64-apple-ios-simulator: An ARM64 target for iOS simulator
    • -
    • x86_64-apple-ios-simulator: An x86_64 target for iOS simulator
    • -
    --python-version python-version

    The Python version to use for resolution.

    -

    For example, 3.8 or 3.8.17.

    -

    Defaults to the version of the Python interpreter used for resolution.

    -

    Defines the minimum Python version that must be supported by the resolved requirements.

    -

    If a patch version is omitted, the minimum patch version is assumed. For example, 3.8 is mapped to 3.8.0.

    -
    --quiet, -q

    Use quiet output.

    -

    Repeating this option, e.g., -qq, will enable a silent mode in which uv will write no output to stdout.

    -
    --refresh

    Refresh all cached data

    -
    --refresh-package refresh-package

    Refresh cached data for a specific package

    -
    --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).

    -

    May also be set with the UV_RESOLUTION environment variable.

    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
    • -
    --system

    Install packages into the system Python environment.

    -

    By default, uv uses the virtual environment in the current working directory or any parent directory, falling back to searching for a Python executable in PATH. The --system option instructs uv to avoid using a virtual environment Python and restrict its search to the system path.

    -

    May also be set with the UV_SYSTEM_PYTHON environment variable.

    --torch-backend torch-backend

    The backend to use when fetching packages in the PyTorch ecosystem (e.g., cpu, cu126, or auto).

    -

    When set, uv will ignore the configured index URLs for packages in the PyTorch ecosystem, and will instead use the defined backend.

    -

    For example, when set to cpu, uv will use the CPU-only PyTorch index; when set to cu126, uv will use the PyTorch index for CUDA 12.6.

    -

    The auto mode will attempt to detect the appropriate PyTorch index based on the currently installed CUDA drivers.

    -

    This option is in preview and may change in any future release.

    -

    May also be set with the UV_TORCH_BACKEND environment variable.

    Possible values:

    -
      -
    • auto: Select the appropriate PyTorch index based on the operating system and CUDA driver version
    • -
    • cpu: Use the CPU-only PyTorch index
    • -
    • cu130: Use the PyTorch index for CUDA 13.0
    • -
    • cu129: Use the PyTorch index for CUDA 12.9
    • -
    • cu128: Use the PyTorch index for CUDA 12.8
    • -
    • cu126: Use the PyTorch index for CUDA 12.6
    • -
    • cu125: Use the PyTorch index for CUDA 12.5
    • -
    • cu124: Use the PyTorch index for CUDA 12.4
    • -
    • cu123: Use the PyTorch index for CUDA 12.3
    • -
    • cu122: Use the PyTorch index for CUDA 12.2
    • -
    • cu121: Use the PyTorch index for CUDA 12.1
    • -
    • cu120: Use the PyTorch index for CUDA 12.0
    • -
    • cu118: Use the PyTorch index for CUDA 11.8
    • -
    • cu117: Use the PyTorch index for CUDA 11.7
    • -
    • cu116: Use the PyTorch index for CUDA 11.6
    • -
    • cu115: Use the PyTorch index for CUDA 11.5
    • -
    • cu114: Use the PyTorch index for CUDA 11.4
    • -
    • cu113: Use the PyTorch index for CUDA 11.3
    • -
    • cu112: Use the PyTorch index for CUDA 11.2
    • -
    • cu111: Use the PyTorch index for CUDA 11.1
    • -
    • cu110: Use the PyTorch index for CUDA 11.0
    • -
    • cu102: Use the PyTorch index for CUDA 10.2
    • -
    • cu101: Use the PyTorch index for CUDA 10.1
    • -
    • cu100: Use the PyTorch index for CUDA 10.0
    • -
    • cu92: Use the PyTorch index for CUDA 9.2
    • -
    • cu91: Use the PyTorch index for CUDA 9.1
    • -
    • cu90: Use the PyTorch index for CUDA 9.0
    • -
    • cu80: Use the PyTorch index for CUDA 8.0
    • -
    • rocm6.4: Use the PyTorch index for ROCm 6.4
    • -
    • rocm6.3: Use the PyTorch index for ROCm 6.3
    • -
    • rocm6.2.4: Use the PyTorch index for ROCm 6.2.4
    • -
    • rocm6.2: Use the PyTorch index for ROCm 6.2
    • -
    • rocm6.1: Use the PyTorch index for ROCm 6.1
    • -
    • rocm6.0: Use the PyTorch index for ROCm 6.0
    • -
    • rocm5.7: Use the PyTorch index for ROCm 5.7
    • -
    • rocm5.6: Use the PyTorch index for ROCm 5.6
    • -
    • rocm5.5: Use the PyTorch index for ROCm 5.5
    • -
    • rocm5.4.2: Use the PyTorch index for ROCm 5.4.2
    • -
    • rocm5.4: Use the PyTorch index for ROCm 5.4
    • -
    • rocm5.3: Use the PyTorch index for ROCm 5.3
    • -
    • rocm5.2: Use the PyTorch index for ROCm 5.2
    • -
    • rocm5.1.1: Use the PyTorch index for ROCm 5.1.1
    • -
    • rocm4.2: Use the PyTorch index for ROCm 4.2
    • -
    • rocm4.1: Use the PyTorch index for ROCm 4.1
    • -
    • rocm4.0.1: Use the PyTorch index for ROCm 4.0.1
    • -
    • xpu: Use the PyTorch index for Intel XPU
    • -
    --universal

    Perform a universal resolution, attempting to generate a single requirements.txt output file that is compatible with all operating systems, architectures, and Python implementations.

    -

    In universal mode, the current Python version (or user-provided --python-version) will be treated as a lower bound. For example, --universal --python-version 3.7 would produce a universal resolution for Python 3.7 and later.

    -

    Implies --no-strip-markers.

    -
    --upgrade, -U

    Allow package upgrades, ignoring pinned versions in any existing output file. Implies --refresh

    -
    --upgrade-package, -P upgrade-package

    Allow upgrades for a specific package, ignoring pinned versions in any existing output file. Implies --refresh-package

    -
    --verbose, -v

    Use verbose output.

    -

    You can configure fine-grained logging using the RUST_LOG environment variable. (https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#directives)

    -
    - -### uv pip sync - -Sync an environment with a `requirements.txt` or `pylock.toml` file. - -When syncing an environment, any packages not listed in the `requirements.txt` or `pylock.toml` file will be removed. To retain extraneous packages, use `uv pip install` instead. - -The input file is presumed to be the output of a `pip compile` or `uv export` operation, in which it will include all transitive dependencies. If transitive dependencies are not present in the file, they will not be installed. Use `--strict` to warn if any transitive dependencies are missing. - -

    Usage

    - -``` -uv pip sync [OPTIONS] ... -``` - -

    Arguments

    - -
    SRC_FILE

    Include the packages listed in the given files.

    -

    The following formats are supported: requirements.txt, .py files with inline metadata, pylock.toml, pyproject.toml, setup.py, and setup.cfg.

    -

    If a pyproject.toml, setup.py, or setup.cfg file is provided, uv will extract the requirements for the relevant project.

    -

    If - is provided, then requirements will be read from stdin.

    -
    - -

    Options

    - -
    --all-extras

    Include all optional dependencies.

    -

    Only applies to pylock.toml, pyproject.toml, setup.py, and setup.cfg sources.

    -
    --allow-empty-requirements

    Allow sync of empty requirements, which will clear the environment of all packages

    -
    --allow-insecure-host, --trusted-host allow-insecure-host

    Allow insecure connections to a host.

    -

    Can be provided multiple times.

    -

    Expects to receive either a hostname (e.g., localhost), a host-port pair (e.g., localhost:8080), or a URL (e.g., https://localhost).

    -

    WARNING: Hosts included in this list will not be verified against the system's certificate store. Only use --allow-insecure-host in a secure network with verified sources, as it bypasses SSL verification and could expose you to MITM attacks.

    -

    May also be set with the UV_INSECURE_HOST environment variable.

    --break-system-packages

    Allow uv to modify an EXTERNALLY-MANAGED Python installation.

    -

    WARNING: --break-system-packages is intended for use in continuous integration (CI) environments, when installing into Python installations that are managed by an external package manager, like apt. It should be used with caution, as such Python installations explicitly recommend against modifications by other package managers (like uv or pip).

    -

    May also be set with the UV_BREAK_SYSTEM_PACKAGES environment variable.

    --build-constraints, --build-constraint, -b build-constraints

    Constrain build dependencies using the given requirements files when building source distributions.

    -

    Constraints files are requirements.txt-like files that only control the version of a requirement that's installed. However, including a package in a constraints file will not trigger the installation of that package.

    -

    May also be set with the UV_BUILD_CONSTRAINT environment variable.

    --cache-dir cache-dir

    Path to the cache directory.

    -

    Defaults to $XDG_CACHE_HOME/uv or $HOME/.cache/uv on macOS and Linux, and %LOCALAPPDATA%\uv\cache on Windows.

    -

    To view the location of the cache directory, run uv cache dir.

    -

    May also be set with the UV_CACHE_DIR environment variable.

    --color color-choice

    Control the use of color in output.

    -

    By default, uv will automatically detect support for colors when writing to a terminal.

    -

    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
    • -
    --compile-bytecode, --compile

    Compile Python files to bytecode after installation.

    -

    By default, uv does not compile Python (.py) files to bytecode (__pycache__/*.pyc); instead, compilation is performed lazily the first time a module is imported. For use-cases in which start time is critical, such as CLI applications and Docker containers, this option can be enabled to trade longer installation times for faster start times.

    -

    When enabled, uv will process the entire site-packages directory (including packages that are not being modified by the current operation) for consistency. Like pip, it will also ignore errors.

    -

    May also be set with the UV_COMPILE_BYTECODE environment variable.

    --config-file config-file

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

    -

    While uv configuration can be included in a pyproject.toml file, it is not allowed in this context.

    -

    May also be set with the UV_CONFIG_FILE environment variable.

    --config-setting, --config-settings, -C config-setting

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

    -
    --config-settings-package, --config-settings-package config-settings-package

    Settings to pass to the PEP 517 build backend for a specific package, specified as PACKAGE:KEY=VALUE pairs

    -
    --constraints, --constraint, -c constraints

    Constrain versions using the given requirements files.

    -

    Constraints files are requirements.txt-like files that only control the version of a requirement that's installed. However, including a package in a constraints file will not trigger the installation of that package.

    -

    This is equivalent to pip's --constraint option.

    -

    May also be set with the UV_CONSTRAINT environment variable.

    --default-index default-index

    The URL of the default package index (by default: https://pypi.org/simple).

    -

    Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

    -

    The index given by this flag is given lower priority than all other indexes specified via the --index flag.

    -

    May also be set with the UV_DEFAULT_INDEX environment variable.

    --directory directory

    Change to the given directory prior to running the command.

    -

    Relative paths are resolved with the given directory as the base.

    -

    See --project to only change the project root directory.

    -

    May also be set with the UV_WORKING_DIR environment variable.

    --dry-run

    Perform a dry run, i.e., don't actually install anything but resolve the dependencies and print the resulting plan

    -
    --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 local dates in the same format (e.g., 2006-12-02) in your system's configured time zone.

    -

    May also be set with the UV_EXCLUDE_NEWER environment variable.

    --exclude-newer-package exclude-newer-package

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

    -

    Accepts package-date pairs in the format PACKAGE=DATE, where DATE is an RFC 3339 timestamp (e.g., 2006-12-02T02:07:43Z) or local date (e.g., 2006-12-02) in your system's configured time zone.

    -

    Can be provided multiple times for different packages.

    -
    --extra extra

    Include optional dependencies from the specified extra name; may be provided more than once.

    -

    Only applies to pylock.toml, pyproject.toml, setup.py, and setup.cfg sources.

    -
    --extra-index-url extra-index-url

    (Deprecated: use --index instead) Extra URLs of package indexes to use, in addition to --index-url.

    -

    Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

    -

    All indexes provided via this flag take priority over the index specified by --index-url (which defaults to PyPI). When multiple --extra-index-url flags are provided, earlier values take priority.

    -

    May also be set with the UV_EXTRA_INDEX_URL environment variable.

    Locations to search for candidate distributions, in addition to those found in the registry indexes.

    -

    If a path, the target must be a directory that contains packages as wheel files (.whl) or source distributions (e.g., .tar.gz or .zip) at the top level.

    -

    If a URL, the page must contain a flat list of links to package files adhering to the formats described above.

    -

    May also be set with the UV_FIND_LINKS environment variable.

    --group group

    Install the specified dependency group from a pylock.toml or pyproject.toml.

    -

    If no path is provided, the pylock.toml or pyproject.toml in the working directory is used.

    -

    May be provided multiple times.

    -
    --help, -h

    Display the concise help for this command

    -
    --index index

    The URLs to use when resolving dependencies, in addition to the default index.

    -

    Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

    -

    All indexes provided via this flag take priority over the index specified by --default-index (which defaults to PyPI). When multiple --index flags are provided, earlier values take priority.

    -

    Index names are not supported as values. Relative paths must be disambiguated from index names with ./ or ../ on Unix or .\\, ..\\, ./ or ../ on Windows.

    -

    May also be set with the UV_INDEX environment variable.

    --index-strategy index-strategy

    The strategy to use when resolving against multiple index URLs.

    -

    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-index). This prevents "dependency confusion" attacks, whereby an attacker can upload a malicious package under the same name to an alternate index.

    -

    May also be set with the UV_INDEX_STRATEGY environment variable.

    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
    • -
    --index-url, -i index-url

    (Deprecated: use --default-index instead) The URL of the Python package index (by default: https://pypi.org/simple).

    -

    Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

    -

    The index given by this flag is given lower priority than all other indexes specified via the --extra-index-url flag.

    -

    May also be set with the UV_INDEX_URL environment variable.

    --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.

    -

    May also be set with the UV_KEYRING_PROVIDER environment variable.

    Possible values:

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

    The method to use when installing packages from the global cache.

    -

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

    -

    WARNING: The use of symlink link mode is discouraged, as they create tight coupling between the cache and the target environment. For example, clearing the cache (uv cache clean) will break all installed packages by way of removing the underlying source files. Use symlinks with caution.

    -

    May also be set with the UV_LINK_MODE environment variable.

    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
    • -
    --managed-python

    Require use of uv-managed Python versions.

    -

    By default, uv prefers using Python versions it manages. However, it will use system Python versions if a uv-managed Python is not installed. This option disables use of system Python versions.

    -

    May also be set with the UV_MANAGED_PYTHON environment variable.

    --native-tls

    Whether to load TLS certificates from the platform's native certificate store.

    -

    By default, uv loads certificates from the bundled webpki-roots crate. The webpki-roots are a reliable set of trust roots from Mozilla, and including them in uv improves portability and performance (especially on macOS).

    -

    However, in some cases, you may want to use the platform's native certificate store, especially if you're relying on a corporate trust root (e.g., for a mandatory proxy) that's included in your system's certificate store.

    -

    May also be set with the UV_NATIVE_TLS environment variable.

    --no-allow-empty-requirements
    --no-binary no-binary

    Don't install pre-built wheels.

    -

    The given packages will be built and installed from source. The resolver will still use pre-built wheels to extract package metadata, if available.

    -

    Multiple packages may be provided. Disable binaries for all packages with :all:. Clear previously specified packages with :none:.

    -
    --no-break-system-packages
    --no-build

    Don't build source distributions.

    -

    When enabled, resolving will not run arbitrary Python code. The cached wheels of already-built source distributions will be reused, but operations that require building distributions will exit with an error.

    -

    Alias for --only-binary :all:.

    -
    --no-build-isolation

    Disable isolation when building source distributions.

    -

    Assumes that build dependencies specified by PEP 518 are already installed.

    -

    May also be set with the UV_NO_BUILD_ISOLATION environment variable.

    --no-cache, --no-cache-dir, -n

    Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation

    -

    May also be set with the UV_NO_CACHE environment variable.

    --no-index

    Ignore the registry index (e.g., PyPI), instead relying on direct URL dependencies and those provided via --find-links

    -
    --no-managed-python

    Disable use of uv-managed Python versions.

    -

    Instead, uv will search for a suitable Python version on the system.

    -

    May also be set with the UV_NO_MANAGED_PYTHON environment variable.

    --no-progress

    Hide all progress outputs.

    -

    For example, spinners or progress bars.

    -

    May also be set with the UV_NO_PROGRESS environment variable.

    --no-python-downloads

    Disable automatic downloads of Python.

    -
    --no-sources

    Ignore the tool.uv.sources table when resolving dependencies. Used to lock against the standards-compliant, publishable package metadata, as opposed to using any workspace, Git, URL, or local path sources

    -

    May also be set with the UV_NO_SOURCES environment variable.

    --no-verify-hashes

    Disable validation of hashes in the requirements file.

    -

    By default, uv will verify any available hashes in the requirements file, but will not require that all requirements have an associated hash. To enforce hash validation, use --require-hashes.

    -

    May also be set with the UV_NO_VERIFY_HASHES environment variable.

    --offline

    Disable network access.

    -

    When disabled, uv will only use locally cached data and locally available files.

    -

    May also be set with the UV_OFFLINE environment variable.

    --only-binary only-binary

    Only use pre-built wheels; don't build source distributions.

    -

    When enabled, resolving will not run code from the given packages. The cached wheels of already-built source distributions will be reused, but operations that require building distributions will exit with an error.

    -

    Multiple packages may be provided. Disable binaries for all packages with :all:. Clear previously specified packages with :none:.

    -
    --prefix prefix

    Install packages into lib, bin, and other top-level folders under the specified directory, as if a virtual environment were present at that location.

    -

    In general, prefer the use of --python to install into an alternate environment, as scripts and other artifacts installed via --prefix will reference the installing interpreter, rather than any interpreter added to the --prefix directory, rendering them non-portable.

    -

    Unlike other install operations, this command does not require discovery of an existing Python environment and only searches for a Python interpreter to use for package resolution. If a suitable Python interpreter cannot be found, uv will install one. To disable this, add --no-python-downloads.

    -
    --project project

    Discover a project in the given directory.

    -

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    -

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    -

    See --directory to change the working directory entirely.

    -

    This setting has no effect when used in the uv pip interface.

    -

    May also be set with the UV_PROJECT environment variable.

    --python, -p python

    The Python interpreter into which packages should be installed.

    -

    By default, syncing requires a virtual environment. A path to an alternative Python can be -provided, but it is only recommended in continuous integration (CI) environments and should -be used with caution, as it can modify the system Python installation.

    -

    See uv python for details on Python discovery and supported request formats.

    -

    May also be set with the UV_PYTHON environment variable.

    --python-platform python-platform

    The platform for which requirements should be installed.

    -

    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 aarch64-apple-darwin.

    -

    When targeting macOS (Darwin), the default minimum version is 13.0. Use MACOSX_DEPLOYMENT_TARGET to specify a different minimum version, e.g., 14.0.

    -

    When targeting iOS, the default minimum version is 13.0. Use IPHONEOS_DEPLOYMENT_TARGET to specify a different minimum version, e.g., 14.0.

    -

    When targeting Android, the default minimum Android API level is 24. Use ANDROID_API_LEVEL to specify a different minimum version, e.g., 26.

    -

    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: A 64-bit x86 Windows target
    • -
    • aarch64-pc-windows-msvc: An ARM64 Windows target
    • -
    • i686-pc-windows-msvc: A 32-bit x86 Windows target
    • -
    • x86_64-unknown-linux-gnu: An x86 Linux target. Equivalent to x86_64-manylinux_2_28
    • -
    • aarch64-apple-darwin: An ARM-based macOS target, as seen on Apple Silicon devices
    • -
    • x86_64-apple-darwin: An x86 macOS target
    • -
    • aarch64-unknown-linux-gnu: An ARM64 Linux target. Equivalent to aarch64-manylinux_2_28
    • -
    • aarch64-unknown-linux-musl: An ARM64 Linux target
    • -
    • x86_64-unknown-linux-musl: An x86_64 Linux target
    • -
    • riscv64-unknown-linux: A RISCV64 Linux target
    • -
    • x86_64-manylinux2014: An x86_64 target for the manylinux2014 platform. Equivalent to x86_64-manylinux_2_17
    • -
    • x86_64-manylinux_2_17: An x86_64 target for the manylinux_2_17 platform
    • -
    • x86_64-manylinux_2_28: An x86_64 target for the manylinux_2_28 platform
    • -
    • x86_64-manylinux_2_31: An x86_64 target for the manylinux_2_31 platform
    • -
    • x86_64-manylinux_2_32: An x86_64 target for the manylinux_2_32 platform
    • -
    • x86_64-manylinux_2_33: An x86_64 target for the manylinux_2_33 platform
    • -
    • x86_64-manylinux_2_34: An x86_64 target for the manylinux_2_34 platform
    • -
    • x86_64-manylinux_2_35: An x86_64 target for the manylinux_2_35 platform
    • -
    • x86_64-manylinux_2_36: An x86_64 target for the manylinux_2_36 platform
    • -
    • x86_64-manylinux_2_37: An x86_64 target for the manylinux_2_37 platform
    • -
    • x86_64-manylinux_2_38: An x86_64 target for the manylinux_2_38 platform
    • -
    • x86_64-manylinux_2_39: An x86_64 target for the manylinux_2_39 platform
    • -
    • x86_64-manylinux_2_40: An x86_64 target for the manylinux_2_40 platform
    • -
    • aarch64-manylinux2014: An ARM64 target for the manylinux2014 platform. Equivalent to aarch64-manylinux_2_17
    • -
    • aarch64-manylinux_2_17: An ARM64 target for the manylinux_2_17 platform
    • -
    • aarch64-manylinux_2_28: An ARM64 target for the manylinux_2_28 platform
    • -
    • aarch64-manylinux_2_31: An ARM64 target for the manylinux_2_31 platform
    • -
    • aarch64-manylinux_2_32: An ARM64 target for the manylinux_2_32 platform
    • -
    • aarch64-manylinux_2_33: An ARM64 target for the manylinux_2_33 platform
    • -
    • aarch64-manylinux_2_34: An ARM64 target for the manylinux_2_34 platform
    • -
    • aarch64-manylinux_2_35: An ARM64 target for the manylinux_2_35 platform
    • -
    • aarch64-manylinux_2_36: An ARM64 target for the manylinux_2_36 platform
    • -
    • aarch64-manylinux_2_37: An ARM64 target for the manylinux_2_37 platform
    • -
    • aarch64-manylinux_2_38: An ARM64 target for the manylinux_2_38 platform
    • -
    • aarch64-manylinux_2_39: An ARM64 target for the manylinux_2_39 platform
    • -
    • aarch64-manylinux_2_40: An ARM64 target for the manylinux_2_40 platform
    • -
    • aarch64-linux-android: An ARM64 Android target
    • -
    • x86_64-linux-android: An x86_64 Android target
    • -
    • wasm32-pyodide2024: A wasm32 target using the Pyodide 2024 platform. Meant for use with Python 3.12
    • -
    • arm64-apple-ios: An ARM64 target for iOS device
    • -
    • arm64-apple-ios-simulator: An ARM64 target for iOS simulator
    • -
    • x86_64-apple-ios-simulator: An x86_64 target for iOS simulator
    • -
    --python-version python-version

    The minimum Python version that should be supported by the requirements (e.g., 3.7 or 3.7.9).

    -

    If a patch version is omitted, the minimum patch version is assumed. For example, 3.7 is mapped to 3.7.0.

    -
    --quiet, -q

    Use quiet output.

    -

    Repeating this option, e.g., -qq, will enable a silent mode in which uv will write no output to stdout.

    -
    --refresh

    Refresh all cached data

    -
    --refresh-package refresh-package

    Refresh cached data for a specific package

    -
    --reinstall, --force-reinstall

    Reinstall all packages, regardless of whether they're already installed. Implies --refresh

    -
    --reinstall-package reinstall-package

    Reinstall a specific package, regardless of whether it's already installed. Implies --refresh-package

    -
    --require-hashes

    Require a matching hash for each requirement.

    -

    By default, uv will verify any available hashes in the requirements file, but will not require that all requirements have an associated hash.

    -

    When --require-hashes is enabled, all requirements must include a hash or set of hashes, and all requirements must either be pinned to exact versions (e.g., ==1.0.0), or be specified via direct URL.

    -

    Hash-checking mode introduces a number of additional constraints:

    -
      -
    • Git dependencies are not supported. - Editable installations are not supported. - Local dependencies are not supported, unless they point to a specific wheel (.whl) or source archive (.zip, .tar.gz), as opposed to a directory.
    • -
    -

    May also be set with the UV_REQUIRE_HASHES environment variable.

    --strict

    Validate the Python environment after completing the installation, to detect packages with missing dependencies or other issues

    -
    --system

    Install packages into the system Python environment.

    -

    By default, uv installs into the virtual environment in the current working directory or any parent directory. The --system option instructs uv to instead use the first Python found in the system PATH.

    -

    WARNING: --system is intended for use in continuous integration (CI) environments and should be used with caution, as it can modify the system Python installation.

    -

    May also be set with the UV_SYSTEM_PYTHON environment variable.

    --target target

    Install packages into the specified directory, rather than into the virtual or system Python environment. The packages will be installed at the top-level of the directory.

    -

    Unlike other install operations, this command does not require discovery of an existing Python environment and only searches for a Python interpreter to use for package resolution. If a suitable Python interpreter cannot be found, uv will install one. To disable this, add --no-python-downloads.

    -
    --torch-backend torch-backend

    The backend to use when fetching packages in the PyTorch ecosystem (e.g., cpu, cu126, or auto).

    -

    When set, uv will ignore the configured index URLs for packages in the PyTorch ecosystem, and will instead use the defined backend.

    -

    For example, when set to cpu, uv will use the CPU-only PyTorch index; when set to cu126, uv will use the PyTorch index for CUDA 12.6.

    -

    The auto mode will attempt to detect the appropriate PyTorch index based on the currently installed CUDA drivers.

    -

    This option is in preview and may change in any future release.

    -

    May also be set with the UV_TORCH_BACKEND environment variable.

    Possible values:

    -
      -
    • auto: Select the appropriate PyTorch index based on the operating system and CUDA driver version
    • -
    • cpu: Use the CPU-only PyTorch index
    • -
    • cu130: Use the PyTorch index for CUDA 13.0
    • -
    • cu129: Use the PyTorch index for CUDA 12.9
    • -
    • cu128: Use the PyTorch index for CUDA 12.8
    • -
    • cu126: Use the PyTorch index for CUDA 12.6
    • -
    • cu125: Use the PyTorch index for CUDA 12.5
    • -
    • cu124: Use the PyTorch index for CUDA 12.4
    • -
    • cu123: Use the PyTorch index for CUDA 12.3
    • -
    • cu122: Use the PyTorch index for CUDA 12.2
    • -
    • cu121: Use the PyTorch index for CUDA 12.1
    • -
    • cu120: Use the PyTorch index for CUDA 12.0
    • -
    • cu118: Use the PyTorch index for CUDA 11.8
    • -
    • cu117: Use the PyTorch index for CUDA 11.7
    • -
    • cu116: Use the PyTorch index for CUDA 11.6
    • -
    • cu115: Use the PyTorch index for CUDA 11.5
    • -
    • cu114: Use the PyTorch index for CUDA 11.4
    • -
    • cu113: Use the PyTorch index for CUDA 11.3
    • -
    • cu112: Use the PyTorch index for CUDA 11.2
    • -
    • cu111: Use the PyTorch index for CUDA 11.1
    • -
    • cu110: Use the PyTorch index for CUDA 11.0
    • -
    • cu102: Use the PyTorch index for CUDA 10.2
    • -
    • cu101: Use the PyTorch index for CUDA 10.1
    • -
    • cu100: Use the PyTorch index for CUDA 10.0
    • -
    • cu92: Use the PyTorch index for CUDA 9.2
    • -
    • cu91: Use the PyTorch index for CUDA 9.1
    • -
    • cu90: Use the PyTorch index for CUDA 9.0
    • -
    • cu80: Use the PyTorch index for CUDA 8.0
    • -
    • rocm6.4: Use the PyTorch index for ROCm 6.4
    • -
    • rocm6.3: Use the PyTorch index for ROCm 6.3
    • -
    • rocm6.2.4: Use the PyTorch index for ROCm 6.2.4
    • -
    • rocm6.2: Use the PyTorch index for ROCm 6.2
    • -
    • rocm6.1: Use the PyTorch index for ROCm 6.1
    • -
    • rocm6.0: Use the PyTorch index for ROCm 6.0
    • -
    • rocm5.7: Use the PyTorch index for ROCm 5.7
    • -
    • rocm5.6: Use the PyTorch index for ROCm 5.6
    • -
    • rocm5.5: Use the PyTorch index for ROCm 5.5
    • -
    • rocm5.4.2: Use the PyTorch index for ROCm 5.4.2
    • -
    • rocm5.4: Use the PyTorch index for ROCm 5.4
    • -
    • rocm5.3: Use the PyTorch index for ROCm 5.3
    • -
    • rocm5.2: Use the PyTorch index for ROCm 5.2
    • -
    • rocm5.1.1: Use the PyTorch index for ROCm 5.1.1
    • -
    • rocm4.2: Use the PyTorch index for ROCm 4.2
    • -
    • rocm4.1: Use the PyTorch index for ROCm 4.1
    • -
    • rocm4.0.1: Use the PyTorch index for ROCm 4.0.1
    • -
    • xpu: Use the PyTorch index for Intel XPU
    • -
    --verbose, -v

    Use verbose output.

    -

    You can configure fine-grained logging using the RUST_LOG environment variable. (https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#directives)

    -
    - -### uv pip install - -Install packages into an environment - -

    Usage

    - -``` -uv pip install [OPTIONS] |--editable |--group > -``` - -

    Arguments

    - -
    PACKAGE

    Install all listed packages.

    -

    The order of the packages is used to determine priority during resolution.

    -
    - -

    Options

    - -
    --all-extras

    Include all optional dependencies.

    -

    Only applies to pylock.toml, pyproject.toml, setup.py, and setup.cfg sources.

    -
    --allow-insecure-host, --trusted-host allow-insecure-host

    Allow insecure connections to a host.

    -

    Can be provided multiple times.

    -

    Expects to receive either a hostname (e.g., localhost), a host-port pair (e.g., localhost:8080), or a URL (e.g., https://localhost).

    -

    WARNING: Hosts included in this list will not be verified against the system's certificate store. Only use --allow-insecure-host in a secure network with verified sources, as it bypasses SSL verification and could expose you to MITM attacks.

    -

    May also be set with the UV_INSECURE_HOST environment variable.

    --break-system-packages

    Allow uv to modify an EXTERNALLY-MANAGED Python installation.

    -

    WARNING: --break-system-packages is intended for use in continuous integration (CI) environments, when installing into Python installations that are managed by an external package manager, like apt. It should be used with caution, as such Python installations explicitly recommend against modifications by other package managers (like uv or pip).

    -

    May also be set with the UV_BREAK_SYSTEM_PACKAGES environment variable.

    --build-constraints, --build-constraint, -b build-constraints

    Constrain build dependencies using the given requirements files when building source distributions.

    -

    Constraints files are requirements.txt-like files that only control the version of a requirement that's installed. However, including a package in a constraints file will not trigger the installation of that package.

    -

    May also be set with the UV_BUILD_CONSTRAINT environment variable.

    --cache-dir cache-dir

    Path to the cache directory.

    -

    Defaults to $XDG_CACHE_HOME/uv or $HOME/.cache/uv on macOS and Linux, and %LOCALAPPDATA%\uv\cache on Windows.

    -

    To view the location of the cache directory, run uv cache dir.

    -

    May also be set with the UV_CACHE_DIR environment variable.

    --color color-choice

    Control the use of color in output.

    -

    By default, uv will automatically detect support for colors when writing to a terminal.

    -

    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
    • -
    --compile-bytecode, --compile

    Compile Python files to bytecode after installation.

    -

    By default, uv does not compile Python (.py) files to bytecode (__pycache__/*.pyc); instead, compilation is performed lazily the first time a module is imported. For use-cases in which start time is critical, such as CLI applications and Docker containers, this option can be enabled to trade longer installation times for faster start times.

    -

    When enabled, uv will process the entire site-packages directory (including packages that are not being modified by the current operation) for consistency. Like pip, it will also ignore errors.

    -

    May also be set with the UV_COMPILE_BYTECODE environment variable.

    --config-file config-file

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

    -

    While uv configuration can be included in a pyproject.toml file, it is not allowed in this context.

    -

    May also be set with the UV_CONFIG_FILE environment variable.

    --config-setting, --config-settings, -C config-setting

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

    -
    --config-settings-package, --config-settings-package config-settings-package

    Settings to pass to the PEP 517 build backend for a specific package, specified as PACKAGE:KEY=VALUE pairs

    -
    --constraints, --constraint, -c constraints

    Constrain versions using the given requirements files.

    -

    Constraints files are requirements.txt-like files that only control the version of a requirement that's installed. However, including a package in a constraints file will not trigger the installation of that package.

    -

    This is equivalent to pip's --constraint option.

    -

    May also be set with the UV_CONSTRAINT environment variable.

    --default-index default-index

    The URL of the default package index (by default: https://pypi.org/simple).

    -

    Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

    -

    The index given by this flag is given lower priority than all other indexes specified via the --index flag.

    -

    May also be set with the UV_DEFAULT_INDEX environment variable.

    --directory directory

    Change to the given directory prior to running the command.

    -

    Relative paths are resolved with the given directory as the base.

    -

    See --project to only change the project root directory.

    -

    May also be set with the UV_WORKING_DIR environment variable.

    --dry-run

    Perform a dry run, i.e., don't actually install anything but resolve the dependencies and print the resulting plan

    -
    --editable, -e editable

    Install the editable package based on the provided local file path

    -
    --exact

    Perform an exact sync, removing extraneous packages.

    -

    By default, installing will make the minimum necessary changes to satisfy the requirements. When enabled, uv will update the environment to exactly match the requirements, removing packages that are not included in the requirements.

    -
    --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 local dates in the same format (e.g., 2006-12-02) in your system's configured time zone.

    -

    May also be set with the UV_EXCLUDE_NEWER environment variable.

    --exclude-newer-package exclude-newer-package

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

    -

    Accepts package-date pairs in the format PACKAGE=DATE, where DATE is an RFC 3339 timestamp (e.g., 2006-12-02T02:07:43Z) or local date (e.g., 2006-12-02) in your system's configured time zone.

    -

    Can be provided multiple times for different packages.

    -
    --excludes, --exclude excludes

    Exclude packages from resolution using the given requirements files.

    -

    Excludes files are requirements.txt-like files that specify packages to exclude from the resolution. When a package is excluded, it will be omitted from the dependency list entirely and its own dependencies will be ignored during the resolution phase. Excludes are unconditional in that requirement specifiers and markers are ignored; any package listed in the provided file will be omitted from all resolved environments.

    -

    May also be set with the UV_EXCLUDE environment variable.

    --extra extra

    Include optional dependencies from the specified extra name; may be provided more than once.

    -

    Only applies to pylock.toml, pyproject.toml, setup.py, and setup.cfg sources.

    -
    --extra-index-url extra-index-url

    (Deprecated: use --index instead) Extra URLs of package indexes to use, in addition to --index-url.

    -

    Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

    -

    All indexes provided via this flag take priority over the index specified by --index-url (which defaults to PyPI). When multiple --extra-index-url flags are provided, earlier values take priority.

    -

    May also be set with the UV_EXTRA_INDEX_URL environment variable.

    Locations to search for candidate distributions, in addition to those found in the registry indexes.

    -

    If a path, the target must be a directory that contains packages as wheel files (.whl) or source distributions (e.g., .tar.gz or .zip) at the top level.

    -

    If a URL, the page must contain a flat list of links to package files adhering to the formats described above.

    -

    May also be set with the UV_FIND_LINKS environment variable.

    --fork-strategy fork-strategy

    The strategy to use when selecting multiple versions of a given package across Python versions and platforms.

    -

    By default, uv will optimize for selecting the latest version of each package for each supported Python version (requires-python), while minimizing the number of selected versions across platforms.

    -

    Under fewest, uv will minimize the number of selected versions for each package, preferring older versions that are compatible with a wider range of supported Python versions or platforms.

    -

    May also be set with the UV_FORK_STRATEGY environment variable.

    Possible values:

    -
      -
    • fewest: Optimize for selecting the fewest number of versions for each package. Older versions may be preferred if they are compatible with a wider range of supported Python versions or platforms
    • -
    • requires-python: Optimize for selecting latest supported version of each package, for each supported Python version
    • -
    --group group

    Install the specified dependency group from a pylock.toml or pyproject.toml.

    -

    If no path is provided, the pylock.toml or pyproject.toml in the working directory is used.

    -

    May be provided multiple times.

    -
    --help, -h

    Display the concise help for this command

    -
    --index index

    The URLs to use when resolving dependencies, in addition to the default index.

    -

    Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

    -

    All indexes provided via this flag take priority over the index specified by --default-index (which defaults to PyPI). When multiple --index flags are provided, earlier values take priority.

    -

    Index names are not supported as values. Relative paths must be disambiguated from index names with ./ or ../ on Unix or .\\, ..\\, ./ or ../ on Windows.

    -

    May also be set with the UV_INDEX environment variable.

    --index-strategy index-strategy

    The strategy to use when resolving against multiple index URLs.

    -

    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-index). This prevents "dependency confusion" attacks, whereby an attacker can upload a malicious package under the same name to an alternate index.

    -

    May also be set with the UV_INDEX_STRATEGY environment variable.

    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
    • -
    --index-url, -i index-url

    (Deprecated: use --default-index instead) The URL of the Python package index (by default: https://pypi.org/simple).

    -

    Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

    -

    The index given by this flag is given lower priority than all other indexes specified via the --extra-index-url flag.

    -

    May also be set with the UV_INDEX_URL environment variable.

    --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.

    -

    May also be set with the UV_KEYRING_PROVIDER environment variable.

    Possible values:

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

    The method to use when installing packages from the global cache.

    -

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

    -

    WARNING: The use of symlink link mode is discouraged, as they create tight coupling between the cache and the target environment. For example, clearing the cache (uv cache clean) will break all installed packages by way of removing the underlying source files. Use symlinks with caution.

    -

    May also be set with the UV_LINK_MODE environment variable.

    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
    • -
    --managed-python

    Require use of uv-managed Python versions.

    -

    By default, uv prefers using Python versions it manages. However, it will use system Python versions if a uv-managed Python is not installed. This option disables use of system Python versions.

    -

    May also be set with the UV_MANAGED_PYTHON environment variable.

    --native-tls

    Whether to load TLS certificates from the platform's native certificate store.

    -

    By default, uv loads certificates from the bundled webpki-roots crate. The webpki-roots are a reliable set of trust roots from Mozilla, and including them in uv improves portability and performance (especially on macOS).

    -

    However, in some cases, you may want to use the platform's native certificate store, especially if you're relying on a corporate trust root (e.g., for a mandatory proxy) that's included in your system's certificate store.

    -

    May also be set with the UV_NATIVE_TLS environment variable.

    --no-binary no-binary

    Don't install pre-built wheels.

    -

    The given packages will be built and installed from source. The resolver will still use pre-built wheels to extract package metadata, if available.

    -

    Multiple packages may be provided. Disable binaries for all packages with :all:. Clear previously specified packages with :none:.

    -
    --no-break-system-packages
    --no-build

    Don't build source distributions.

    -

    When enabled, resolving will not run arbitrary Python code. The cached wheels of already-built source distributions will be reused, but operations that require building distributions will exit with an error.

    -

    Alias for --only-binary :all:.

    -
    --no-build-isolation

    Disable isolation when building source distributions.

    -

    Assumes that build dependencies specified by PEP 518 are already installed.

    -

    May also be set with the UV_NO_BUILD_ISOLATION environment variable.

    --no-build-isolation-package no-build-isolation-package

    Disable isolation when building source distributions for a specific package.

    -

    Assumes that the packages' build dependencies specified by PEP 518 are already installed.

    -
    --no-cache, --no-cache-dir, -n

    Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation

    -

    May also be set with the UV_NO_CACHE environment variable.

    --no-config

    Avoid discovering configuration files (pyproject.toml, uv.toml).

    -

    Normally, configuration files are discovered in the current directory, parent directories, or user configuration directories.

    -

    May also be set with the UV_NO_CONFIG environment variable.

    --no-deps

    Ignore package dependencies, instead only installing those packages explicitly listed on the command line or in the requirements files

    -
    --no-index

    Ignore the registry index (e.g., PyPI), instead relying on direct URL dependencies and those provided via --find-links

    -
    --no-managed-python

    Disable use of uv-managed Python versions.

    -

    Instead, uv will search for a suitable Python version on the system.

    -

    May also be set with the UV_NO_MANAGED_PYTHON environment variable.

    --no-progress

    Hide all progress outputs.

    -

    For example, spinners or progress bars.

    -

    May also be set with the UV_NO_PROGRESS environment variable.

    --no-python-downloads

    Disable automatic downloads of Python.

    -
    --no-sources

    Ignore the tool.uv.sources table when resolving dependencies. Used to lock against the standards-compliant, publishable package metadata, as opposed to using any workspace, Git, URL, or local path sources

    -

    May also be set with the UV_NO_SOURCES environment variable.

    --no-verify-hashes

    Disable validation of hashes in the requirements file.

    -

    By default, uv will verify any available hashes in the requirements file, but will not require that all requirements have an associated hash. To enforce hash validation, use --require-hashes.

    -

    May also be set with the UV_NO_VERIFY_HASHES environment variable.

    --offline

    Disable network access.

    -

    When disabled, uv will only use locally cached data and locally available files.

    -

    May also be set with the UV_OFFLINE environment variable.

    --only-binary only-binary

    Only use pre-built wheels; don't build source distributions.

    -

    When enabled, resolving will not run code from the given packages. The cached wheels of already-built source distributions will be reused, but operations that require building distributions will exit with an error.

    -

    Multiple packages may be provided. Disable binaries for all packages with :all:. Clear previously specified packages with :none:.

    -
    --overrides, --override overrides

    Override versions using the given requirements files.

    -

    Overrides files are requirements.txt-like files that force a specific version of a requirement to be installed, regardless of the requirements declared by any constituent package, and regardless of whether this would be considered an invalid resolution.

    -

    While constraints are additive, in that they're combined with the requirements of the constituent packages, overrides are absolute, in that they completely replace the requirements of the constituent packages.

    -

    May also be set with the UV_OVERRIDE environment variable.

    --prefix prefix

    Install packages into lib, bin, and other top-level folders under the specified directory, as if a virtual environment were present at that location.

    -

    In general, prefer the use of --python to install into an alternate environment, as scripts and other artifacts installed via --prefix will reference the installing interpreter, rather than any interpreter added to the --prefix directory, rendering them non-portable.

    -

    Unlike other install operations, this command does not require discovery of an existing Python environment and only searches for a Python interpreter to use for package resolution. If a suitable Python interpreter cannot be found, uv will install one. To disable this, add --no-python-downloads.

    -
    --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).

    -

    May also be set with the UV_PRERELEASE environment variable.

    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
    • -
    --project project

    Discover a project in the given directory.

    -

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    -

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    -

    See --directory to change the working directory entirely.

    -

    This setting has no effect when used in the uv pip interface.

    -

    May also be set with the UV_PROJECT environment variable.

    --python, -p python

    The Python interpreter into which packages should be installed.

    -

    By default, installation requires a virtual environment. A path to an alternative Python can -be provided, but it is only recommended in continuous integration (CI) environments and -should be used with caution, as it can modify the system Python installation.

    -

    See uv python for details on Python discovery and supported request formats.

    -

    May also be set with the UV_PYTHON environment variable.

    --python-platform python-platform

    The platform for which requirements should be installed.

    -

    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 aarch64-apple-darwin.

    -

    When targeting macOS (Darwin), the default minimum version is 13.0. Use MACOSX_DEPLOYMENT_TARGET to specify a different minimum version, e.g., 14.0.

    -

    When targeting iOS, the default minimum version is 13.0. Use IPHONEOS_DEPLOYMENT_TARGET to specify a different minimum version, e.g., 14.0.

    -

    When targeting Android, the default minimum Android API level is 24. Use ANDROID_API_LEVEL to specify a different minimum version, e.g., 26.

    -

    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: A 64-bit x86 Windows target
    • -
    • aarch64-pc-windows-msvc: An ARM64 Windows target
    • -
    • i686-pc-windows-msvc: A 32-bit x86 Windows target
    • -
    • x86_64-unknown-linux-gnu: An x86 Linux target. Equivalent to x86_64-manylinux_2_28
    • -
    • aarch64-apple-darwin: An ARM-based macOS target, as seen on Apple Silicon devices
    • -
    • x86_64-apple-darwin: An x86 macOS target
    • -
    • aarch64-unknown-linux-gnu: An ARM64 Linux target. Equivalent to aarch64-manylinux_2_28
    • -
    • aarch64-unknown-linux-musl: An ARM64 Linux target
    • -
    • x86_64-unknown-linux-musl: An x86_64 Linux target
    • -
    • riscv64-unknown-linux: A RISCV64 Linux target
    • -
    • x86_64-manylinux2014: An x86_64 target for the manylinux2014 platform. Equivalent to x86_64-manylinux_2_17
    • -
    • x86_64-manylinux_2_17: An x86_64 target for the manylinux_2_17 platform
    • -
    • x86_64-manylinux_2_28: An x86_64 target for the manylinux_2_28 platform
    • -
    • x86_64-manylinux_2_31: An x86_64 target for the manylinux_2_31 platform
    • -
    • x86_64-manylinux_2_32: An x86_64 target for the manylinux_2_32 platform
    • -
    • x86_64-manylinux_2_33: An x86_64 target for the manylinux_2_33 platform
    • -
    • x86_64-manylinux_2_34: An x86_64 target for the manylinux_2_34 platform
    • -
    • x86_64-manylinux_2_35: An x86_64 target for the manylinux_2_35 platform
    • -
    • x86_64-manylinux_2_36: An x86_64 target for the manylinux_2_36 platform
    • -
    • x86_64-manylinux_2_37: An x86_64 target for the manylinux_2_37 platform
    • -
    • x86_64-manylinux_2_38: An x86_64 target for the manylinux_2_38 platform
    • -
    • x86_64-manylinux_2_39: An x86_64 target for the manylinux_2_39 platform
    • -
    • x86_64-manylinux_2_40: An x86_64 target for the manylinux_2_40 platform
    • -
    • aarch64-manylinux2014: An ARM64 target for the manylinux2014 platform. Equivalent to aarch64-manylinux_2_17
    • -
    • aarch64-manylinux_2_17: An ARM64 target for the manylinux_2_17 platform
    • -
    • aarch64-manylinux_2_28: An ARM64 target for the manylinux_2_28 platform
    • -
    • aarch64-manylinux_2_31: An ARM64 target for the manylinux_2_31 platform
    • -
    • aarch64-manylinux_2_32: An ARM64 target for the manylinux_2_32 platform
    • -
    • aarch64-manylinux_2_33: An ARM64 target for the manylinux_2_33 platform
    • -
    • aarch64-manylinux_2_34: An ARM64 target for the manylinux_2_34 platform
    • -
    • aarch64-manylinux_2_35: An ARM64 target for the manylinux_2_35 platform
    • -
    • aarch64-manylinux_2_36: An ARM64 target for the manylinux_2_36 platform
    • -
    • aarch64-manylinux_2_37: An ARM64 target for the manylinux_2_37 platform
    • -
    • aarch64-manylinux_2_38: An ARM64 target for the manylinux_2_38 platform
    • -
    • aarch64-manylinux_2_39: An ARM64 target for the manylinux_2_39 platform
    • -
    • aarch64-manylinux_2_40: An ARM64 target for the manylinux_2_40 platform
    • -
    • aarch64-linux-android: An ARM64 Android target
    • -
    • x86_64-linux-android: An x86_64 Android target
    • -
    • wasm32-pyodide2024: A wasm32 target using the Pyodide 2024 platform. Meant for use with Python 3.12
    • -
    • arm64-apple-ios: An ARM64 target for iOS device
    • -
    • arm64-apple-ios-simulator: An ARM64 target for iOS simulator
    • -
    • x86_64-apple-ios-simulator: An x86_64 target for iOS simulator
    • -
    --python-version python-version

    The minimum Python version that should be supported by the requirements (e.g., 3.7 or 3.7.9).

    -

    If a patch version is omitted, the minimum patch version is assumed. For example, 3.7 is mapped to 3.7.0.

    -
    --quiet, -q

    Use quiet output.

    -

    Repeating this option, e.g., -qq, will enable a silent mode in which uv will write no output to stdout.

    -
    --refresh

    Refresh all cached data

    -
    --refresh-package refresh-package

    Refresh cached data for a specific package

    -
    --reinstall, --force-reinstall

    Reinstall all packages, regardless of whether they're already installed. Implies --refresh

    -
    --reinstall-package reinstall-package

    Reinstall a specific package, regardless of whether it's already installed. Implies --refresh-package

    -
    --require-hashes

    Require a matching hash for each requirement.

    -

    By default, uv will verify any available hashes in the requirements file, but will not require that all requirements have an associated hash.

    -

    When --require-hashes is enabled, all requirements must include a hash or set of hashes, and all requirements must either be pinned to exact versions (e.g., ==1.0.0), or be specified via direct URL.

    -

    Hash-checking mode introduces a number of additional constraints:

    -
      -
    • Git dependencies are not supported. - Editable installations are not supported. - Local dependencies are not supported, unless they point to a specific wheel (.whl) or source archive (.zip, .tar.gz), as opposed to a directory.
    • -
    -

    May also be set with the UV_REQUIRE_HASHES environment variable.

    --requirements, --requirement, -r requirements

    Install the packages listed in the given files.

    -

    The following formats are supported: requirements.txt, .py files with inline metadata, pylock.toml, pyproject.toml, setup.py, and setup.cfg.

    -

    If a pyproject.toml, setup.py, or setup.cfg file is provided, uv will extract the requirements for the relevant project.

    -

    If - is provided, then requirements will be read from stdin.

    -
    --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).

    -

    May also be set with the UV_RESOLUTION environment variable.

    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
    • -
    --strict

    Validate the Python environment after completing the installation, to detect packages with missing dependencies or other issues

    -
    --system

    Install packages into the system Python environment.

    -

    By default, uv installs into the virtual environment in the current working directory or any parent directory. The --system option instructs uv to instead use the first Python found in the system PATH.

    -

    WARNING: --system is intended for use in continuous integration (CI) environments and should be used with caution, as it can modify the system Python installation.

    -

    May also be set with the UV_SYSTEM_PYTHON environment variable.

    --target target

    Install packages into the specified directory, rather than into the virtual or system Python environment. The packages will be installed at the top-level of the directory.

    -

    Unlike other install operations, this command does not require discovery of an existing Python environment and only searches for a Python interpreter to use for package resolution. If a suitable Python interpreter cannot be found, uv will install one. To disable this, add --no-python-downloads.

    -
    --torch-backend torch-backend

    The backend to use when fetching packages in the PyTorch ecosystem (e.g., cpu, cu126, or auto)

    -

    When set, uv will ignore the configured index URLs for packages in the PyTorch ecosystem, and will instead use the defined backend.

    -

    For example, when set to cpu, uv will use the CPU-only PyTorch index; when set to cu126, uv will use the PyTorch index for CUDA 12.6.

    -

    The auto mode will attempt to detect the appropriate PyTorch index based on the currently installed CUDA drivers.

    -

    This option is in preview and may change in any future release.

    -

    May also be set with the UV_TORCH_BACKEND environment variable.

    Possible values:

    -
      -
    • auto: Select the appropriate PyTorch index based on the operating system and CUDA driver version
    • -
    • cpu: Use the CPU-only PyTorch index
    • -
    • cu130: Use the PyTorch index for CUDA 13.0
    • -
    • cu129: Use the PyTorch index for CUDA 12.9
    • -
    • cu128: Use the PyTorch index for CUDA 12.8
    • -
    • cu126: Use the PyTorch index for CUDA 12.6
    • -
    • cu125: Use the PyTorch index for CUDA 12.5
    • -
    • cu124: Use the PyTorch index for CUDA 12.4
    • -
    • cu123: Use the PyTorch index for CUDA 12.3
    • -
    • cu122: Use the PyTorch index for CUDA 12.2
    • -
    • cu121: Use the PyTorch index for CUDA 12.1
    • -
    • cu120: Use the PyTorch index for CUDA 12.0
    • -
    • cu118: Use the PyTorch index for CUDA 11.8
    • -
    • cu117: Use the PyTorch index for CUDA 11.7
    • -
    • cu116: Use the PyTorch index for CUDA 11.6
    • -
    • cu115: Use the PyTorch index for CUDA 11.5
    • -
    • cu114: Use the PyTorch index for CUDA 11.4
    • -
    • cu113: Use the PyTorch index for CUDA 11.3
    • -
    • cu112: Use the PyTorch index for CUDA 11.2
    • -
    • cu111: Use the PyTorch index for CUDA 11.1
    • -
    • cu110: Use the PyTorch index for CUDA 11.0
    • -
    • cu102: Use the PyTorch index for CUDA 10.2
    • -
    • cu101: Use the PyTorch index for CUDA 10.1
    • -
    • cu100: Use the PyTorch index for CUDA 10.0
    • -
    • cu92: Use the PyTorch index for CUDA 9.2
    • -
    • cu91: Use the PyTorch index for CUDA 9.1
    • -
    • cu90: Use the PyTorch index for CUDA 9.0
    • -
    • cu80: Use the PyTorch index for CUDA 8.0
    • -
    • rocm6.4: Use the PyTorch index for ROCm 6.4
    • -
    • rocm6.3: Use the PyTorch index for ROCm 6.3
    • -
    • rocm6.2.4: Use the PyTorch index for ROCm 6.2.4
    • -
    • rocm6.2: Use the PyTorch index for ROCm 6.2
    • -
    • rocm6.1: Use the PyTorch index for ROCm 6.1
    • -
    • rocm6.0: Use the PyTorch index for ROCm 6.0
    • -
    • rocm5.7: Use the PyTorch index for ROCm 5.7
    • -
    • rocm5.6: Use the PyTorch index for ROCm 5.6
    • -
    • rocm5.5: Use the PyTorch index for ROCm 5.5
    • -
    • rocm5.4.2: Use the PyTorch index for ROCm 5.4.2
    • -
    • rocm5.4: Use the PyTorch index for ROCm 5.4
    • -
    • rocm5.3: Use the PyTorch index for ROCm 5.3
    • -
    • rocm5.2: Use the PyTorch index for ROCm 5.2
    • -
    • rocm5.1.1: Use the PyTorch index for ROCm 5.1.1
    • -
    • rocm4.2: Use the PyTorch index for ROCm 4.2
    • -
    • rocm4.1: Use the PyTorch index for ROCm 4.1
    • -
    • rocm4.0.1: Use the PyTorch index for ROCm 4.0.1
    • -
    • xpu: Use the PyTorch index for Intel XPU
    • -
    --upgrade, -U

    Allow package upgrades, ignoring pinned versions in any existing output file. Implies --refresh

    -
    --upgrade-package, -P upgrade-package

    Allow upgrades for a specific package, ignoring pinned versions in any existing output file. Implies --refresh-package

    -
    --user
    --verbose, -v

    Use verbose output.

    -

    You can configure fine-grained logging using the RUST_LOG environment variable. (https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#directives)

    -
    - -### uv pip uninstall - -Uninstall packages from an environment - -

    Usage

    - -``` -uv pip uninstall [OPTIONS] > -``` - -

    Arguments

    - -
    PACKAGE

    Uninstall all listed packages

    -
    - -

    Options

    - -
    --allow-insecure-host, --trusted-host allow-insecure-host

    Allow insecure connections to a host.

    -

    Can be provided multiple times.

    -

    Expects to receive either a hostname (e.g., localhost), a host-port pair (e.g., localhost:8080), or a URL (e.g., https://localhost).

    -

    WARNING: Hosts included in this list will not be verified against the system's certificate store. Only use --allow-insecure-host in a secure network with verified sources, as it bypasses SSL verification and could expose you to MITM attacks.

    -

    May also be set with the UV_INSECURE_HOST environment variable.

    --break-system-packages

    Allow uv to modify an EXTERNALLY-MANAGED Python installation.

    -

    WARNING: --break-system-packages is intended for use in continuous integration (CI) environments, when installing into Python installations that are managed by an external package manager, like apt. It should be used with caution, as such Python installations explicitly recommend against modifications by other package managers (like uv or pip).

    -

    May also be set with the UV_BREAK_SYSTEM_PACKAGES environment variable.

    --cache-dir cache-dir

    Path to the cache directory.

    -

    Defaults to $XDG_CACHE_HOME/uv or $HOME/.cache/uv on macOS and Linux, and %LOCALAPPDATA%\uv\cache on Windows.

    -

    To view the location of the cache directory, run uv cache dir.

    -

    May also be set with the UV_CACHE_DIR environment variable.

    --color color-choice

    Control the use of color in output.

    -

    By default, uv will automatically detect support for colors when writing to a terminal.

    -

    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.

    -

    While uv configuration can be included in a pyproject.toml file, it is not allowed in this context.

    -

    May also be set with the UV_CONFIG_FILE environment variable.

    --directory directory

    Change to the given directory prior to running the command.

    -

    Relative paths are resolved with the given directory as the base.

    -

    See --project to only change the project root directory.

    -

    May also be set with the UV_WORKING_DIR environment variable.

    --dry-run

    Perform a dry run, i.e., don't actually uninstall anything but print the resulting plan

    -
    --help, -h

    Display the concise help for this command

    -
    --keyring-provider keyring-provider

    Attempt to use keyring for authentication for remote requirements files.

    -

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

    -

    Defaults to disabled.

    -

    May also be set with the UV_KEYRING_PROVIDER environment variable.

    Possible values:

    -
      -
    • disabled: Do not use keyring for credential lookup
    • -
    • subprocess: Use the keyring command for credential lookup
    • -
    --managed-python

    Require use of uv-managed Python versions.

    -

    By default, uv prefers using Python versions it manages. However, it will use system Python versions if a uv-managed Python is not installed. This option disables use of system Python versions.

    -

    May also be set with the UV_MANAGED_PYTHON environment variable.

    --native-tls

    Whether to load TLS certificates from the platform's native certificate store.

    -

    By default, uv loads certificates from the bundled webpki-roots crate. The webpki-roots are a reliable set of trust roots from Mozilla, and including them in uv improves portability and performance (especially on macOS).

    -

    However, in some cases, you may want to use the platform's native certificate store, especially if you're relying on a corporate trust root (e.g., for a mandatory proxy) that's included in your system's certificate store.

    -

    May also be set with the UV_NATIVE_TLS environment variable.

    --no-break-system-packages
    --no-cache, --no-cache-dir, -n

    Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation

    -

    May also be set with the UV_NO_CACHE environment variable.

    --no-config

    Avoid discovering configuration files (pyproject.toml, uv.toml).

    -

    Normally, configuration files are discovered in the current directory, parent directories, or user configuration directories.

    -

    May also be set with the UV_NO_CONFIG environment variable.

    --no-managed-python

    Disable use of uv-managed Python versions.

    -

    Instead, uv will search for a suitable Python version on the system.

    -

    May also be set with the UV_NO_MANAGED_PYTHON environment variable.

    --no-progress

    Hide all progress outputs.

    -

    For example, spinners or progress bars.

    -

    May also be set with the UV_NO_PROGRESS environment variable.

    --no-python-downloads

    Disable automatic downloads of Python.

    -
    --offline

    Disable network access.

    -

    When disabled, uv will only use locally cached data and locally available files.

    -

    May also be set with the UV_OFFLINE environment variable.

    --prefix prefix

    Uninstall packages from the specified --prefix directory

    -
    --project project

    Discover a project in the given directory.

    -

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    -

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    -

    See --directory to change the working directory entirely.

    -

    This setting has no effect when used in the uv pip interface.

    -

    May also be set with the UV_PROJECT environment variable.

    --python, -p python

    The Python interpreter from which packages should be uninstalled.

    -

    By default, uninstallation requires a virtual environment. A path to an alternative Python -can be provided, but it is only recommended in continuous integration (CI) environments and -should be used with caution, as it can modify the system Python installation.

    -

    See uv python for details on Python discovery and supported request formats.

    -

    May also be set with the UV_PYTHON environment variable.

    --quiet, -q

    Use quiet output.

    -

    Repeating this option, e.g., -qq, will enable a silent mode in which uv will write no output to stdout.

    -
    --requirements, --requirement, -r requirements

    Uninstall the packages listed in the given files.

    -

    The following formats are supported: requirements.txt, .py files with inline metadata, pylock.toml, pyproject.toml, setup.py, and setup.cfg.

    -
    --system

    Use the system Python to uninstall packages.

    -

    By default, uv uninstalls from the virtual environment in the current working directory or any parent directory. The --system option instructs uv to instead use the first Python found in the system PATH.

    -

    WARNING: --system is intended for use in continuous integration (CI) environments and should be used with caution, as it can modify the system Python installation.

    -

    May also be set with the UV_SYSTEM_PYTHON environment variable.

    --target target

    Uninstall packages from the specified --target directory

    -
    --verbose, -v

    Use verbose output.

    -

    You can configure fine-grained logging using the RUST_LOG environment variable. (https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#directives)

    -
    - -### uv pip freeze - -List, in requirements format, packages installed in an environment - -

    Usage

    - -``` -uv pip freeze [OPTIONS] -``` - -

    Options

    - -
    --allow-insecure-host, --trusted-host allow-insecure-host

    Allow insecure connections to a host.

    -

    Can be provided multiple times.

    -

    Expects to receive either a hostname (e.g., localhost), a host-port pair (e.g., localhost:8080), or a URL (e.g., https://localhost).

    -

    WARNING: Hosts included in this list will not be verified against the system's certificate store. Only use --allow-insecure-host in a secure network with verified sources, as it bypasses SSL verification and could expose you to MITM attacks.

    -

    May also be set with the UV_INSECURE_HOST environment variable.

    --cache-dir cache-dir

    Path to the cache directory.

    -

    Defaults to $XDG_CACHE_HOME/uv or $HOME/.cache/uv on macOS and Linux, and %LOCALAPPDATA%\uv\cache on Windows.

    -

    To view the location of the cache directory, run uv cache dir.

    -

    May also be set with the UV_CACHE_DIR environment variable.

    --color color-choice

    Control the use of color in output.

    -

    By default, uv will automatically detect support for colors when writing to a terminal.

    -

    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.

    -

    While uv configuration can be included in a pyproject.toml file, it is not allowed in this context.

    -

    May also be set with the UV_CONFIG_FILE environment variable.

    --directory directory

    Change to the given directory prior to running the command.

    -

    Relative paths are resolved with the given directory as the base.

    -

    See --project to only change the project root directory.

    -

    May also be set with the UV_WORKING_DIR environment variable.

    --exclude-editable

    Exclude any editable packages from output

    -
    --help, -h

    Display the concise help for this command

    -
    --managed-python

    Require use of uv-managed Python versions.

    -

    By default, uv prefers using Python versions it manages. However, it will use system Python versions if a uv-managed Python is not installed. This option disables use of system Python versions.

    -

    May also be set with the UV_MANAGED_PYTHON environment variable.

    --native-tls

    Whether to load TLS certificates from the platform's native certificate store.

    -

    By default, uv loads certificates from the bundled webpki-roots crate. The webpki-roots are a reliable set of trust roots from Mozilla, and including them in uv improves portability and performance (especially on macOS).

    -

    However, in some cases, you may want to use the platform's native certificate store, especially if you're relying on a corporate trust root (e.g., for a mandatory proxy) that's included in your system's certificate store.

    -

    May also be set with the UV_NATIVE_TLS environment variable.

    --no-cache, --no-cache-dir, -n

    Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation

    -

    May also be set with the UV_NO_CACHE environment variable.

    --no-config

    Avoid discovering configuration files (pyproject.toml, uv.toml).

    -

    Normally, configuration files are discovered in the current directory, parent directories, or user configuration directories.

    -

    May also be set with the UV_NO_CONFIG environment variable.

    --no-managed-python

    Disable use of uv-managed Python versions.

    -

    Instead, uv will search for a suitable Python version on the system.

    -

    May also be set with the UV_NO_MANAGED_PYTHON environment variable.

    --no-progress

    Hide all progress outputs.

    -

    For example, spinners or progress bars.

    -

    May also be set with the UV_NO_PROGRESS environment variable.

    --no-python-downloads

    Disable automatic downloads of Python.

    -
    --offline

    Disable network access.

    -

    When disabled, uv will only use locally cached data and locally available files.

    -

    May also be set with the UV_OFFLINE environment variable.

    --path paths

    Restrict to the specified installation path for listing packages (can be used multiple times)

    -
    --prefix prefix

    List packages from the specified --prefix directory

    -
    --project project

    Discover a project in the given directory.

    -

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    -

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    -

    See --directory to change the working directory entirely.

    -

    This setting has no effect when used in the uv pip interface.

    -

    May also be set with the UV_PROJECT environment variable.

    --python, -p python

    The Python interpreter for which packages should be listed.

    -

    By default, uv lists packages in a virtual environment but will show packages in a system -Python environment if no virtual environment is found.

    -

    See uv python for details on Python discovery and supported request formats.

    -

    May also be set with the UV_PYTHON environment variable.

    --quiet, -q

    Use quiet output.

    -

    Repeating this option, e.g., -qq, will enable a silent mode in which uv will write no output to stdout.

    -
    --strict

    Validate the Python environment, to detect packages with missing dependencies and other issues

    -
    --system

    List packages in the system Python environment.

    -

    Disables discovery of virtual environments.

    -

    See uv python for details on Python discovery.

    -

    May also be set with the UV_SYSTEM_PYTHON environment variable.

    --target target

    List packages from the specified --target directory

    -
    --verbose, -v

    Use verbose output.

    -

    You can configure fine-grained logging using the RUST_LOG environment variable. (https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#directives)

    -
    - -### uv pip list - -List, in tabular format, packages installed in an environment - -

    Usage

    - -``` -uv pip list [OPTIONS] -``` - -

    Options

    - -
    --allow-insecure-host, --trusted-host allow-insecure-host

    Allow insecure connections to a host.

    -

    Can be provided multiple times.

    -

    Expects to receive either a hostname (e.g., localhost), a host-port pair (e.g., localhost:8080), or a URL (e.g., https://localhost).

    -

    WARNING: Hosts included in this list will not be verified against the system's certificate store. Only use --allow-insecure-host in a secure network with verified sources, as it bypasses SSL verification and could expose you to MITM attacks.

    -

    May also be set with the UV_INSECURE_HOST environment variable.

    --cache-dir cache-dir

    Path to the cache directory.

    -

    Defaults to $XDG_CACHE_HOME/uv or $HOME/.cache/uv on macOS and Linux, and %LOCALAPPDATA%\uv\cache on Windows.

    -

    To view the location of the cache directory, run uv cache dir.

    -

    May also be set with the UV_CACHE_DIR environment variable.

    --color color-choice

    Control the use of color in output.

    -

    By default, uv will automatically detect support for colors when writing to a terminal.

    -

    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.

    -

    While uv configuration can be included in a pyproject.toml file, it is not allowed in this context.

    -

    May also be set with the UV_CONFIG_FILE environment variable.

    --default-index default-index

    The URL of the default package index (by default: https://pypi.org/simple).

    -

    Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

    -

    The index given by this flag is given lower priority than all other indexes specified via the --index flag.

    -

    May also be set with the UV_DEFAULT_INDEX environment variable.

    --directory directory

    Change to the given directory prior to running the command.

    -

    Relative paths are resolved with the given directory as the base.

    -

    See --project to only change the project root directory.

    -

    May also be set with the UV_WORKING_DIR environment variable.

    --editable, -e

    Only include editable projects

    -
    --exclude exclude

    Exclude the specified package(s) from the output

    -
    --exclude-editable

    Exclude any editable packages from output

    -
    --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 local dates in the same format (e.g., 2006-12-02) in your system's configured time zone.

    -

    May also be set with the UV_EXCLUDE_NEWER environment variable.

    --extra-index-url extra-index-url

    (Deprecated: use --index instead) Extra URLs of package indexes to use, in addition to --index-url.

    -

    Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

    -

    All indexes provided via this flag take priority over the index specified by --index-url (which defaults to PyPI). When multiple --extra-index-url flags are provided, earlier values take priority.

    -

    May also be set with the UV_EXTRA_INDEX_URL environment variable.

    Locations to search for candidate distributions, in addition to those found in the registry indexes.

    -

    If a path, the target must be a directory that contains packages as wheel files (.whl) or source distributions (e.g., .tar.gz or .zip) at the top level.

    -

    If a URL, the page must contain a flat list of links to package files adhering to the formats described above.

    -

    May also be set with the UV_FIND_LINKS environment variable.

    --format format

    Select the output format

    -

    [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
    • -
    --help, -h

    Display the concise help for this command

    -
    --index index

    The URLs to use when resolving dependencies, in addition to the default index.

    -

    Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

    -

    All indexes provided via this flag take priority over the index specified by --default-index (which defaults to PyPI). When multiple --index flags are provided, earlier values take priority.

    -

    Index names are not supported as values. Relative paths must be disambiguated from index names with ./ or ../ on Unix or .\\, ..\\, ./ or ../ on Windows.

    -

    May also be set with the UV_INDEX environment variable.

    --index-strategy index-strategy

    The strategy to use when resolving against multiple index URLs.

    -

    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-index). This prevents "dependency confusion" attacks, whereby an attacker can upload a malicious package under the same name to an alternate index.

    -

    May also be set with the UV_INDEX_STRATEGY environment variable.

    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
    • -
    --index-url, -i index-url

    (Deprecated: use --default-index instead) The URL of the Python package index (by default: https://pypi.org/simple).

    -

    Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

    -

    The index given by this flag is given lower priority than all other indexes specified via the --extra-index-url flag.

    -

    May also be set with the UV_INDEX_URL environment variable.

    --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.

    -

    May also be set with the UV_KEYRING_PROVIDER environment variable.

    Possible values:

    -
      -
    • disabled: Do not use keyring for credential lookup
    • -
    • subprocess: Use the keyring command for credential lookup
    • -
    --managed-python

    Require use of uv-managed Python versions.

    -

    By default, uv prefers using Python versions it manages. However, it will use system Python versions if a uv-managed Python is not installed. This option disables use of system Python versions.

    -

    May also be set with the UV_MANAGED_PYTHON environment variable.

    --native-tls

    Whether to load TLS certificates from the platform's native certificate store.

    -

    By default, uv loads certificates from the bundled webpki-roots crate. The webpki-roots are a reliable set of trust roots from Mozilla, and including them in uv improves portability and performance (especially on macOS).

    -

    However, in some cases, you may want to use the platform's native certificate store, especially if you're relying on a corporate trust root (e.g., for a mandatory proxy) that's included in your system's certificate store.

    -

    May also be set with the UV_NATIVE_TLS environment variable.

    --no-cache, --no-cache-dir, -n

    Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation

    -

    May also be set with the UV_NO_CACHE environment variable.

    --no-config

    Avoid discovering configuration files (pyproject.toml, uv.toml).

    -

    Normally, configuration files are discovered in the current directory, parent directories, or user configuration directories.

    -

    May also be set with the UV_NO_CONFIG environment variable.

    --no-index

    Ignore the registry index (e.g., PyPI), instead relying on direct URL dependencies and those provided via --find-links

    -
    --no-managed-python

    Disable use of uv-managed Python versions.

    -

    Instead, uv will search for a suitable Python version on the system.

    -

    May also be set with the UV_NO_MANAGED_PYTHON environment variable.

    --no-progress

    Hide all progress outputs.

    -

    For example, spinners or progress bars.

    -

    May also be set with the UV_NO_PROGRESS environment variable.

    --no-python-downloads

    Disable automatic downloads of Python.

    -
    --offline

    Disable network access.

    -

    When disabled, uv will only use locally cached data and locally available files.

    -

    May also be set with the UV_OFFLINE environment variable.

    --outdated

    List outdated packages.

    -

    The latest version of each package will be shown alongside the installed version. Up-to-date packages will be omitted from the output.

    -
    --prefix prefix

    List packages from the specified --prefix directory

    -
    --project project

    Discover a project in the given directory.

    -

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    -

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    -

    See --directory to change the working directory entirely.

    -

    This setting has no effect when used in the uv pip interface.

    -

    May also be set with the UV_PROJECT environment variable.

    --python, -p python

    The Python interpreter for which packages should be listed.

    -

    By default, uv lists packages in a virtual environment but will show packages in a system -Python environment if no virtual environment is found.

    -

    See uv python for details on Python discovery and supported request formats.

    -

    May also be set with the UV_PYTHON environment variable.

    --quiet, -q

    Use quiet output.

    -

    Repeating this option, e.g., -qq, will enable a silent mode in which uv will write no output to stdout.

    -
    --strict

    Validate the Python environment, to detect packages with missing dependencies and other issues

    -
    --system

    List packages in the system Python environment.

    -

    Disables discovery of virtual environments.

    -

    See uv python for details on Python discovery.

    -

    May also be set with the UV_SYSTEM_PYTHON environment variable.

    --target target

    List packages from the specified --target directory

    -
    --verbose, -v

    Use verbose output.

    -

    You can configure fine-grained logging using the RUST_LOG environment variable. (https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#directives)

    -
    - -### uv pip show - -Show information about one or more installed packages - -

    Usage

    - -``` -uv pip show [OPTIONS] [PACKAGE]... -``` - -

    Arguments

    - -
    PACKAGE

    The package(s) to display

    -
    - -

    Options

    - -
    --allow-insecure-host, --trusted-host allow-insecure-host

    Allow insecure connections to a host.

    -

    Can be provided multiple times.

    -

    Expects to receive either a hostname (e.g., localhost), a host-port pair (e.g., localhost:8080), or a URL (e.g., https://localhost).

    -

    WARNING: Hosts included in this list will not be verified against the system's certificate store. Only use --allow-insecure-host in a secure network with verified sources, as it bypasses SSL verification and could expose you to MITM attacks.

    -

    May also be set with the UV_INSECURE_HOST environment variable.

    --cache-dir cache-dir

    Path to the cache directory.

    -

    Defaults to $XDG_CACHE_HOME/uv or $HOME/.cache/uv on macOS and Linux, and %LOCALAPPDATA%\uv\cache on Windows.

    -

    To view the location of the cache directory, run uv cache dir.

    -

    May also be set with the UV_CACHE_DIR environment variable.

    --color color-choice

    Control the use of color in output.

    -

    By default, uv will automatically detect support for colors when writing to a terminal.

    -

    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.

    -

    While uv configuration can be included in a pyproject.toml file, it is not allowed in this context.

    -

    May also be set with the UV_CONFIG_FILE environment variable.

    --directory directory

    Change to the given directory prior to running the command.

    -

    Relative paths are resolved with the given directory as the base.

    -

    See --project to only change the project root directory.

    -

    May also be set with the UV_WORKING_DIR environment variable.

    --files, -f

    Show the full list of installed files for each package

    -
    --help, -h

    Display the concise help for this command

    -
    --managed-python

    Require use of uv-managed Python versions.

    -

    By default, uv prefers using Python versions it manages. However, it will use system Python versions if a uv-managed Python is not installed. This option disables use of system Python versions.

    -

    May also be set with the UV_MANAGED_PYTHON environment variable.

    --native-tls

    Whether to load TLS certificates from the platform's native certificate store.

    -

    By default, uv loads certificates from the bundled webpki-roots crate. The webpki-roots are a reliable set of trust roots from Mozilla, and including them in uv improves portability and performance (especially on macOS).

    -

    However, in some cases, you may want to use the platform's native certificate store, especially if you're relying on a corporate trust root (e.g., for a mandatory proxy) that's included in your system's certificate store.

    -

    May also be set with the UV_NATIVE_TLS environment variable.

    --no-cache, --no-cache-dir, -n

    Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation

    -

    May also be set with the UV_NO_CACHE environment variable.

    --no-config

    Avoid discovering configuration files (pyproject.toml, uv.toml).

    -

    Normally, configuration files are discovered in the current directory, parent directories, or user configuration directories.

    -

    May also be set with the UV_NO_CONFIG environment variable.

    --no-managed-python

    Disable use of uv-managed Python versions.

    -

    Instead, uv will search for a suitable Python version on the system.

    -

    May also be set with the UV_NO_MANAGED_PYTHON environment variable.

    --no-progress

    Hide all progress outputs.

    -

    For example, spinners or progress bars.

    -

    May also be set with the UV_NO_PROGRESS environment variable.

    --no-python-downloads

    Disable automatic downloads of Python.

    -
    --offline

    Disable network access.

    -

    When disabled, uv will only use locally cached data and locally available files.

    -

    May also be set with the UV_OFFLINE environment variable.

    --prefix prefix

    Show a package from the specified --prefix directory

    -
    --project project

    Discover a project in the given directory.

    -

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    -

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    -

    See --directory to change the working directory entirely.

    -

    This setting has no effect when used in the uv pip interface.

    -

    May also be set with the UV_PROJECT environment variable.

    --python, -p python

    The Python interpreter to find the package in.

    -

    By default, uv looks for packages in a virtual environment but will look for packages in a -system Python environment if no virtual environment is found.

    -

    See uv python for details on Python discovery and supported request formats.

    -

    May also be set with the UV_PYTHON environment variable.

    --quiet, -q

    Use quiet output.

    -

    Repeating this option, e.g., -qq, will enable a silent mode in which uv will write no output to stdout.

    -
    --strict

    Validate the Python environment, to detect packages with missing dependencies and other issues

    -
    --system

    Show a package in the system Python environment.

    -

    Disables discovery of virtual environments.

    -

    See uv python for details on Python discovery.

    -

    May also be set with the UV_SYSTEM_PYTHON environment variable.

    --target target

    Show a package from the specified --target directory

    -
    --verbose, -v

    Use verbose output.

    -

    You can configure fine-grained logging using the RUST_LOG environment variable. (https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#directives)

    -
    - -### uv pip tree - -Display the dependency tree for an environment - -

    Usage

    - -``` -uv pip tree [OPTIONS] -``` - -

    Options

    - -
    --allow-insecure-host, --trusted-host allow-insecure-host

    Allow insecure connections to a host.

    -

    Can be provided multiple times.

    -

    Expects to receive either a hostname (e.g., localhost), a host-port pair (e.g., localhost:8080), or a URL (e.g., https://localhost).

    -

    WARNING: Hosts included in this list will not be verified against the system's certificate store. Only use --allow-insecure-host in a secure network with verified sources, as it bypasses SSL verification and could expose you to MITM attacks.

    -

    May also be set with the UV_INSECURE_HOST environment variable.

    --cache-dir cache-dir

    Path to the cache directory.

    -

    Defaults to $XDG_CACHE_HOME/uv or $HOME/.cache/uv on macOS and Linux, and %LOCALAPPDATA%\uv\cache on Windows.

    -

    To view the location of the cache directory, run uv cache dir.

    -

    May also be set with the UV_CACHE_DIR environment variable.

    --color color-choice

    Control the use of color in output.

    -

    By default, uv will automatically detect support for colors when writing to a terminal.

    -

    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.

    -

    While uv configuration can be included in a pyproject.toml file, it is not allowed in this context.

    -

    May also be set with the UV_CONFIG_FILE environment variable.

    --default-index default-index

    The URL of the default package index (by default: https://pypi.org/simple).

    -

    Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

    -

    The index given by this flag is given lower priority than all other indexes specified via the --index flag.

    -

    May also be set with the UV_DEFAULT_INDEX environment variable.

    --depth, -d depth

    Maximum display depth of the dependency tree

    -

    [default: 255]

    --directory directory

    Change to the given directory prior to running the command.

    -

    Relative paths are resolved with the given directory as the base.

    -

    See --project to only change the project root directory.

    -

    May also be set with the UV_WORKING_DIR environment variable.

    --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 local dates in the same format (e.g., 2006-12-02) in your system's configured time zone.

    -

    May also be set with the UV_EXCLUDE_NEWER environment variable.

    --extra-index-url extra-index-url

    (Deprecated: use --index instead) Extra URLs of package indexes to use, in addition to --index-url.

    -

    Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

    -

    All indexes provided via this flag take priority over the index specified by --index-url (which defaults to PyPI). When multiple --extra-index-url flags are provided, earlier values take priority.

    -

    May also be set with the UV_EXTRA_INDEX_URL environment variable.

    Locations to search for candidate distributions, in addition to those found in the registry indexes.

    -

    If a path, the target must be a directory that contains packages as wheel files (.whl) or source distributions (e.g., .tar.gz or .zip) at the top level.

    -

    If a URL, the page must contain a flat list of links to package files adhering to the formats described above.

    -

    May also be set with the UV_FIND_LINKS environment variable.

    --help, -h

    Display the concise help for this command

    -
    --index index

    The URLs to use when resolving dependencies, in addition to the default index.

    -

    Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

    -

    All indexes provided via this flag take priority over the index specified by --default-index (which defaults to PyPI). When multiple --index flags are provided, earlier values take priority.

    -

    Index names are not supported as values. Relative paths must be disambiguated from index names with ./ or ../ on Unix or .\\, ..\\, ./ or ../ on Windows.

    -

    May also be set with the UV_INDEX environment variable.

    --index-strategy index-strategy

    The strategy to use when resolving against multiple index URLs.

    -

    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-index). This prevents "dependency confusion" attacks, whereby an attacker can upload a malicious package under the same name to an alternate index.

    -

    May also be set with the UV_INDEX_STRATEGY environment variable.

    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
    • -
    --index-url, -i index-url

    (Deprecated: use --default-index instead) The URL of the Python package index (by default: https://pypi.org/simple).

    -

    Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

    -

    The index given by this flag is given lower priority than all other indexes specified via the --extra-index-url flag.

    -

    May also be set with the UV_INDEX_URL environment variable.

    --invert, --reverse

    Show the reverse dependencies for the given package. This flag will invert the tree and display the packages that depend on the given package

    -
    --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.

    -

    May also be set with the UV_KEYRING_PROVIDER environment variable.

    Possible values:

    -
      -
    • disabled: Do not use keyring for credential lookup
    • -
    • subprocess: Use the keyring command for credential lookup
    • -
    --managed-python

    Require use of uv-managed Python versions.

    -

    By default, uv prefers using Python versions it manages. However, it will use system Python versions if a uv-managed Python is not installed. This option disables use of system Python versions.

    -

    May also be set with the UV_MANAGED_PYTHON environment variable.

    --native-tls

    Whether to load TLS certificates from the platform's native certificate store.

    -

    By default, uv loads certificates from the bundled webpki-roots crate. The webpki-roots are a reliable set of trust roots from Mozilla, and including them in uv improves portability and performance (especially on macOS).

    -

    However, in some cases, you may want to use the platform's native certificate store, especially if you're relying on a corporate trust root (e.g., for a mandatory proxy) that's included in your system's certificate store.

    -

    May also be set with the UV_NATIVE_TLS environment variable.

    --no-cache, --no-cache-dir, -n

    Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation

    -

    May also be set with the UV_NO_CACHE environment variable.

    --no-config

    Avoid discovering configuration files (pyproject.toml, uv.toml).

    -

    Normally, configuration files are discovered in the current directory, parent directories, or user configuration directories.

    -

    May also be set with the UV_NO_CONFIG environment variable.

    --no-dedupe

    Do not de-duplicate repeated dependencies. Usually, when a package has already displayed its dependencies, further occurrences will not re-display its dependencies, and will include a (*) to indicate it has already been shown. This flag will cause those duplicates to be repeated

    -
    --no-index

    Ignore the registry index (e.g., PyPI), instead relying on direct URL dependencies and those provided via --find-links

    -
    --no-managed-python

    Disable use of uv-managed Python versions.

    -

    Instead, uv will search for a suitable Python version on the system.

    -

    May also be set with the UV_NO_MANAGED_PYTHON environment variable.

    --no-progress

    Hide all progress outputs.

    -

    For example, spinners or progress bars.

    -

    May also be set with the UV_NO_PROGRESS environment variable.

    --no-python-downloads

    Disable automatic downloads of Python.

    -
    --offline

    Disable network access.

    -

    When disabled, uv will only use locally cached data and locally available files.

    -

    May also be set with the UV_OFFLINE environment variable.

    --outdated

    Show the latest available version of each package in the tree

    -
    --package package

    Display only the specified packages

    -
    --project project

    Discover a project in the given directory.

    -

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    -

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    -

    See --directory to change the working directory entirely.

    -

    This setting has no effect when used in the uv pip interface.

    -

    May also be set with the UV_PROJECT environment variable.

    --prune prune

    Prune the given package from the display of the dependency tree

    -
    --python, -p python

    The Python interpreter for which packages should be listed.

    -

    By default, uv lists packages in a virtual environment but will show packages in a system -Python environment if no virtual environment is found.

    -

    See uv python for details on Python discovery and supported request formats.

    -

    May also be set with the UV_PYTHON environment variable.

    --quiet, -q

    Use quiet output.

    -

    Repeating this option, e.g., -qq, will enable a silent mode in which uv will write no output to stdout.

    -
    --show-sizes

    Show compressed wheel sizes for packages in the tree

    -
    --show-version-specifiers

    Show the version constraint(s) imposed on each package

    -
    --strict

    Validate the Python environment, to detect packages with missing dependencies and other issues

    -
    --system

    List packages in the system Python environment.

    -

    Disables discovery of virtual environments.

    -

    See uv python for details on Python discovery.

    -

    May also be set with the UV_SYSTEM_PYTHON environment variable.

    --verbose, -v

    Use verbose output.

    -

    You can configure fine-grained logging using the RUST_LOG environment variable. (https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#directives)

    -
    - -### uv pip check - -Verify installed packages have compatible dependencies - -

    Usage

    - -``` -uv pip check [OPTIONS] -``` - -

    Options

    - -
    --allow-insecure-host, --trusted-host allow-insecure-host

    Allow insecure connections to a host.

    -

    Can be provided multiple times.

    -

    Expects to receive either a hostname (e.g., localhost), a host-port pair (e.g., localhost:8080), or a URL (e.g., https://localhost).

    -

    WARNING: Hosts included in this list will not be verified against the system's certificate store. Only use --allow-insecure-host in a secure network with verified sources, as it bypasses SSL verification and could expose you to MITM attacks.

    -

    May also be set with the UV_INSECURE_HOST environment variable.

    --cache-dir cache-dir

    Path to the cache directory.

    -

    Defaults to $XDG_CACHE_HOME/uv or $HOME/.cache/uv on macOS and Linux, and %LOCALAPPDATA%\uv\cache on Windows.

    -

    To view the location of the cache directory, run uv cache dir.

    -

    May also be set with the UV_CACHE_DIR environment variable.

    --color color-choice

    Control the use of color in output.

    -

    By default, uv will automatically detect support for colors when writing to a terminal.

    -

    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.

    -

    While uv configuration can be included in a pyproject.toml file, it is not allowed in this context.

    -

    May also be set with the UV_CONFIG_FILE environment variable.

    --directory directory

    Change to the given directory prior to running the command.

    -

    Relative paths are resolved with the given directory as the base.

    -

    See --project to only change the project root directory.

    -

    May also be set with the UV_WORKING_DIR environment variable.

    --help, -h

    Display the concise help for this command

    -
    --managed-python

    Require use of uv-managed Python versions.

    -

    By default, uv prefers using Python versions it manages. However, it will use system Python versions if a uv-managed Python is not installed. This option disables use of system Python versions.

    -

    May also be set with the UV_MANAGED_PYTHON environment variable.

    --native-tls

    Whether to load TLS certificates from the platform's native certificate store.

    -

    By default, uv loads certificates from the bundled webpki-roots crate. The webpki-roots are a reliable set of trust roots from Mozilla, and including them in uv improves portability and performance (especially on macOS).

    -

    However, in some cases, you may want to use the platform's native certificate store, especially if you're relying on a corporate trust root (e.g., for a mandatory proxy) that's included in your system's certificate store.

    -

    May also be set with the UV_NATIVE_TLS environment variable.

    --no-cache, --no-cache-dir, -n

    Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation

    -

    May also be set with the UV_NO_CACHE environment variable.

    --no-config

    Avoid discovering configuration files (pyproject.toml, uv.toml).

    -

    Normally, configuration files are discovered in the current directory, parent directories, or user configuration directories.

    -

    May also be set with the UV_NO_CONFIG environment variable.

    --no-managed-python

    Disable use of uv-managed Python versions.

    -

    Instead, uv will search for a suitable Python version on the system.

    -

    May also be set with the UV_NO_MANAGED_PYTHON environment variable.

    --no-progress

    Hide all progress outputs.

    -

    For example, spinners or progress bars.

    -

    May also be set with the UV_NO_PROGRESS environment variable.

    --no-python-downloads

    Disable automatic downloads of Python.

    -
    --offline

    Disable network access.

    -

    When disabled, uv will only use locally cached data and locally available files.

    -

    May also be set with the UV_OFFLINE environment variable.

    --project project

    Discover a project in the given directory.

    -

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    -

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    -

    See --directory to change the working directory entirely.

    -

    This setting has no effect when used in the uv pip interface.

    -

    May also be set with the UV_PROJECT environment variable.

    --python, -p python

    The Python interpreter for which packages should be checked.

    -

    By default, uv checks packages in a virtual environment but will check packages in a system -Python environment if no virtual environment is found.

    -

    See uv python for details on Python discovery and supported request formats.

    -

    May also be set with the UV_PYTHON environment variable.

    --python-platform python-platform

    The platform for which packages should be checked.

    -

    By default, the installed packages are checked against the platform of the current interpreter.

    -

    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 aarch64-apple-darwin.

    -

    When targeting macOS (Darwin), the default minimum version is 13.0. Use MACOSX_DEPLOYMENT_TARGET to specify a different minimum version, e.g., 14.0.

    -

    When targeting iOS, the default minimum version is 13.0. Use IPHONEOS_DEPLOYMENT_TARGET to specify a different minimum version, e.g., 14.0.

    -

    When targeting Android, the default minimum Android API level is 24. Use ANDROID_API_LEVEL to specify a different minimum version, e.g., 26.

    -

    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: A 64-bit x86 Windows target
    • -
    • aarch64-pc-windows-msvc: An ARM64 Windows target
    • -
    • i686-pc-windows-msvc: A 32-bit x86 Windows target
    • -
    • x86_64-unknown-linux-gnu: An x86 Linux target. Equivalent to x86_64-manylinux_2_28
    • -
    • aarch64-apple-darwin: An ARM-based macOS target, as seen on Apple Silicon devices
    • -
    • x86_64-apple-darwin: An x86 macOS target
    • -
    • aarch64-unknown-linux-gnu: An ARM64 Linux target. Equivalent to aarch64-manylinux_2_28
    • -
    • aarch64-unknown-linux-musl: An ARM64 Linux target
    • -
    • x86_64-unknown-linux-musl: An x86_64 Linux target
    • -
    • riscv64-unknown-linux: A RISCV64 Linux target
    • -
    • x86_64-manylinux2014: An x86_64 target for the manylinux2014 platform. Equivalent to x86_64-manylinux_2_17
    • -
    • x86_64-manylinux_2_17: An x86_64 target for the manylinux_2_17 platform
    • -
    • x86_64-manylinux_2_28: An x86_64 target for the manylinux_2_28 platform
    • -
    • x86_64-manylinux_2_31: An x86_64 target for the manylinux_2_31 platform
    • -
    • x86_64-manylinux_2_32: An x86_64 target for the manylinux_2_32 platform
    • -
    • x86_64-manylinux_2_33: An x86_64 target for the manylinux_2_33 platform
    • -
    • x86_64-manylinux_2_34: An x86_64 target for the manylinux_2_34 platform
    • -
    • x86_64-manylinux_2_35: An x86_64 target for the manylinux_2_35 platform
    • -
    • x86_64-manylinux_2_36: An x86_64 target for the manylinux_2_36 platform
    • -
    • x86_64-manylinux_2_37: An x86_64 target for the manylinux_2_37 platform
    • -
    • x86_64-manylinux_2_38: An x86_64 target for the manylinux_2_38 platform
    • -
    • x86_64-manylinux_2_39: An x86_64 target for the manylinux_2_39 platform
    • -
    • x86_64-manylinux_2_40: An x86_64 target for the manylinux_2_40 platform
    • -
    • aarch64-manylinux2014: An ARM64 target for the manylinux2014 platform. Equivalent to aarch64-manylinux_2_17
    • -
    • aarch64-manylinux_2_17: An ARM64 target for the manylinux_2_17 platform
    • -
    • aarch64-manylinux_2_28: An ARM64 target for the manylinux_2_28 platform
    • -
    • aarch64-manylinux_2_31: An ARM64 target for the manylinux_2_31 platform
    • -
    • aarch64-manylinux_2_32: An ARM64 target for the manylinux_2_32 platform
    • -
    • aarch64-manylinux_2_33: An ARM64 target for the manylinux_2_33 platform
    • -
    • aarch64-manylinux_2_34: An ARM64 target for the manylinux_2_34 platform
    • -
    • aarch64-manylinux_2_35: An ARM64 target for the manylinux_2_35 platform
    • -
    • aarch64-manylinux_2_36: An ARM64 target for the manylinux_2_36 platform
    • -
    • aarch64-manylinux_2_37: An ARM64 target for the manylinux_2_37 platform
    • -
    • aarch64-manylinux_2_38: An ARM64 target for the manylinux_2_38 platform
    • -
    • aarch64-manylinux_2_39: An ARM64 target for the manylinux_2_39 platform
    • -
    • aarch64-manylinux_2_40: An ARM64 target for the manylinux_2_40 platform
    • -
    • aarch64-linux-android: An ARM64 Android target
    • -
    • x86_64-linux-android: An x86_64 Android target
    • -
    • wasm32-pyodide2024: A wasm32 target using the Pyodide 2024 platform. Meant for use with Python 3.12
    • -
    • arm64-apple-ios: An ARM64 target for iOS device
    • -
    • arm64-apple-ios-simulator: An ARM64 target for iOS simulator
    • -
    • x86_64-apple-ios-simulator: An x86_64 target for iOS simulator
    • -
    --python-version python-version

    The Python version against which packages should be checked.

    -

    By default, the installed packages are checked against the version of the current interpreter.

    -
    --quiet, -q

    Use quiet output.

    -

    Repeating this option, e.g., -qq, will enable a silent mode in which uv will write no output to stdout.

    -
    --system

    Check packages in the system Python environment.

    -

    Disables discovery of virtual environments.

    -

    See uv python for details on Python discovery.

    -

    May also be set with the UV_SYSTEM_PYTHON environment variable.

    --verbose, -v

    Use verbose output.

    -

    You can configure fine-grained logging using the RUST_LOG environment variable. (https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#directives)

    -
    - -## uv venv - -Create a virtual environment. - -By default, creates a virtual environment named `.venv` in the working directory. An alternative path may be provided positionally. - -If in a project, the default environment name can be changed with the `UV_PROJECT_ENVIRONMENT` environment variable; this only applies when run from the project root directory. - -If a virtual environment exists at the target path, it will be removed and a new, empty virtual environment will be created. - -When using uv, the virtual environment does not need to be activated. uv will find a virtual environment (named `.venv`) in the working directory or any parent directories. - -

    Usage

    - -``` -uv venv [OPTIONS] [PATH] -``` - -

    Arguments

    - -
    PATH

    The path to the virtual environment to create.

    -

    Default to .venv in the working directory.

    -

    Relative paths are resolved relative to the working directory.

    -
    - -

    Options

    - -
    --allow-existing

    Preserve any existing files or directories at the target path.

    -

    By default, uv venv will exit with an error if the given path is non-empty. The --allow-existing option will instead write to the given path, regardless of its contents, and without clearing it beforehand.

    -

    WARNING: This option can lead to unexpected behavior if the existing virtual environment and the newly-created virtual environment are linked to different Python interpreters.

    -
    --allow-insecure-host, --trusted-host allow-insecure-host

    Allow insecure connections to a host.

    -

    Can be provided multiple times.

    -

    Expects to receive either a hostname (e.g., localhost), a host-port pair (e.g., localhost:8080), or a URL (e.g., https://localhost).

    -

    WARNING: Hosts included in this list will not be verified against the system's certificate store. Only use --allow-insecure-host in a secure network with verified sources, as it bypasses SSL verification and could expose you to MITM attacks.

    -

    May also be set with the UV_INSECURE_HOST environment variable.

    --cache-dir cache-dir

    Path to the cache directory.

    -

    Defaults to $XDG_CACHE_HOME/uv or $HOME/.cache/uv on macOS and Linux, and %LOCALAPPDATA%\uv\cache on Windows.

    -

    To view the location of the cache directory, run uv cache dir.

    -

    May also be set with the UV_CACHE_DIR environment variable.

    --clear, -c

    Remove any existing files or directories at the target path.

    -

    By default, uv venv will exit with an error if the given path is non-empty. The --clear option will instead clear a non-empty path before creating a new virtual environment.

    -

    May also be set with the UV_VENV_CLEAR environment variable.

    --color color-choice

    Control the use of color in output.

    -

    By default, uv will automatically detect support for colors when writing to a terminal.

    -

    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.

    -

    While uv configuration can be included in a pyproject.toml file, it is not allowed in this context.

    -

    May also be set with the UV_CONFIG_FILE environment variable.

    --default-index default-index

    The URL of the default package index (by default: https://pypi.org/simple).

    -

    Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

    -

    The index given by this flag is given lower priority than all other indexes specified via the --index flag.

    -

    May also be set with the UV_DEFAULT_INDEX environment variable.

    --directory directory

    Change to the given directory prior to running the command.

    -

    Relative paths are resolved with the given directory as the base.

    -

    See --project to only change the project root directory.

    -

    May also be set with the UV_WORKING_DIR environment variable.

    --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 local dates in the same format (e.g., 2006-12-02) in your system's configured time zone.

    -

    May also be set with the UV_EXCLUDE_NEWER environment variable.

    --exclude-newer-package exclude-newer-package

    Limit candidate packages for a specific package to those that were uploaded prior to the given date.

    -

    Accepts package-date pairs in the format PACKAGE=DATE, where DATE is an RFC 3339 timestamp (e.g., 2006-12-02T02:07:43Z) or local date (e.g., 2006-12-02) in your system's configured time zone.

    -

    Can be provided multiple times for different packages.

    -
    --extra-index-url extra-index-url

    (Deprecated: use --index instead) Extra URLs of package indexes to use, in addition to --index-url.

    -

    Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

    -

    All indexes provided via this flag take priority over the index specified by --index-url (which defaults to PyPI). When multiple --extra-index-url flags are provided, earlier values take priority.

    -

    May also be set with the UV_EXTRA_INDEX_URL environment variable.

    Locations to search for candidate distributions, in addition to those found in the registry indexes.

    -

    If a path, the target must be a directory that contains packages as wheel files (.whl) or source distributions (e.g., .tar.gz or .zip) at the top level.

    -

    If a URL, the page must contain a flat list of links to package files adhering to the formats described above.

    -

    May also be set with the UV_FIND_LINKS environment variable.

    --help, -h

    Display the concise help for this command

    -
    --index index

    The URLs to use when resolving dependencies, in addition to the default index.

    -

    Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

    -

    All indexes provided via this flag take priority over the index specified by --default-index (which defaults to PyPI). When multiple --index flags are provided, earlier values take priority.

    -

    Index names are not supported as values. Relative paths must be disambiguated from index names with ./ or ../ on Unix or .\\, ..\\, ./ or ../ on Windows.

    -

    May also be set with the UV_INDEX environment variable.

    --index-strategy index-strategy

    The strategy to use when resolving against multiple index URLs.

    -

    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-index). This prevents "dependency confusion" attacks, whereby an attacker can upload a malicious package under the same name to an alternate index.

    -

    May also be set with the UV_INDEX_STRATEGY environment variable.

    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
    • -
    --index-url, -i index-url

    (Deprecated: use --default-index instead) The URL of the Python package index (by default: https://pypi.org/simple).

    -

    Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

    -

    The index given by this flag is given lower priority than all other indexes specified via the --extra-index-url flag.

    -

    May also be set with the UV_INDEX_URL environment variable.

    --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.

    -

    May also be set with the UV_KEYRING_PROVIDER environment variable.

    Possible values:

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

    The method to use when installing packages from the global cache.

    -

    This option is only used for installing seed packages.

    -

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

    -

    WARNING: The use of symlink link mode is discouraged, as they create tight coupling between the cache and the target environment. For example, clearing the cache (uv cache clean) will break all installed packages by way of removing the underlying source files. Use symlinks with caution.

    -

    May also be set with the UV_LINK_MODE environment variable.

    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
    • -
    --managed-python

    Require use of uv-managed Python versions.

    -

    By default, uv prefers using Python versions it manages. However, it will use system Python versions if a uv-managed Python is not installed. This option disables use of system Python versions.

    -

    May also be set with the UV_MANAGED_PYTHON environment variable.

    --native-tls

    Whether to load TLS certificates from the platform's native certificate store.

    -

    By default, uv loads certificates from the bundled webpki-roots crate. The webpki-roots are a reliable set of trust roots from Mozilla, and including them in uv improves portability and performance (especially on macOS).

    -

    However, in some cases, you may want to use the platform's native certificate store, especially if you're relying on a corporate trust root (e.g., for a mandatory proxy) that's included in your system's certificate store.

    -

    May also be set with the UV_NATIVE_TLS environment variable.

    --no-cache, --no-cache-dir, -n

    Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation

    -

    May also be set with the UV_NO_CACHE environment variable.

    --no-config

    Avoid discovering configuration files (pyproject.toml, uv.toml).

    -

    Normally, configuration files are discovered in the current directory, parent directories, or user configuration directories.

    -

    May also be set with the UV_NO_CONFIG environment variable.

    --no-index

    Ignore the registry index (e.g., PyPI), instead relying on direct URL dependencies and those provided via --find-links

    -
    --no-managed-python

    Disable use of uv-managed Python versions.

    -

    Instead, uv will search for a suitable Python version on the system.

    -

    May also be set with the UV_NO_MANAGED_PYTHON environment variable.

    --no-progress

    Hide all progress outputs.

    -

    For example, spinners or progress bars.

    -

    May also be set with the UV_NO_PROGRESS environment variable.

    --no-project, --no-workspace

    Avoid discovering a project or workspace.

    -

    By default, uv searches for projects in the current directory or any parent directory to determine the default path of the virtual environment and check for Python version constraints, if any.

    -
    --no-python-downloads

    Disable automatic downloads of Python.

    -
    --offline

    Disable network access.

    -

    When disabled, uv will only use locally cached data and locally available files.

    -

    May also be set with the UV_OFFLINE environment variable.

    --project project

    Discover a project in the given directory.

    -

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    -

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    -

    See --directory to change the working directory entirely.

    -

    This setting has no effect when used in the uv pip interface.

    -

    May also be set with the UV_PROJECT environment variable.

    --prompt prompt

    Provide an alternative prompt prefix for the virtual environment.

    -

    By default, the prompt is dependent on whether a path was provided to uv venv. If provided -(e.g, uv venv project), the prompt is set to the directory name. If not provided -(uv venv), the prompt is set to the current directory's name.

    -

    If "." is provided, the current directory name will be used regardless of whether a path was -provided to uv venv.

    -
    --python, -p python

    The Python interpreter to use for the virtual environment.

    -

    During virtual environment creation, uv will not look for Python interpreters in virtual -environments.

    -

    See uv python for details on Python discovery and supported request formats.

    -

    May also be set with the UV_PYTHON environment variable.

    --quiet, -q

    Use quiet output.

    -

    Repeating this option, e.g., -qq, will enable a silent mode in which uv will write no output to stdout.

    -
    --refresh

    Refresh all cached data

    -
    --refresh-package refresh-package

    Refresh cached data for a specific package

    -
    --relocatable

    Make the virtual environment relocatable.

    -

    A relocatable virtual environment can be moved around and redistributed without invalidating its associated entrypoint and activation scripts.

    -

    Note that this can only be guaranteed for standard console_scripts and gui_scripts. Other scripts may be adjusted if they ship with a generic #!python[w] shebang, and binaries are left as-is.

    -

    As a result of making the environment relocatable (by way of writing relative, rather than absolute paths), the entrypoints and scripts themselves will not be relocatable. In other words, copying those entrypoints and scripts to a location outside the environment will not work, as they reference paths relative to the environment itself.

    -
    --seed

    Install seed packages (one or more of: pip, setuptools, and wheel) into the virtual environment.

    -

    Note that setuptools and wheel are not included in Python 3.12+ environments.

    -

    May also be set with the UV_VENV_SEED environment variable.

    --system-site-packages

    Give the virtual environment access to the system site packages directory.

    -

    Unlike pip, when a virtual environment is created with --system-site-packages, uv will not take system site packages into account when running commands like uv pip list or uv pip install. The --system-site-packages flag will provide the virtual environment with access to the system site packages directory at runtime, but will not affect the behavior of uv commands.

    -
    --verbose, -v

    Use verbose output.

    -

    You can configure fine-grained logging using the RUST_LOG environment variable. (https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#directives)

    -
    - -## uv build - -Build Python packages into source distributions and wheels. - -`uv build` accepts a path to a directory or source distribution, which defaults to the current working directory. - -By default, if passed a directory, `uv build` will build a source distribution ("sdist") from the source directory, and a binary distribution ("wheel") from the source distribution. - -`uv build --sdist` can be used to build only the source distribution, `uv build --wheel` can be used to build only the binary distribution, and `uv build --sdist --wheel` can be used to build both distributions from source. - -If passed a source distribution, `uv build --wheel` will build a wheel from the source distribution. - -

    Usage

    - -``` -uv build [OPTIONS] [SRC] -``` - -

    Arguments

    - -
    SRC

    The directory from which distributions should be built, or a source distribution archive to build into a wheel.

    -

    Defaults to the current working directory.

    -
    - -

    Options

    - -
    --all-packages, --all

    Builds all packages in the workspace.

    -

    The workspace will be discovered from the provided source directory, or the current directory if no source directory is provided.

    -

    If the workspace member does not exist, uv will exit with an error.

    -
    --allow-insecure-host, --trusted-host allow-insecure-host

    Allow insecure connections to a host.

    -

    Can be provided multiple times.

    -

    Expects to receive either a hostname (e.g., localhost), a host-port pair (e.g., localhost:8080), or a URL (e.g., https://localhost).

    -

    WARNING: Hosts included in this list will not be verified against the system's certificate store. Only use --allow-insecure-host in a secure network with verified sources, as it bypasses SSL verification and could expose you to MITM attacks.

    -

    May also be set with the UV_INSECURE_HOST environment variable.

    --build-constraints, --build-constraint, -b build-constraints

    Constrain build dependencies using the given requirements files when building distributions.

    -

    Constraints files are requirements.txt-like files that only control the version of a build dependency that's installed. However, including a package in a constraints file will not trigger the inclusion of that package on its own.

    -

    May also be set with the UV_BUILD_CONSTRAINT environment variable.

    --cache-dir cache-dir

    Path to the cache directory.

    -

    Defaults to $XDG_CACHE_HOME/uv or $HOME/.cache/uv on macOS and Linux, and %LOCALAPPDATA%\uv\cache on Windows.

    -

    To view the location of the cache directory, run uv cache dir.

    -

    May also be set with the UV_CACHE_DIR environment variable.

    --clear

    Clear the output directory before the build, removing stale artifacts

    -
    --color color-choice

    Control the use of color in output.

    -

    By default, uv will automatically detect support for colors when writing to a terminal.

    -

    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.

    -

    While uv configuration can be included in a pyproject.toml file, it is not allowed in this context.

    -

    May also be set with the UV_CONFIG_FILE environment variable.

    --config-setting, --config-settings, -C config-setting

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

    -
    --config-settings-package, --config-settings-package config-settings-package

    Settings to pass to the PEP 517 build backend for a specific package, specified as PACKAGE:KEY=VALUE pairs

    -
    --default-index default-index

    The URL of the default package index (by default: https://pypi.org/simple).

    -

    Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

    -

    The index given by this flag is given lower priority than all other indexes specified via the --index flag.

    -

    May also be set with the UV_DEFAULT_INDEX environment variable.

    --directory directory

    Change to the given directory prior to running the command.

    -

    Relative paths are resolved with the given directory as the base.

    -

    See --project to only change the project root directory.

    -

    May also be set with the UV_WORKING_DIR environment variable.

    --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 local dates in the same format (e.g., 2006-12-02) in your system's configured time zone.

    -

    May also be set with the UV_EXCLUDE_NEWER environment variable.

    --exclude-newer-package exclude-newer-package

    Limit candidate packages for a specific package to those that were uploaded prior to the given date.

    -

    Accepts package-date pairs in the format PACKAGE=DATE, where DATE is an RFC 3339 timestamp (e.g., 2006-12-02T02:07:43Z) or local date (e.g., 2006-12-02) in your system's configured time zone.

    -

    Can be provided multiple times for different packages.

    -
    --extra-index-url extra-index-url

    (Deprecated: use --index instead) Extra URLs of package indexes to use, in addition to --index-url.

    -

    Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

    -

    All indexes provided via this flag take priority over the index specified by --index-url (which defaults to PyPI). When multiple --extra-index-url flags are provided, earlier values take priority.

    -

    May also be set with the UV_EXTRA_INDEX_URL environment variable.

    Locations to search for candidate distributions, in addition to those found in the registry indexes.

    -

    If a path, the target must be a directory that contains packages as wheel files (.whl) or source distributions (e.g., .tar.gz or .zip) at the top level.

    -

    If a URL, the page must contain a flat list of links to package files adhering to the formats described above.

    -

    May also be set with the UV_FIND_LINKS environment variable.

    --force-pep517

    Always build through PEP 517, don't use the fast path for the uv build backend.

    -

    By default, uv won't create a PEP 517 build environment for packages using the uv build backend, but use a fast path that calls into the build backend directly. This option forces always using PEP 517.

    -
    --fork-strategy fork-strategy

    The strategy to use when selecting multiple versions of a given package across Python versions and platforms.

    -

    By default, uv will optimize for selecting the latest version of each package for each supported Python version (requires-python), while minimizing the number of selected versions across platforms.

    -

    Under fewest, uv will minimize the number of selected versions for each package, preferring older versions that are compatible with a wider range of supported Python versions or platforms.

    -

    May also be set with the UV_FORK_STRATEGY environment variable.

    Possible values:

    -
      -
    • fewest: Optimize for selecting the fewest number of versions for each package. Older versions may be preferred if they are compatible with a wider range of supported Python versions or platforms
    • -
    • requires-python: Optimize for selecting latest supported version of each package, for each supported Python version
    • -
    --help, -h

    Display the concise help for this command

    -
    --index index

    The URLs to use when resolving dependencies, in addition to the default index.

    -

    Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

    -

    All indexes provided via this flag take priority over the index specified by --default-index (which defaults to PyPI). When multiple --index flags are provided, earlier values take priority.

    -

    Index names are not supported as values. Relative paths must be disambiguated from index names with ./ or ../ on Unix or .\\, ..\\, ./ or ../ on Windows.

    -

    May also be set with the UV_INDEX environment variable.

    --index-strategy index-strategy

    The strategy to use when resolving against multiple index URLs.

    -

    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-index). This prevents "dependency confusion" attacks, whereby an attacker can upload a malicious package under the same name to an alternate index.

    -

    May also be set with the UV_INDEX_STRATEGY environment variable.

    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
    • -
    --index-url, -i index-url

    (Deprecated: use --default-index instead) The URL of the Python package index (by default: https://pypi.org/simple).

    -

    Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.

    -

    The index given by this flag is given lower priority than all other indexes specified via the --extra-index-url flag.

    -

    May also be set with the UV_INDEX_URL environment variable.

    --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.

    -

    May also be set with the UV_KEYRING_PROVIDER environment variable.

    Possible values:

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

    The method to use when installing packages from the global cache.

    -

    This option is only used when building source distributions.

    -

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

    -

    WARNING: The use of symlink link mode is discouraged, as they create tight coupling between the cache and the target environment. For example, clearing the cache (uv cache clean) will break all installed packages by way of removing the underlying source files. Use symlinks with caution.

    -

    May also be set with the UV_LINK_MODE environment variable.

    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
    • -
    --managed-python

    Require use of uv-managed Python versions.

    -

    By default, uv prefers using Python versions it manages. However, it will use system Python versions if a uv-managed Python is not installed. This option disables use of system Python versions.

    -

    May also be set with the UV_MANAGED_PYTHON environment variable.

    --native-tls

    Whether to load TLS certificates from the platform's native certificate store.

    -

    By default, uv loads certificates from the bundled webpki-roots crate. The webpki-roots are a reliable set of trust roots from Mozilla, and including them in uv improves portability and performance (especially on macOS).

    -

    However, in some cases, you may want to use the platform's native certificate store, especially if you're relying on a corporate trust root (e.g., for a mandatory proxy) that's included in your system's certificate store.

    -

    May also be set with the UV_NATIVE_TLS environment variable.

    --no-binary

    Don't install pre-built wheels.

    -

    The given packages will be built and installed from source. The resolver will still use pre-built wheels to extract package metadata, if available.

    -

    May also be set with the UV_NO_BINARY environment variable.

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

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

    -

    May also be set with the UV_NO_BINARY_PACKAGE environment variable.

    --no-build

    Don't build source distributions.

    -

    When enabled, resolving will not run arbitrary Python code. The cached wheels of already-built source distributions will be reused, but operations that require building distributions will exit with an error.

    -

    May also be set with the UV_NO_BUILD environment variable.

    --no-build-isolation

    Disable isolation when building source distributions.

    -

    Assumes that build dependencies specified by PEP 518 are already installed.

    -

    May also be set with the UV_NO_BUILD_ISOLATION environment variable.

    --no-build-isolation-package no-build-isolation-package

    Disable isolation when building source distributions for a specific package.

    -

    Assumes that the packages' build dependencies specified by PEP 518 are already installed.

    -
    --no-build-logs

    Hide logs from the build backend

    -
    --no-build-package no-build-package

    Don't build source distributions for a specific package

    -

    May also be set with the UV_NO_BUILD_PACKAGE environment variable.

    --no-cache, --no-cache-dir, -n

    Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation

    -

    May also be set with the UV_NO_CACHE environment variable.

    --no-config

    Avoid discovering configuration files (pyproject.toml, uv.toml).

    -

    Normally, configuration files are discovered in the current directory, parent directories, or user configuration directories.

    -

    May also be set with the UV_NO_CONFIG environment variable.

    --no-create-gitignore

    Do not create a .gitignore file in the output directory.

    -

    By default, uv creates a .gitignore file in the output directory to exclude build artifacts from version control. When this flag is used, the file will be omitted.

    -
    --no-index

    Ignore the registry index (e.g., PyPI), instead relying on direct URL dependencies and those provided via --find-links

    -
    --no-managed-python

    Disable use of uv-managed Python versions.

    -

    Instead, uv will search for a suitable Python version on the system.

    -

    May also be set with the UV_NO_MANAGED_PYTHON environment variable.

    --no-progress

    Hide all progress outputs.

    -

    For example, spinners or progress bars.

    -

    May also be set with the UV_NO_PROGRESS environment variable.

    --no-python-downloads

    Disable automatic downloads of Python.

    -
    --no-sources

    Ignore the tool.uv.sources table when resolving dependencies. Used to lock against the standards-compliant, publishable package metadata, as opposed to using any workspace, Git, URL, or local path sources

    -

    May also be set with the UV_NO_SOURCES environment variable.

    --no-verify-hashes

    Disable validation of hashes in the requirements file.

    -

    By default, uv will verify any available hashes in the requirements file, but will not require that all requirements have an associated hash. To enforce hash validation, use --require-hashes.

    -

    May also be set with the UV_NO_VERIFY_HASHES environment variable.

    --offline

    Disable network access.

    -

    When disabled, uv will only use locally cached data and locally available files.

    -

    May also be set with the UV_OFFLINE environment variable.

    --out-dir, -o out-dir

    The output directory to which distributions should be written.

    -

    Defaults to the dist subdirectory within the source directory, or the directory containing the source distribution archive.

    -
    --package package

    Build a specific package in the workspace.

    -

    The workspace will be discovered from the provided source directory, or the current directory if no source directory is provided.

    -

    If the workspace member does not exist, uv will exit with an error.

    -
    --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).

    -

    May also be set with the UV_PRERELEASE environment variable.

    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
    • -
    --project project

    Discover a project in the given directory.

    -

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    -

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    -

    See --directory to change the working directory entirely.

    -

    This setting has no effect when used in the uv pip interface.

    -

    May also be set with the UV_PROJECT environment variable.

    --python, -p python

    The Python interpreter to use for the build environment.

    -

    By default, builds are executed in isolated virtual environments. The discovered interpreter -will be used to create those environments, and will be symlinked or copied in depending on -the platform.

    -

    See uv python to view supported request formats.

    -

    May also be set with the UV_PYTHON environment variable.

    --quiet, -q

    Use quiet output.

    -

    Repeating this option, e.g., -qq, will enable a silent mode in which uv will write no output to stdout.

    -
    --refresh

    Refresh all cached data

    -
    --refresh-package refresh-package

    Refresh cached data for a specific package

    -
    --require-hashes

    Require a matching hash for each requirement.

    -

    By default, uv will verify any available hashes in the requirements file, but will not require that all requirements have an associated hash.

    -

    When --require-hashes is enabled, all requirements must include a hash or set of hashes, and all requirements must either be pinned to exact versions (e.g., ==1.0.0), or be specified via direct URL.

    -

    Hash-checking mode introduces a number of additional constraints:

    -
      -
    • Git dependencies are not supported. - Editable installations are not supported. - Local dependencies are not supported, unless they point to a specific wheel (.whl) or source archive (.zip, .tar.gz), as opposed to a directory.
    • -
    -

    May also be set with the UV_REQUIRE_HASHES environment variable.

    --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).

    -

    May also be set with the UV_RESOLUTION environment variable.

    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
    • -
    --sdist

    Build a source distribution ("sdist") from the given directory

    -
    --upgrade, -U

    Allow package upgrades, ignoring pinned versions in any existing output file. Implies --refresh

    -
    --upgrade-package, -P upgrade-package

    Allow upgrades for a specific package, ignoring pinned versions in any existing output file. Implies --refresh-package

    -
    --verbose, -v

    Use verbose output.

    -

    You can configure fine-grained logging using the RUST_LOG environment variable. (https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#directives)

    -
    --wheel

    Build a binary distribution ("wheel") from the given directory

    -
    - -## uv publish - -Upload distributions to an index - -

    Usage

    - -``` -uv publish [OPTIONS] [FILES]... -``` - -

    Arguments

    - -
    FILES

    Paths to the files to upload. Accepts glob expressions.

    -

    Defaults to the dist directory. Selects only wheels and source distributions and their attestations, while ignoring other files.

    -
    - -

    Options

    - -
    --allow-insecure-host, --trusted-host allow-insecure-host

    Allow insecure connections to a host.

    -

    Can be provided multiple times.

    -

    Expects to receive either a hostname (e.g., localhost), a host-port pair (e.g., localhost:8080), or a URL (e.g., https://localhost).

    -

    WARNING: Hosts included in this list will not be verified against the system's certificate store. Only use --allow-insecure-host in a secure network with verified sources, as it bypasses SSL verification and could expose you to MITM attacks.

    -

    May also be set with the UV_INSECURE_HOST environment variable.

    --cache-dir cache-dir

    Path to the cache directory.

    -

    Defaults to $XDG_CACHE_HOME/uv or $HOME/.cache/uv on macOS and Linux, and %LOCALAPPDATA%\uv\cache on Windows.

    -

    To view the location of the cache directory, run uv cache dir.

    -

    May also be set with the UV_CACHE_DIR environment variable.

    --check-url check-url

    Check an index URL for existing files to skip duplicate uploads.

    -

    This option allows retrying publishing that failed after only some, but not all files have been uploaded, and handles errors due to parallel uploads of the same file.

    -

    Before uploading, the index is checked. If the exact same file already exists in the index, the file will not be uploaded. If an error occurred during the upload, the index is checked again, to handle cases where the identical file was uploaded twice in parallel.

    -

    The exact behavior will vary based on the index. When uploading to PyPI, uploading the same file succeeds even without --check-url, while most other indexes error. When uploading to pyx, the index URL can be inferred automatically from the publish URL.

    -

    The index must provide one of the supported hashes (SHA-256, SHA-384, or SHA-512).

    -

    May also be set with the UV_PUBLISH_CHECK_URL environment variable.

    --color color-choice

    Control the use of color in output.

    -

    By default, uv will automatically detect support for colors when writing to a terminal.

    -

    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.

    -

    While uv configuration can be included in a pyproject.toml file, it is not allowed in this context.

    -

    May also be set with the UV_CONFIG_FILE environment variable.

    --directory directory

    Change to the given directory prior to running the command.

    -

    Relative paths are resolved with the given directory as the base.

    -

    See --project to only change the project root directory.

    -

    May also be set with the UV_WORKING_DIR environment variable.

    --dry-run

    Perform a dry run without uploading files.

    -

    When enabled, the command will check for existing files if --check-url is provided, and will perform validation against the index if supported, but will not upload any files.

    -
    --help, -h

    Display the concise help for this command

    -
    --index index

    The name of an index in the configuration to use for publishing.

    -

    The index must have a publish-url setting, for example:

    -
    [[tool.uv.index]]
    -name = "pypi"
    -url = "https://pypi.org/simple"
    -publish-url = "https://upload.pypi.org/legacy/"
    -
    -

    The index url will be used to check for existing files to skip duplicate uploads.

    -

    With these settings, the following two calls are equivalent:

    -
    uv publish --index pypi
    -uv publish --publish-url https://upload.pypi.org/legacy/ --check-url https://pypi.org/simple
    -
    -

    May also be set with the UV_PUBLISH_INDEX environment variable.

    --keyring-provider keyring-provider

    Attempt to use keyring for authentication for remote requirements files.

    -

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

    -

    Defaults to disabled.

    -

    May also be set with the UV_KEYRING_PROVIDER environment variable.

    Possible values:

    -
      -
    • disabled: Do not use keyring for credential lookup
    • -
    • subprocess: Use the keyring command for credential lookup
    • -
    --managed-python

    Require use of uv-managed Python versions.

    -

    By default, uv prefers using Python versions it manages. However, it will use system Python versions if a uv-managed Python is not installed. This option disables use of system Python versions.

    -

    May also be set with the UV_MANAGED_PYTHON environment variable.

    --native-tls

    Whether to load TLS certificates from the platform's native certificate store.

    -

    By default, uv loads certificates from the bundled webpki-roots crate. The webpki-roots are a reliable set of trust roots from Mozilla, and including them in uv improves portability and performance (especially on macOS).

    -

    However, in some cases, you may want to use the platform's native certificate store, especially if you're relying on a corporate trust root (e.g., for a mandatory proxy) that's included in your system's certificate store.

    -

    May also be set with the UV_NATIVE_TLS environment variable.

    --no-attestations

    Do not upload attestations for the published files.

    -

    By default, uv attempts to upload matching PEP 740 attestations with each distribution that is published.

    -

    May also be set with the UV_PUBLISH_NO_ATTESTATIONS environment variable.

    --no-cache, --no-cache-dir, -n

    Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation

    -

    May also be set with the UV_NO_CACHE environment variable.

    --no-config

    Avoid discovering configuration files (pyproject.toml, uv.toml).

    -

    Normally, configuration files are discovered in the current directory, parent directories, or user configuration directories.

    -

    May also be set with the UV_NO_CONFIG environment variable.

    --no-managed-python

    Disable use of uv-managed Python versions.

    -

    Instead, uv will search for a suitable Python version on the system.

    -

    May also be set with the UV_NO_MANAGED_PYTHON environment variable.

    --no-progress

    Hide all progress outputs.

    -

    For example, spinners or progress bars.

    -

    May also be set with the UV_NO_PROGRESS environment variable.

    --no-python-downloads

    Disable automatic downloads of Python.

    -
    --offline

    Disable network access.

    -

    When disabled, uv will only use locally cached data and locally available files.

    -

    May also be set with the UV_OFFLINE environment variable.

    --password, -p password

    The password for the upload

    -

    May also be set with the UV_PUBLISH_PASSWORD environment variable.

    --project project

    Discover a project in the given directory.

    -

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    -

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    -

    See --directory to change the working directory entirely.

    -

    This setting has no effect when used in the uv pip interface.

    -

    May also be set with the UV_PROJECT environment variable.

    --publish-url publish-url

    The URL of the upload endpoint (not the index URL).

    -

    Note that there are typically different URLs for index access (e.g., https:://.../simple) and index upload.

    -

    Defaults to PyPI's publish URL (https://upload.pypi.org/legacy/).

    -

    May also be set with the UV_PUBLISH_URL environment variable.

    --quiet, -q

    Use quiet output.

    -

    Repeating this option, e.g., -qq, will enable a silent mode in which uv will write no output to stdout.

    -
    --token, -t token

    The token for the upload.

    -

    Using a token is equivalent to passing __token__ as --username and the token as --password password.

    -

    May also be set with the UV_PUBLISH_TOKEN environment variable.

    --trusted-publishing trusted-publishing

    Configure trusted publishing.

    -

    By default, uv checks for trusted publishing when running in a supported environment, but ignores it if it isn't configured.

    -

    uv's supported environments for trusted publishing include GitHub Actions and GitLab CI/CD.

    -

    Possible values:

    -
      -
    • automatic: Attempt trusted publishing when we're in a supported environment, continue if that fails
    • -
    • always
    • -
    • never
    • -
    --username, -u username

    The username for the upload

    -

    May also be set with the UV_PUBLISH_USERNAME environment variable.

    --verbose, -v

    Use verbose output.

    -

    You can configure fine-grained logging using the RUST_LOG environment variable. (https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#directives)

    -
    - -## uv cache - -Manage uv's cache - -

    Usage

    - -``` -uv cache [OPTIONS] -``` - -

    Commands

    - -
    uv cache clean

    Clear the cache, removing all entries or those linked to specific packages

    -
    uv cache prune

    Prune all unreachable objects from the cache

    -
    uv cache dir

    Show the cache directory

    -
    uv cache size

    Show the cache size

    -
    - -### uv cache clean - -Clear the cache, removing all entries or those linked to specific packages - -

    Usage

    - -``` -uv cache clean [OPTIONS] [PACKAGE]... -``` - -

    Arguments

    - -
    PACKAGE

    The packages to remove from the cache

    -
    - -

    Options

    - -
    --allow-insecure-host, --trusted-host allow-insecure-host

    Allow insecure connections to a host.

    -

    Can be provided multiple times.

    -

    Expects to receive either a hostname (e.g., localhost), a host-port pair (e.g., localhost:8080), or a URL (e.g., https://localhost).

    -

    WARNING: Hosts included in this list will not be verified against the system's certificate store. Only use --allow-insecure-host in a secure network with verified sources, as it bypasses SSL verification and could expose you to MITM attacks.

    -

    May also be set with the UV_INSECURE_HOST environment variable.

    --cache-dir cache-dir

    Path to the cache directory.

    -

    Defaults to $XDG_CACHE_HOME/uv or $HOME/.cache/uv on macOS and Linux, and %LOCALAPPDATA%\uv\cache on Windows.

    -

    To view the location of the cache directory, run uv cache dir.

    -

    May also be set with the UV_CACHE_DIR environment variable.

    --color color-choice

    Control the use of color in output.

    -

    By default, uv will automatically detect support for colors when writing to a terminal.

    -

    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.

    -

    While uv configuration can be included in a pyproject.toml file, it is not allowed in this context.

    -

    May also be set with the UV_CONFIG_FILE environment variable.

    --directory directory

    Change to the given directory prior to running the command.

    -

    Relative paths are resolved with the given directory as the base.

    -

    See --project to only change the project root directory.

    -

    May also be set with the UV_WORKING_DIR environment variable.

    --force

    Force removal of the cache, ignoring in-use checks.

    -

    By default, uv cache clean will block until no process is reading the cache. When --force is used, uv cache clean will proceed without taking a lock.

    -
    --help, -h

    Display the concise help for this command

    -
    --managed-python

    Require use of uv-managed Python versions.

    -

    By default, uv prefers using Python versions it manages. However, it will use system Python versions if a uv-managed Python is not installed. This option disables use of system Python versions.

    -

    May also be set with the UV_MANAGED_PYTHON environment variable.

    --native-tls

    Whether to load TLS certificates from the platform's native certificate store.

    -

    By default, uv loads certificates from the bundled webpki-roots crate. The webpki-roots are a reliable set of trust roots from Mozilla, and including them in uv improves portability and performance (especially on macOS).

    -

    However, in some cases, you may want to use the platform's native certificate store, especially if you're relying on a corporate trust root (e.g., for a mandatory proxy) that's included in your system's certificate store.

    -

    May also be set with the UV_NATIVE_TLS environment variable.

    --no-cache, --no-cache-dir, -n

    Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation

    -

    May also be set with the UV_NO_CACHE environment variable.

    --no-config

    Avoid discovering configuration files (pyproject.toml, uv.toml).

    -

    Normally, configuration files are discovered in the current directory, parent directories, or user configuration directories.

    -

    May also be set with the UV_NO_CONFIG environment variable.

    --no-managed-python

    Disable use of uv-managed Python versions.

    -

    Instead, uv will search for a suitable Python version on the system.

    -

    May also be set with the UV_NO_MANAGED_PYTHON environment variable.

    --no-progress

    Hide all progress outputs.

    -

    For example, spinners or progress bars.

    -

    May also be set with the UV_NO_PROGRESS environment variable.

    --no-python-downloads

    Disable automatic downloads of Python.

    -
    --offline

    Disable network access.

    -

    When disabled, uv will only use locally cached data and locally available files.

    -

    May also be set with the UV_OFFLINE environment variable.

    --project project

    Discover a project in the given directory.

    -

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    -

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    -

    See --directory to change the working directory entirely.

    -

    This setting has no effect when used in the uv pip interface.

    -

    May also be set with the UV_PROJECT environment variable.

    --quiet, -q

    Use quiet output.

    -

    Repeating this option, e.g., -qq, will enable a silent mode in which uv will write no output to stdout.

    -
    --verbose, -v

    Use verbose output.

    -

    You can configure fine-grained logging using the RUST_LOG environment variable. (https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#directives)

    -
    - -### uv cache prune - -Prune all unreachable objects from the cache - -

    Usage

    - -``` -uv cache prune [OPTIONS] -``` - -

    Options

    - -
    --allow-insecure-host, --trusted-host allow-insecure-host

    Allow insecure connections to a host.

    -

    Can be provided multiple times.

    -

    Expects to receive either a hostname (e.g., localhost), a host-port pair (e.g., localhost:8080), or a URL (e.g., https://localhost).

    -

    WARNING: Hosts included in this list will not be verified against the system's certificate store. Only use --allow-insecure-host in a secure network with verified sources, as it bypasses SSL verification and could expose you to MITM attacks.

    -

    May also be set with the UV_INSECURE_HOST environment variable.

    --cache-dir cache-dir

    Path to the cache directory.

    -

    Defaults to $XDG_CACHE_HOME/uv or $HOME/.cache/uv on macOS and Linux, and %LOCALAPPDATA%\uv\cache on Windows.

    -

    To view the location of the cache directory, run uv cache dir.

    -

    May also be set with the UV_CACHE_DIR environment variable.

    --ci

    Optimize the cache for persistence in a continuous integration environment, like GitHub Actions.

    -

    By default, uv caches both the wheels that it builds from source and the pre-built wheels that it downloads directly, to enable high-performance package installation. In some scenarios, though, persisting pre-built wheels may be undesirable. For example, in GitHub Actions, it's faster to omit pre-built wheels from the cache and instead have re-download them on each run. However, it typically is faster to cache wheels that are built from source, since the wheel building process can be expensive, especially for extension modules.

    -

    In --ci mode, uv will prune any pre-built wheels from the cache, but retain any wheels that were built from source.

    -
    --color color-choice

    Control the use of color in output.

    -

    By default, uv will automatically detect support for colors when writing to a terminal.

    -

    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.

    -

    While uv configuration can be included in a pyproject.toml file, it is not allowed in this context.

    -

    May also be set with the UV_CONFIG_FILE environment variable.

    --directory directory

    Change to the given directory prior to running the command.

    -

    Relative paths are resolved with the given directory as the base.

    -

    See --project to only change the project root directory.

    -

    May also be set with the UV_WORKING_DIR environment variable.

    --force

    Force removal of the cache, ignoring in-use checks.

    -

    By default, uv cache prune will block until no process is reading the cache. When --force is used, uv cache prune will proceed without taking a lock.

    -
    --help, -h

    Display the concise help for this command

    -
    --managed-python

    Require use of uv-managed Python versions.

    -

    By default, uv prefers using Python versions it manages. However, it will use system Python versions if a uv-managed Python is not installed. This option disables use of system Python versions.

    -

    May also be set with the UV_MANAGED_PYTHON environment variable.

    --native-tls

    Whether to load TLS certificates from the platform's native certificate store.

    -

    By default, uv loads certificates from the bundled webpki-roots crate. The webpki-roots are a reliable set of trust roots from Mozilla, and including them in uv improves portability and performance (especially on macOS).

    -

    However, in some cases, you may want to use the platform's native certificate store, especially if you're relying on a corporate trust root (e.g., for a mandatory proxy) that's included in your system's certificate store.

    -

    May also be set with the UV_NATIVE_TLS environment variable.

    --no-cache, --no-cache-dir, -n

    Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation

    -

    May also be set with the UV_NO_CACHE environment variable.

    --no-config

    Avoid discovering configuration files (pyproject.toml, uv.toml).

    -

    Normally, configuration files are discovered in the current directory, parent directories, or user configuration directories.

    -

    May also be set with the UV_NO_CONFIG environment variable.

    --no-managed-python

    Disable use of uv-managed Python versions.

    -

    Instead, uv will search for a suitable Python version on the system.

    -

    May also be set with the UV_NO_MANAGED_PYTHON environment variable.

    --no-progress

    Hide all progress outputs.

    -

    For example, spinners or progress bars.

    -

    May also be set with the UV_NO_PROGRESS environment variable.

    --no-python-downloads

    Disable automatic downloads of Python.

    -
    --offline

    Disable network access.

    -

    When disabled, uv will only use locally cached data and locally available files.

    -

    May also be set with the UV_OFFLINE environment variable.

    --project project

    Discover a project in the given directory.

    -

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    -

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    -

    See --directory to change the working directory entirely.

    -

    This setting has no effect when used in the uv pip interface.

    -

    May also be set with the UV_PROJECT environment variable.

    --quiet, -q

    Use quiet output.

    -

    Repeating this option, e.g., -qq, will enable a silent mode in which uv will write no output to stdout.

    -
    --verbose, -v

    Use verbose output.

    -

    You can configure fine-grained logging using the RUST_LOG environment variable. (https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#directives)

    -
    - -### uv cache dir - -Show the cache directory. - -By default, the cache is stored in `$XDG_CACHE_HOME/uv` or `$HOME/.cache/uv` on Unix and `%LOCALAPPDATA%\uv\cache` on Windows. - -When `--no-cache` is used, the cache is stored in a temporary directory and discarded when the process exits. - -An alternative cache directory may be specified via the `cache-dir` setting, the `--cache-dir` option, or the `$UV_CACHE_DIR` environment variable. - -Note that it is important for performance for the cache directory to be located on the same file system as the Python environment uv is operating on. - -

    Usage

    - -``` -uv cache dir [OPTIONS] -``` - -

    Options

    - -
    --allow-insecure-host, --trusted-host allow-insecure-host

    Allow insecure connections to a host.

    -

    Can be provided multiple times.

    -

    Expects to receive either a hostname (e.g., localhost), a host-port pair (e.g., localhost:8080), or a URL (e.g., https://localhost).

    -

    WARNING: Hosts included in this list will not be verified against the system's certificate store. Only use --allow-insecure-host in a secure network with verified sources, as it bypasses SSL verification and could expose you to MITM attacks.

    -

    May also be set with the UV_INSECURE_HOST environment variable.

    --cache-dir cache-dir

    Path to the cache directory.

    -

    Defaults to $XDG_CACHE_HOME/uv or $HOME/.cache/uv on macOS and Linux, and %LOCALAPPDATA%\uv\cache on Windows.

    -

    To view the location of the cache directory, run uv cache dir.

    -

    May also be set with the UV_CACHE_DIR environment variable.

    --color color-choice

    Control the use of color in output.

    -

    By default, uv will automatically detect support for colors when writing to a terminal.

    -

    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.

    -

    While uv configuration can be included in a pyproject.toml file, it is not allowed in this context.

    -

    May also be set with the UV_CONFIG_FILE environment variable.

    --directory directory

    Change to the given directory prior to running the command.

    -

    Relative paths are resolved with the given directory as the base.

    -

    See --project to only change the project root directory.

    -

    May also be set with the UV_WORKING_DIR environment variable.

    --help, -h

    Display the concise help for this command

    -
    --managed-python

    Require use of uv-managed Python versions.

    -

    By default, uv prefers using Python versions it manages. However, it will use system Python versions if a uv-managed Python is not installed. This option disables use of system Python versions.

    -

    May also be set with the UV_MANAGED_PYTHON environment variable.

    --native-tls

    Whether to load TLS certificates from the platform's native certificate store.

    -

    By default, uv loads certificates from the bundled webpki-roots crate. The webpki-roots are a reliable set of trust roots from Mozilla, and including them in uv improves portability and performance (especially on macOS).

    -

    However, in some cases, you may want to use the platform's native certificate store, especially if you're relying on a corporate trust root (e.g., for a mandatory proxy) that's included in your system's certificate store.

    -

    May also be set with the UV_NATIVE_TLS environment variable.

    --no-cache, --no-cache-dir, -n

    Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation

    -

    May also be set with the UV_NO_CACHE environment variable.

    --no-config

    Avoid discovering configuration files (pyproject.toml, uv.toml).

    -

    Normally, configuration files are discovered in the current directory, parent directories, or user configuration directories.

    -

    May also be set with the UV_NO_CONFIG environment variable.

    --no-managed-python

    Disable use of uv-managed Python versions.

    -

    Instead, uv will search for a suitable Python version on the system.

    -

    May also be set with the UV_NO_MANAGED_PYTHON environment variable.

    --no-progress

    Hide all progress outputs.

    -

    For example, spinners or progress bars.

    -

    May also be set with the UV_NO_PROGRESS environment variable.

    --no-python-downloads

    Disable automatic downloads of Python.

    -
    --offline

    Disable network access.

    -

    When disabled, uv will only use locally cached data and locally available files.

    -

    May also be set with the UV_OFFLINE environment variable.

    --project project

    Discover a project in the given directory.

    -

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    -

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    -

    See --directory to change the working directory entirely.

    -

    This setting has no effect when used in the uv pip interface.

    -

    May also be set with the UV_PROJECT environment variable.

    --quiet, -q

    Use quiet output.

    -

    Repeating this option, e.g., -qq, will enable a silent mode in which uv will write no output to stdout.

    -
    --verbose, -v

    Use verbose output.

    -

    You can configure fine-grained logging using the RUST_LOG environment variable. (https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#directives)

    -
    - -### uv cache size - -Show the cache size. - -Displays the total size of the cache directory. This includes all downloaded and built wheels, source distributions, and other cached data. By default, outputs the size in raw bytes; use `--human` for human-readable output. - -

    Usage

    - -``` -uv cache size [OPTIONS] -``` - -

    Options

    - -
    --allow-insecure-host, --trusted-host allow-insecure-host

    Allow insecure connections to a host.

    -

    Can be provided multiple times.

    -

    Expects to receive either a hostname (e.g., localhost), a host-port pair (e.g., localhost:8080), or a URL (e.g., https://localhost).

    -

    WARNING: Hosts included in this list will not be verified against the system's certificate store. Only use --allow-insecure-host in a secure network with verified sources, as it bypasses SSL verification and could expose you to MITM attacks.

    -

    May also be set with the UV_INSECURE_HOST environment variable.

    --cache-dir cache-dir

    Path to the cache directory.

    -

    Defaults to $XDG_CACHE_HOME/uv or $HOME/.cache/uv on macOS and Linux, and %LOCALAPPDATA%\uv\cache on Windows.

    -

    To view the location of the cache directory, run uv cache dir.

    -

    May also be set with the UV_CACHE_DIR environment variable.

    --color color-choice

    Control the use of color in output.

    -

    By default, uv will automatically detect support for colors when writing to a terminal.

    -

    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.

    -

    While uv configuration can be included in a pyproject.toml file, it is not allowed in this context.

    -

    May also be set with the UV_CONFIG_FILE environment variable.

    --directory directory

    Change to the given directory prior to running the command.

    -

    Relative paths are resolved with the given directory as the base.

    -

    See --project to only change the project root directory.

    -

    May also be set with the UV_WORKING_DIR environment variable.

    --help, -h

    Display the concise help for this command

    -
    --human, --human-readable, -H

    Display the cache size in human-readable format (e.g., 1.2 GiB instead of raw bytes)

    -
    --managed-python

    Require use of uv-managed Python versions.

    -

    By default, uv prefers using Python versions it manages. However, it will use system Python versions if a uv-managed Python is not installed. This option disables use of system Python versions.

    -

    May also be set with the UV_MANAGED_PYTHON environment variable.

    --native-tls

    Whether to load TLS certificates from the platform's native certificate store.

    -

    By default, uv loads certificates from the bundled webpki-roots crate. The webpki-roots are a reliable set of trust roots from Mozilla, and including them in uv improves portability and performance (especially on macOS).

    -

    However, in some cases, you may want to use the platform's native certificate store, especially if you're relying on a corporate trust root (e.g., for a mandatory proxy) that's included in your system's certificate store.

    -

    May also be set with the UV_NATIVE_TLS environment variable.

    --no-cache, --no-cache-dir, -n

    Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation

    -

    May also be set with the UV_NO_CACHE environment variable.

    --no-config

    Avoid discovering configuration files (pyproject.toml, uv.toml).

    -

    Normally, configuration files are discovered in the current directory, parent directories, or user configuration directories.

    -

    May also be set with the UV_NO_CONFIG environment variable.

    --no-managed-python

    Disable use of uv-managed Python versions.

    -

    Instead, uv will search for a suitable Python version on the system.

    -

    May also be set with the UV_NO_MANAGED_PYTHON environment variable.

    --no-progress

    Hide all progress outputs.

    -

    For example, spinners or progress bars.

    -

    May also be set with the UV_NO_PROGRESS environment variable.

    --no-python-downloads

    Disable automatic downloads of Python.

    -
    --offline

    Disable network access.

    -

    When disabled, uv will only use locally cached data and locally available files.

    -

    May also be set with the UV_OFFLINE environment variable.

    --project project

    Discover a project in the given directory.

    -

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    -

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    -

    See --directory to change the working directory entirely.

    -

    This setting has no effect when used in the uv pip interface.

    -

    May also be set with the UV_PROJECT environment variable.

    --quiet, -q

    Use quiet output.

    -

    Repeating this option, e.g., -qq, will enable a silent mode in which uv will write no output to stdout.

    -
    --threads threads

    Number of threads to use when calculating the cache size

    -
    --verbose, -v

    Use verbose output.

    -

    You can configure fine-grained logging using the RUST_LOG environment variable. (https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#directives)

    -
    - -## uv self - -Manage the uv executable - -

    Usage

    - -``` -uv self [OPTIONS] -``` - -

    Commands

    - -
    uv self update

    Update uv

    -
    uv self version

    Display uv's version

    -
    - -### uv self update - -Update uv - -

    Usage

    - -``` -uv self update [OPTIONS] [TARGET_VERSION] -``` - -

    Arguments

    - -
    TARGET_VERSION

    Update to the specified version. If not provided, uv will update to the latest version

    -
    - -

    Options

    - -
    --allow-insecure-host, --trusted-host allow-insecure-host

    Allow insecure connections to a host.

    -

    Can be provided multiple times.

    -

    Expects to receive either a hostname (e.g., localhost), a host-port pair (e.g., localhost:8080), or a URL (e.g., https://localhost).

    -

    WARNING: Hosts included in this list will not be verified against the system's certificate store. Only use --allow-insecure-host in a secure network with verified sources, as it bypasses SSL verification and could expose you to MITM attacks.

    -

    May also be set with the UV_INSECURE_HOST environment variable.

    --cache-dir cache-dir

    Path to the cache directory.

    -

    Defaults to $XDG_CACHE_HOME/uv or $HOME/.cache/uv on macOS and Linux, and %LOCALAPPDATA%\uv\cache on Windows.

    -

    To view the location of the cache directory, run uv cache dir.

    -

    May also be set with the UV_CACHE_DIR environment variable.

    --color color-choice

    Control the use of color in output.

    -

    By default, uv will automatically detect support for colors when writing to a terminal.

    -

    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.

    -

    While uv configuration can be included in a pyproject.toml file, it is not allowed in this context.

    -

    May also be set with the UV_CONFIG_FILE environment variable.

    --directory directory

    Change to the given directory prior to running the command.

    -

    Relative paths are resolved with the given directory as the base.

    -

    See --project to only change the project root directory.

    -

    May also be set with the UV_WORKING_DIR environment variable.

    --dry-run

    Run without performing the update

    -
    --help, -h

    Display the concise help for this command

    -
    --managed-python

    Require use of uv-managed Python versions.

    -

    By default, uv prefers using Python versions it manages. However, it will use system Python versions if a uv-managed Python is not installed. This option disables use of system Python versions.

    -

    May also be set with the UV_MANAGED_PYTHON environment variable.

    --native-tls

    Whether to load TLS certificates from the platform's native certificate store.

    -

    By default, uv loads certificates from the bundled webpki-roots crate. The webpki-roots are a reliable set of trust roots from Mozilla, and including them in uv improves portability and performance (especially on macOS).

    -

    However, in some cases, you may want to use the platform's native certificate store, especially if you're relying on a corporate trust root (e.g., for a mandatory proxy) that's included in your system's certificate store.

    -

    May also be set with the UV_NATIVE_TLS environment variable.

    --no-cache, --no-cache-dir, -n

    Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation

    -

    May also be set with the UV_NO_CACHE environment variable.

    --no-config

    Avoid discovering configuration files (pyproject.toml, uv.toml).

    -

    Normally, configuration files are discovered in the current directory, parent directories, or user configuration directories.

    -

    May also be set with the UV_NO_CONFIG environment variable.

    --no-managed-python

    Disable use of uv-managed Python versions.

    -

    Instead, uv will search for a suitable Python version on the system.

    -

    May also be set with the UV_NO_MANAGED_PYTHON environment variable.

    --no-progress

    Hide all progress outputs.

    -

    For example, spinners or progress bars.

    -

    May also be set with the UV_NO_PROGRESS environment variable.

    --no-python-downloads

    Disable automatic downloads of Python.

    -
    --offline

    Disable network access.

    -

    When disabled, uv will only use locally cached data and locally available files.

    -

    May also be set with the UV_OFFLINE environment variable.

    --project project

    Discover a project in the given directory.

    -

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    -

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    -

    See --directory to change the working directory entirely.

    -

    This setting has no effect when used in the uv pip interface.

    -

    May also be set with the UV_PROJECT environment variable.

    --quiet, -q

    Use quiet output.

    -

    Repeating this option, e.g., -qq, will enable a silent mode in which uv will write no output to stdout.

    -
    --token token

    A GitHub token for authentication. A token is not required but can be used to reduce the chance of encountering rate limits

    -

    May also be set with the UV_GITHUB_TOKEN environment variable.

    --verbose, -v

    Use verbose output.

    -

    You can configure fine-grained logging using the RUST_LOG environment variable. (https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#directives)

    -
    - -### uv self version - -Display uv's version - -

    Usage

    - -``` -uv self version [OPTIONS] -``` - -

    Options

    - -
    --allow-insecure-host, --trusted-host allow-insecure-host

    Allow insecure connections to a host.

    -

    Can be provided multiple times.

    -

    Expects to receive either a hostname (e.g., localhost), a host-port pair (e.g., localhost:8080), or a URL (e.g., https://localhost).

    -

    WARNING: Hosts included in this list will not be verified against the system's certificate store. Only use --allow-insecure-host in a secure network with verified sources, as it bypasses SSL verification and could expose you to MITM attacks.

    -

    May also be set with the UV_INSECURE_HOST environment variable.

    --cache-dir cache-dir

    Path to the cache directory.

    -

    Defaults to $XDG_CACHE_HOME/uv or $HOME/.cache/uv on macOS and Linux, and %LOCALAPPDATA%\uv\cache on Windows.

    -

    To view the location of the cache directory, run uv cache dir.

    -

    May also be set with the UV_CACHE_DIR environment variable.

    --color color-choice

    Control the use of color in output.

    -

    By default, uv will automatically detect support for colors when writing to a terminal.

    -

    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.

    -

    While uv configuration can be included in a pyproject.toml file, it is not allowed in this context.

    -

    May also be set with the UV_CONFIG_FILE environment variable.

    --directory directory

    Change to the given directory prior to running the command.

    -

    Relative paths are resolved with the given directory as the base.

    -

    See --project to only change the project root directory.

    -

    May also be set with the UV_WORKING_DIR environment variable.

    --help, -h

    Display the concise help for this command

    -
    --managed-python

    Require use of uv-managed Python versions.

    -

    By default, uv prefers using Python versions it manages. However, it will use system Python versions if a uv-managed Python is not installed. This option disables use of system Python versions.

    -

    May also be set with the UV_MANAGED_PYTHON environment variable.

    --native-tls

    Whether to load TLS certificates from the platform's native certificate store.

    -

    By default, uv loads certificates from the bundled webpki-roots crate. The webpki-roots are a reliable set of trust roots from Mozilla, and including them in uv improves portability and performance (especially on macOS).

    -

    However, in some cases, you may want to use the platform's native certificate store, especially if you're relying on a corporate trust root (e.g., for a mandatory proxy) that's included in your system's certificate store.

    -

    May also be set with the UV_NATIVE_TLS environment variable.

    --no-cache, --no-cache-dir, -n

    Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation

    -

    May also be set with the UV_NO_CACHE environment variable.

    --no-config

    Avoid discovering configuration files (pyproject.toml, uv.toml).

    -

    Normally, configuration files are discovered in the current directory, parent directories, or user configuration directories.

    -

    May also be set with the UV_NO_CONFIG environment variable.

    --no-managed-python

    Disable use of uv-managed Python versions.

    -

    Instead, uv will search for a suitable Python version on the system.

    -

    May also be set with the UV_NO_MANAGED_PYTHON environment variable.

    --no-progress

    Hide all progress outputs.

    -

    For example, spinners or progress bars.

    -

    May also be set with the UV_NO_PROGRESS environment variable.

    --no-python-downloads

    Disable automatic downloads of Python.

    -
    --offline

    Disable network access.

    -

    When disabled, uv will only use locally cached data and locally available files.

    -

    May also be set with the UV_OFFLINE environment variable.

    --output-format output-format
    --project project

    Discover a project in the given directory.

    -

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    -

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    -

    See --directory to change the working directory entirely.

    -

    This setting has no effect when used in the uv pip interface.

    -

    May also be set with the UV_PROJECT environment variable.

    --quiet, -q

    Use quiet output.

    -

    Repeating this option, e.g., -qq, will enable a silent mode in which uv will write no output to stdout.

    -
    --short

    Only print the version

    -
    --verbose, -v

    Use verbose output.

    -

    You can configure fine-grained logging using the RUST_LOG environment variable. (https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#directives)

    -
    - -## uv generate-shell-completion - -Generate shell completion - -

    Usage

    - -``` -uv generate-shell-completion [OPTIONS] -``` - -

    Arguments

    - -
    SHELL

    The shell to generate the completion script for

    -
    - -

    Options

    - -
    --allow-insecure-host, --trusted-host allow-insecure-host

    Allow insecure connections to a host.

    -

    Can be provided multiple times.

    -

    Expects to receive either a hostname (e.g., localhost), a host-port pair (e.g., localhost:8080), or a URL (e.g., https://localhost).

    -

    WARNING: Hosts included in this list will not be verified against the system's certificate store. Only use --allow-insecure-host in a secure network with verified sources, as it bypasses SSL verification and could expose you to MITM attacks.

    -

    May also be set with the UV_INSECURE_HOST environment variable.

    --directory directory

    Change to the given directory prior to running the command.

    -

    Relative paths are resolved with the given directory as the base.

    -

    See --project to only change the project root directory.

    -

    May also be set with the UV_WORKING_DIR environment variable.

    --managed-python

    Require use of uv-managed Python versions.

    -

    By default, uv prefers using Python versions it manages. However, it will use system Python versions if a uv-managed Python is not installed. This option disables use of system Python versions.

    -

    May also be set with the UV_MANAGED_PYTHON environment variable.

    --no-managed-python

    Disable use of uv-managed Python versions.

    -

    Instead, uv will search for a suitable Python version on the system.

    -

    May also be set with the UV_NO_MANAGED_PYTHON environment variable.

    --project project

    Discover a project in the given directory.

    -

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    -

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    -

    See --directory to change the working directory entirely.

    -

    This setting has no effect when used in the uv pip interface.

    -

    May also be set with the UV_PROJECT environment variable.

    - -## uv help - -Display documentation for a command - -

    Usage

    - -``` -uv help [OPTIONS] [COMMAND]... -``` - -

    Arguments

    - -
    COMMAND
    - -

    Options

    - -
    --allow-insecure-host, --trusted-host allow-insecure-host

    Allow insecure connections to a host.

    -

    Can be provided multiple times.

    -

    Expects to receive either a hostname (e.g., localhost), a host-port pair (e.g., localhost:8080), or a URL (e.g., https://localhost).

    -

    WARNING: Hosts included in this list will not be verified against the system's certificate store. Only use --allow-insecure-host in a secure network with verified sources, as it bypasses SSL verification and could expose you to MITM attacks.

    -

    May also be set with the UV_INSECURE_HOST environment variable.

    --cache-dir cache-dir

    Path to the cache directory.

    -

    Defaults to $XDG_CACHE_HOME/uv or $HOME/.cache/uv on macOS and Linux, and %LOCALAPPDATA%\uv\cache on Windows.

    -

    To view the location of the cache directory, run uv cache dir.

    -

    May also be set with the UV_CACHE_DIR environment variable.

    --color color-choice

    Control the use of color in output.

    -

    By default, uv will automatically detect support for colors when writing to a terminal.

    -

    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.

    -

    While uv configuration can be included in a pyproject.toml file, it is not allowed in this context.

    -

    May also be set with the UV_CONFIG_FILE environment variable.

    --directory directory

    Change to the given directory prior to running the command.

    -

    Relative paths are resolved with the given directory as the base.

    -

    See --project to only change the project root directory.

    -

    May also be set with the UV_WORKING_DIR environment variable.

    --help, -h

    Display the concise help for this command

    -
    --managed-python

    Require use of uv-managed Python versions.

    -

    By default, uv prefers using Python versions it manages. However, it will use system Python versions if a uv-managed Python is not installed. This option disables use of system Python versions.

    -

    May also be set with the UV_MANAGED_PYTHON environment variable.

    --native-tls

    Whether to load TLS certificates from the platform's native certificate store.

    -

    By default, uv loads certificates from the bundled webpki-roots crate. The webpki-roots are a reliable set of trust roots from Mozilla, and including them in uv improves portability and performance (especially on macOS).

    -

    However, in some cases, you may want to use the platform's native certificate store, especially if you're relying on a corporate trust root (e.g., for a mandatory proxy) that's included in your system's certificate store.

    -

    May also be set with the UV_NATIVE_TLS environment variable.

    --no-cache, --no-cache-dir, -n

    Avoid reading from or writing to the cache, instead using a temporary directory for the duration of the operation

    -

    May also be set with the UV_NO_CACHE environment variable.

    --no-config

    Avoid discovering configuration files (pyproject.toml, uv.toml).

    -

    Normally, configuration files are discovered in the current directory, parent directories, or user configuration directories.

    -

    May also be set with the UV_NO_CONFIG environment variable.

    --no-managed-python

    Disable use of uv-managed Python versions.

    -

    Instead, uv will search for a suitable Python version on the system.

    -

    May also be set with the UV_NO_MANAGED_PYTHON environment variable.

    --no-pager

    Disable pager when printing help

    -
    --no-progress

    Hide all progress outputs.

    -

    For example, spinners or progress bars.

    -

    May also be set with the UV_NO_PROGRESS environment variable.

    --no-python-downloads

    Disable automatic downloads of Python.

    -
    --offline

    Disable network access.

    -

    When disabled, uv will only use locally cached data and locally available files.

    -

    May also be set with the UV_OFFLINE environment variable.

    --project project

    Discover a project in the given directory.

    -

    All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project's virtual environment (.venv).

    -

    Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

    -

    See --directory to change the working directory entirely.

    -

    This setting has no effect when used in the uv pip interface.

    -

    May also be set with the UV_PROJECT environment variable.

    --quiet, -q

    Use quiet output.

    -

    Repeating this option, e.g., -qq, will enable a silent mode in which uv will write no output to stdout.

    -
    --verbose, -v

    Use verbose output.

    -

    You can configure fine-grained logging using the RUST_LOG environment variable. (https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#directives)

    -
    - From 47a150daa196729ee2853db2e362726eb06c3f5f Mon Sep 17 00:00:00 2001 From: Matthew Mckee Date: Thu, 11 Dec 2025 15:34:42 +0000 Subject: [PATCH 11/11] Remove threads cli option --- crates/uv-cli/src/lib.rs | 4 ---- crates/uv/src/commands/cache_size.rs | 8 +------- crates/uv/src/lib.rs | 2 +- crates/uv/tests/it/cache_size.rs | 21 --------------------- 4 files changed, 2 insertions(+), 33 deletions(-) diff --git a/crates/uv-cli/src/lib.rs b/crates/uv-cli/src/lib.rs index 95bd88a460ff9..ea4fc07bfa7d6 100644 --- a/crates/uv-cli/src/lib.rs +++ b/crates/uv-cli/src/lib.rs @@ -935,10 +935,6 @@ pub struct SizeArgs { /// Display the cache size in human-readable format (e.g., `1.2 GiB` instead of raw bytes). #[arg(long = "human", short = 'H', alias = "human-readable")] pub human: bool, - - /// Number of threads to use when calculating the cache size - #[arg(long)] - pub threads: Option, } #[derive(Args)] diff --git a/crates/uv/src/commands/cache_size.rs b/crates/uv/src/commands/cache_size.rs index de49a0fc84690..46ef3216db8cd 100644 --- a/crates/uv/src/commands/cache_size.rs +++ b/crates/uv/src/commands/cache_size.rs @@ -13,7 +13,6 @@ use uv_warnings::warn_user; pub(crate) fn cache_size( cache: &Cache, human_readable: bool, - threads: Option, printer: Printer, preview: Preview, ) -> Result { @@ -33,12 +32,7 @@ pub(crate) fn cache_size( return Ok(ExitStatus::Success); } - let mut disk_usage = DiskUsage::new(vec![cache.root().to_path_buf()]); - - if let Some(n) = threads { - tracing::info!("Using {} threads to calculate cache size", n); - disk_usage = disk_usage.num_workers(n); - } + let disk_usage = DiskUsage::new(vec![cache.root().to_path_buf()]); let total_bytes = disk_usage.count_ignoring_errors(); diff --git a/crates/uv/src/lib.rs b/crates/uv/src/lib.rs index a85dd5a0b6997..d8d4dbb9102e4 100644 --- a/crates/uv/src/lib.rs +++ b/crates/uv/src/lib.rs @@ -1088,7 +1088,7 @@ async fn run(mut cli: Cli) -> Result { }) => commands::cache_dir(&cache, printer), Commands::Cache(CacheNamespace { command: CacheCommand::Size(args), - }) => commands::cache_size(&cache, args.human, args.threads, printer, globals.preview), + }) => commands::cache_size(&cache, args.human, printer, globals.preview), Commands::Build(args) => { // Resolve the settings from the command-line arguments and workspace configuration. let args = settings::BuildSettings::resolve(args, filesystem, environment); diff --git a/crates/uv/tests/it/cache_size.rs b/crates/uv/tests/it/cache_size.rs index ffa554b97f48e..7fbfde3c80e57 100644 --- a/crates/uv/tests/it/cache_size.rs +++ b/crates/uv/tests/it/cache_size.rs @@ -57,24 +57,3 @@ fn cache_size_with_packages_human() { ----- stderr ----- "); } - -/// Test that `cache size --threads 2` uses the correct number of threads, via a `info` log statement. -#[test] -fn cache_size_with_packages_threads() { - let context = TestContext::new("3.12"); - - // Install a requirement to populate the cache. - context.pip_install().arg("iniconfig").assert().success(); - - // Check cache size with `--threads 2` - uv_snapshot!(context.with_filtered_cache_size().filters(), context.cache_size().arg("--preview").arg("--threads").arg("2").arg("-v"), @r" - success: true - exit_code: 0 - ----- stdout ----- - [SIZE] - - ----- stderr ----- - DEBUG uv [VERSION] ([COMMIT] DATE) - INFO Using 2 threads to calculate cache size - "); -}