204 KiB
		
	
	
	
	
	
	
	
			
		
		
	
	CLI Reference
uv
An extremely fast Python package manager.
Usage
uv [OPTIONS] <COMMAND>
Commands
uv runRun a command or script (experimental)
uv initCreate a new project (experimental)
uv addAdd dependencies to the project (experimental)
uv removeRemove dependencies from the project (experimental)
uv syncUpdate the project’s environment (experimental)
uv lockUpdate the project’s lockfile (experimental)
uv treeDisplay the project’s dependency tree (experimental)
uv toolRun and manage tools provided by Python packages (experimental)
uv pythonManage Python versions and installations (experimental)
uv pipManage Python packages with a pip-compatible interface
uv venvCreate a virtual environment
uv cacheManage uv’s cache
uv versionDisplay uv’s version
uv helpDisplay documentation for a command
uv run
Run a command or script (experimental)
Usage
uv run [OPTIONS] <COMMAND>
Options
--extraextraInclude optional dependencies from the extra group name; may be provided more than once.
Only applies to
pyproject.toml,setup.py, andsetup.cfgsources.--withwithRun with the given packages installed
--with-requirementswith-requirementsRun with all packages listed in the given
requirements.txtfiles.Using
pyproject.toml,setup.py, orsetup.cfgfiles is not allowed.--index-url,-iindex-urlThe 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-urlflag.--extra-index-urlextra-index-urlExtra 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-urlflags are provided, earlier values take priority.--find-links,-ffind-linksLocations 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 (.tar.gzor.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.
--upgrade-package,-Pupgrade-packageAllow upgrades for a specific package, ignoring pinned versions in any existing output file
--reinstall-packagereinstall-packageReinstall a specific package, regardless of whether it’s already installed. Implies
--refresh-package--index-strategyindex-strategyThe 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-match). This prevents "dependency confusion" attacks, whereby an attack can upload a malicious package under the same name to a secondary.Possible values:
first-index: Only use results from the first index that returns a match for a given package nameunsafe-first-match: Search for every package name across all indexes, exhausting the versions from the first index before moving on to the nextunsafe-best-match: Search for every package name across all indexes, preferring the "best" version found. If a package version is in multiple indexes, only look at the entry for the first index
--keyring-providerkeyring-providerAttempt to use
keyringfor authentication for index URLs.At present, only
--keyring-provider subprocessis supported, which configures uv to use thekeyringCLI to handle authentication.Defaults to
disabled.Possible values:
disabled: Do not use keyring for credential lookupsubprocess: Use thekeyringcommand for credential lookup
--resolutionresolutionThe strategy to use when selecting between the different compatible versions for a given package requirement.
By default, uv will use the latest compatible version of each package (
highest).Possible values:
highest: Resolve the highest compatible version of each packagelowest: Resolve the lowest compatible version of each packagelowest-direct: Resolve the lowest compatible version of any direct dependencies, and the highest compatible version of any transitive dependencies
--prereleaseprereleaseThe strategy to use when considering pre-release versions.
By default, uv will accept pre-releases for packages that only publish pre-releases, along with first-party requirements that contain an explicit pre-release marker in the declared specifiers (
if-necessary-or-explicit).Possible values:
disallow: Disallow all pre-release versionsallow: Allow all pre-release versionsif-necessary: Allow pre-release versions if all versions of a package are pre-releaseexplicit: Allow pre-release versions for first-party packages with explicit pre-release markers in their version requirementsif-necessary-or-explicit: Allow pre-release versions if all versions of a package are pre-release, or if the package has an explicit pre-release marker in its version requirements
--config-setting,-Cconfig-settingSettings to pass to the PEP 517 build backend, specified as
KEY=VALUEpairs--exclude-newerexclude-newerLimit candidate packages to those that were uploaded prior to the given date.
Accepts both RFC 3339 timestamps (e.g.,
2006-12-02T02:07:43Z) and UTC dates in the same format (e.g.,2006-12-02).--link-modelink-modeThe method to use when installing packages from the global cache.
Defaults to
clone(also known as Copy-on-Write) on macOS, andhardlinkon Linux and Windows.Possible values:
clone: Clone (i.e., copy-on-write) packages from the wheel into thesite-packagesdirectorycopy: Copy packages from the wheel into thesite-packagesdirectoryhardlink: Hard link packages from the wheel into thesite-packagesdirectorysymlink: Symbolically link packages from the wheel into thesite-packagesdirectory
--no-build-packageno-build-packageDon’t build source distributions for a specific package
--no-binary-packageno-binary-packageDon’t install pre-built wheels for a specific package
--refresh-packagerefresh-packageRefresh cached data for a specific package
--packagepackageRun the command in a specific package in the workspace
--python,-ppythonThe Python interpreter to use to build the run 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--pythonoption allows you to specify a different interpreter.Supported formats:
3.10looks for an installed Python 3.10 usingpy --list-pathson Windows, orpython3.10on Linux and macOS.python3.10orpython.exelooks for a binary with the given name inPATH./home/ferris/.local/bin/python3.10uses the exact Python at the given path.
--cache-dircache-dirPath to the cache directory.
Defaults to
$HOME/Library/Caches/uvon macOS,$XDG_CACHE_HOME/uvor$HOME/.cache/uvon Linux, and{FOLDERID_LocalAppData}\uv\cacheon Windows.--python-preferencepython-preferenceWhether to prefer uv-managed or system Python installations.
By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.
Possible values:
only-managed: Only use managed Python installations; never use system Python installationsmanaged: Prefer managed Python installations over system Python installationssystem: Prefer system Python installations over managed Python installationsonly-system: Only use system Python installations; never use managed Python installations
--python-fetchpython-fetchWhether to automatically download Python when required
Possible values:
automatic: Automatically fetch managed Python installations when neededmanual: Do not automatically fetch managed Python installations; require explicit installation
--colorcolor-choiceControl colors in output
[default: auto]
Possible values:
auto: Enables colored output only when the output is going to a terminal or TTY with supportalways: Enables colored output regardless of the detected environmentnever: Disables colored output
--config-fileconfig-fileThe path to a
uv.tomlfile to use for configuration.While uv configuration can be included in a
pyproject.tomlfile, it is not allowed in this context.
uv init
Create a new project (experimental)
Usage
uv init [OPTIONS] [PATH]
Arguments
PATHThe path of the project
Options
--namenameThe name of the project, defaults to the name of the directory
--python,-ppythonThe Python interpreter to use to determine the minimum supported Python version.
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--pythonoption allows you to specify a different interpreter.Supported formats:
3.10looks for an installed Python 3.10 usingpy --list-pathson Windows, orpython3.10on Linux and macOS.python3.10orpython.exelooks for a binary with the given name inPATH./home/ferris/.local/bin/python3.10uses the exact Python at the given path.
--cache-dircache-dirPath to the cache directory.
Defaults to
$HOME/Library/Caches/uvon macOS,$XDG_CACHE_HOME/uvor$HOME/.cache/uvon Linux, and{FOLDERID_LocalAppData}\uv\cacheon Windows.--python-preferencepython-preferenceWhether to prefer uv-managed or system Python installations.
By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.
Possible values:
only-managed: Only use managed Python installations; never use system Python installationsmanaged: Prefer managed Python installations over system Python installationssystem: Prefer system Python installations over managed Python installationsonly-system: Only use system Python installations; never use managed Python installations
--python-fetchpython-fetchWhether to automatically download Python when required
Possible values:
automatic: Automatically fetch managed Python installations when neededmanual: Do not automatically fetch managed Python installations; require explicit installation
--colorcolor-choiceControl colors in output
[default: auto]
Possible values:
auto: Enables colored output only when the output is going to a terminal or TTY with supportalways: Enables colored output regardless of the detected environmentnever: Disables colored output
--config-fileconfig-fileThe path to a
uv.tomlfile to use for configuration.While uv configuration can be included in a
pyproject.tomlfile, it is not allowed in this context.
uv add
Add dependencies to the project (experimental)
Usage
uv add [OPTIONS] <REQUIREMENTS>...
Arguments
REQUIREMENTSThe packages to add, as PEP 508 requirements (e.g.,
ruff==0.5.0)
Options
--optionaloptionalAdd the requirements to the specified optional dependency group
--revrevSpecific commit to use when adding from Git
--tagtagTag to use when adding from git
--branchbranchBranch to use when adding from git
--extraextraExtras to activate for the dependency; may be provided more than once
--index-url,-iindex-urlThe 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-urlflag.--extra-index-urlextra-index-urlExtra 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-urlflags are provided, earlier values take priority.--find-links,-ffind-linksLocations 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 (.tar.gzor.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.
--upgrade-package,-Pupgrade-packageAllow upgrades for a specific package, ignoring pinned versions in any existing output file
--reinstall-packagereinstall-packageReinstall a specific package, regardless of whether it’s already installed. Implies
--refresh-package--index-strategyindex-strategyThe 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-match). This prevents "dependency confusion" attacks, whereby an attack can upload a malicious package under the same name to a secondary.Possible values:
first-index: Only use results from the first index that returns a match for a given package nameunsafe-first-match: Search for every package name across all indexes, exhausting the versions from the first index before moving on to the nextunsafe-best-match: Search for every package name across all indexes, preferring the "best" version found. If a package version is in multiple indexes, only look at the entry for the first index
--keyring-providerkeyring-providerAttempt to use
keyringfor authentication for index URLs.At present, only
--keyring-provider subprocessis supported, which configures uv to use thekeyringCLI to handle authentication.Defaults to
disabled.Possible values:
disabled: Do not use keyring for credential lookupsubprocess: Use thekeyringcommand for credential lookup
--resolutionresolutionThe strategy to use when selecting between the different compatible versions for a given package requirement.
By default, uv will use the latest compatible version of each package (
highest).Possible values:
highest: Resolve the highest compatible version of each packagelowest: Resolve the lowest compatible version of each packagelowest-direct: Resolve the lowest compatible version of any direct dependencies, and the highest compatible version of any transitive dependencies
--prereleaseprereleaseThe strategy to use when considering pre-release versions.
By default, uv will accept pre-releases for packages that only publish pre-releases, along with first-party requirements that contain an explicit pre-release marker in the declared specifiers (
if-necessary-or-explicit).Possible values:
disallow: Disallow all pre-release versionsallow: Allow all pre-release versionsif-necessary: Allow pre-release versions if all versions of a package are pre-releaseexplicit: Allow pre-release versions for first-party packages with explicit pre-release markers in their version requirementsif-necessary-or-explicit: Allow pre-release versions if all versions of a package are pre-release, or if the package has an explicit pre-release marker in its version requirements
--config-setting,-Cconfig-settingSettings to pass to the PEP 517 build backend, specified as
KEY=VALUEpairs--exclude-newerexclude-newerLimit candidate packages to those that were uploaded prior to the given date.
Accepts both RFC 3339 timestamps (e.g.,
2006-12-02T02:07:43Z) and UTC dates in the same format (e.g.,2006-12-02).--link-modelink-modeThe method to use when installing packages from the global cache.
Defaults to
clone(also known as Copy-on-Write) on macOS, andhardlinkon Linux and Windows.Possible values:
clone: Clone (i.e., copy-on-write) packages from the wheel into thesite-packagesdirectorycopy: Copy packages from the wheel into thesite-packagesdirectoryhardlink: Hard link packages from the wheel into thesite-packagesdirectorysymlink: Symbolically link packages from the wheel into thesite-packagesdirectory
--no-build-packageno-build-packageDon’t build source distributions for a specific package
--no-binary-packageno-binary-packageDon’t install pre-built wheels for a specific package
--refresh-packagerefresh-packageRefresh cached data for a specific package
--packagepackageAdd the dependency to a specific package in the workspace
--python,-ppythonThe Python interpreter into which packages should be installed.
By default, uv installs into the virtual environment in the current working directory or any parent directory. The
--pythonoption allows you to specify a different interpreter, which is intended for use in continuous integration (CI) environments or other automated workflows.Supported formats:
3.10looks for an installed Python 3.10 usingpy --list-pathson Windows, orpython3.10on Linux and macOS.python3.10orpython.exelooks for a binary with the given name inPATH./home/ferris/.local/bin/python3.10uses the exact Python at the given path.
--cache-dircache-dirPath to the cache directory.
Defaults to
$HOME/Library/Caches/uvon macOS,$XDG_CACHE_HOME/uvor$HOME/.cache/uvon Linux, and{FOLDERID_LocalAppData}\uv\cacheon Windows.--python-preferencepython-preferenceWhether to prefer uv-managed or system Python installations.
By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.
Possible values:
only-managed: Only use managed Python installations; never use system Python installationsmanaged: Prefer managed Python installations over system Python installationssystem: Prefer system Python installations over managed Python installationsonly-system: Only use system Python installations; never use managed Python installations
--python-fetchpython-fetchWhether to automatically download Python when required
Possible values:
automatic: Automatically fetch managed Python installations when neededmanual: Do not automatically fetch managed Python installations; require explicit installation
--colorcolor-choiceControl colors in output
[default: auto]
Possible values:
auto: Enables colored output only when the output is going to a terminal or TTY with supportalways: Enables colored output regardless of the detected environmentnever: Disables colored output
--config-fileconfig-fileThe path to a
uv.tomlfile to use for configuration.While uv configuration can be included in a
pyproject.tomlfile, it is not allowed in this context.
uv remove
Remove dependencies from the project (experimental)
Usage
uv remove [OPTIONS] <REQUIREMENTS>...
Arguments
REQUIREMENTSThe names of the packages to remove (e.g.,
ruff)
Options
--optionaloptionalRemove the requirements from the specified optional dependency group
--index-url,-iindex-urlThe 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-urlflag.--extra-index-urlextra-index-urlExtra 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-urlflags are provided, earlier values take priority.--find-links,-ffind-linksLocations 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 (.tar.gzor.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.
--upgrade-package,-Pupgrade-packageAllow upgrades for a specific package, ignoring pinned versions in any existing output file
--reinstall-packagereinstall-packageReinstall a specific package, regardless of whether it’s already installed. Implies
--refresh-package--index-strategyindex-strategyThe 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-match). This prevents "dependency confusion" attacks, whereby an attack can upload a malicious package under the same name to a secondary.Possible values:
first-index: Only use results from the first index that returns a match for a given package nameunsafe-first-match: Search for every package name across all indexes, exhausting the versions from the first index before moving on to the nextunsafe-best-match: Search for every package name across all indexes, preferring the "best" version found. If a package version is in multiple indexes, only look at the entry for the first index
--keyring-providerkeyring-providerAttempt to use
keyringfor authentication for index URLs.At present, only
--keyring-provider subprocessis supported, which configures uv to use thekeyringCLI to handle authentication.Defaults to
disabled.Possible values:
disabled: Do not use keyring for credential lookupsubprocess: Use thekeyringcommand for credential lookup
--resolutionresolutionThe strategy to use when selecting between the different compatible versions for a given package requirement.
By default, uv will use the latest compatible version of each package (
highest).Possible values:
highest: Resolve the highest compatible version of each packagelowest: Resolve the lowest compatible version of each packagelowest-direct: Resolve the lowest compatible version of any direct dependencies, and the highest compatible version of any transitive dependencies
--prereleaseprereleaseThe strategy to use when considering pre-release versions.
By default, uv will accept pre-releases for packages that only publish pre-releases, along with first-party requirements that contain an explicit pre-release marker in the declared specifiers (
if-necessary-or-explicit).Possible values:
disallow: Disallow all pre-release versionsallow: Allow all pre-release versionsif-necessary: Allow pre-release versions if all versions of a package are pre-releaseexplicit: Allow pre-release versions for first-party packages with explicit pre-release markers in their version requirementsif-necessary-or-explicit: Allow pre-release versions if all versions of a package are pre-release, or if the package has an explicit pre-release marker in its version requirements
--config-setting,-Cconfig-settingSettings to pass to the PEP 517 build backend, specified as
KEY=VALUEpairs--exclude-newerexclude-newerLimit candidate packages to those that were uploaded prior to the given date.
Accepts both RFC 3339 timestamps (e.g.,
2006-12-02T02:07:43Z) and UTC dates in the same format (e.g.,2006-12-02).--link-modelink-modeThe method to use when installing packages from the global cache.
Defaults to
clone(also known as Copy-on-Write) on macOS, andhardlinkon Linux and Windows.Possible values:
clone: Clone (i.e., copy-on-write) packages from the wheel into thesite-packagesdirectorycopy: Copy packages from the wheel into thesite-packagesdirectoryhardlink: Hard link packages from the wheel into thesite-packagesdirectorysymlink: Symbolically link packages from the wheel into thesite-packagesdirectory
--no-build-packageno-build-packageDon’t build source distributions for a specific package
--no-binary-packageno-binary-packageDon’t install pre-built wheels for a specific package
--refresh-packagerefresh-packageRefresh cached data for a specific package
--packagepackageRemove the dependency from a specific package in the workspace
--python,-ppythonThe Python interpreter into which packages should be installed.
By default, uv installs into the virtual environment in the current working directory or any parent directory. The
--pythonoption allows you to specify a different interpreter, which is intended for use in continuous integration (CI) environments or other automated workflows.Supported formats:
3.10looks for an installed Python 3.10 usingpy --list-pathson Windows, orpython3.10on Linux and macOS.python3.10orpython.exelooks for a binary with the given name inPATH./home/ferris/.local/bin/python3.10uses the exact Python at the given path.
--cache-dircache-dirPath to the cache directory.
Defaults to
$HOME/Library/Caches/uvon macOS,$XDG_CACHE_HOME/uvor$HOME/.cache/uvon Linux, and{FOLDERID_LocalAppData}\uv\cacheon Windows.--python-preferencepython-preferenceWhether to prefer uv-managed or system Python installations.
By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.
Possible values:
only-managed: Only use managed Python installations; never use system Python installationsmanaged: Prefer managed Python installations over system Python installationssystem: Prefer system Python installations over managed Python installationsonly-system: Only use system Python installations; never use managed Python installations
--python-fetchpython-fetchWhether to automatically download Python when required
Possible values:
automatic: Automatically fetch managed Python installations when neededmanual: Do not automatically fetch managed Python installations; require explicit installation
--colorcolor-choiceControl colors in output
[default: auto]
Possible values:
auto: Enables colored output only when the output is going to a terminal or TTY with supportalways: Enables colored output regardless of the detected environmentnever: Disables colored output
--config-fileconfig-fileThe path to a
uv.tomlfile to use for configuration.While uv configuration can be included in a
pyproject.tomlfile, it is not allowed in this context.
uv sync
Update the project's environment (experimental)
Usage
uv sync [OPTIONS]
Options
--extraextraInclude optional dependencies from the extra group name; may be provided more than once.
Only applies to
pyproject.toml,setup.py, andsetup.cfgsources.--index-url,-iindex-urlThe 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-urlflag.--extra-index-urlextra-index-urlExtra 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-urlflags are provided, earlier values take priority.--find-links,-ffind-linksLocations 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 (.tar.gzor.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.
--upgrade-package,-Pupgrade-packageAllow upgrades for a specific package, ignoring pinned versions in any existing output file
--reinstall-packagereinstall-packageReinstall a specific package, regardless of whether it’s already installed. Implies
--refresh-package--index-strategyindex-strategyThe 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-match). This prevents "dependency confusion" attacks, whereby an attack can upload a malicious package under the same name to a secondary.Possible values:
first-index: Only use results from the first index that returns a match for a given package nameunsafe-first-match: Search for every package name across all indexes, exhausting the versions from the first index before moving on to the nextunsafe-best-match: Search for every package name across all indexes, preferring the "best" version found. If a package version is in multiple indexes, only look at the entry for the first index
--keyring-providerkeyring-providerAttempt to use
keyringfor authentication for index URLs.At present, only
--keyring-provider subprocessis supported, which configures uv to use thekeyringCLI to handle authentication.Defaults to
disabled.Possible values:
disabled: Do not use keyring for credential lookupsubprocess: Use thekeyringcommand for credential lookup
--resolutionresolutionThe strategy to use when selecting between the different compatible versions for a given package requirement.
By default, uv will use the latest compatible version of each package (
highest).Possible values:
highest: Resolve the highest compatible version of each packagelowest: Resolve the lowest compatible version of each packagelowest-direct: Resolve the lowest compatible version of any direct dependencies, and the highest compatible version of any transitive dependencies
--prereleaseprereleaseThe strategy to use when considering pre-release versions.
By default, uv will accept pre-releases for packages that only publish pre-releases, along with first-party requirements that contain an explicit pre-release marker in the declared specifiers (
if-necessary-or-explicit).Possible values:
disallow: Disallow all pre-release versionsallow: Allow all pre-release versionsif-necessary: Allow pre-release versions if all versions of a package are pre-releaseexplicit: Allow pre-release versions for first-party packages with explicit pre-release markers in their version requirementsif-necessary-or-explicit: Allow pre-release versions if all versions of a package are pre-release, or if the package has an explicit pre-release marker in its version requirements
--config-setting,-Cconfig-settingSettings to pass to the PEP 517 build backend, specified as
KEY=VALUEpairs--exclude-newerexclude-newerLimit candidate packages to those that were uploaded prior to the given date.
Accepts both RFC 3339 timestamps (e.g.,
2006-12-02T02:07:43Z) and UTC dates in the same format (e.g.,2006-12-02).--link-modelink-modeThe method to use when installing packages from the global cache.
Defaults to
clone(also known as Copy-on-Write) on macOS, andhardlinkon Linux and Windows.Possible values:
clone: Clone (i.e., copy-on-write) packages from the wheel into thesite-packagesdirectorycopy: Copy packages from the wheel into thesite-packagesdirectoryhardlink: Hard link packages from the wheel into thesite-packagesdirectorysymlink: Symbolically link packages from the wheel into thesite-packagesdirectory
--no-build-packageno-build-packageDon’t build source distributions for a specific package
--no-binary-packageno-binary-packageDon’t install pre-built wheels for a specific package
--refresh-packagerefresh-packageRefresh cached data for a specific package
--packagepackageSync a specific package in the workspace
--python,-ppythonThe Python interpreter to use to build the run 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--pythonoption allows you to specify a different interpreter.Supported formats:
3.10looks for an installed Python 3.10 usingpy --list-pathson Windows, orpython3.10on Linux and macOS.python3.10orpython.exelooks for a binary with the given name inPATH./home/ferris/.local/bin/python3.10uses the exact Python at the given path.
--cache-dircache-dirPath to the cache directory.
Defaults to
$HOME/Library/Caches/uvon macOS,$XDG_CACHE_HOME/uvor$HOME/.cache/uvon Linux, and{FOLDERID_LocalAppData}\uv\cacheon Windows.--python-preferencepython-preferenceWhether to prefer uv-managed or system Python installations.
By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.
Possible values:
only-managed: Only use managed Python installations; never use system Python installationsmanaged: Prefer managed Python installations over system Python installationssystem: Prefer system Python installations over managed Python installationsonly-system: Only use system Python installations; never use managed Python installations
--python-fetchpython-fetchWhether to automatically download Python when required
Possible values:
automatic: Automatically fetch managed Python installations when neededmanual: Do not automatically fetch managed Python installations; require explicit installation
--colorcolor-choiceControl colors in output
[default: auto]
Possible values:
auto: Enables colored output only when the output is going to a terminal or TTY with supportalways: Enables colored output regardless of the detected environmentnever: Disables colored output
--config-fileconfig-fileThe path to a
uv.tomlfile to use for configuration.While uv configuration can be included in a
pyproject.tomlfile, it is not allowed in this context.
uv lock
Update the project's lockfile (experimental)
Usage
uv lock [OPTIONS]
Options
--index-url,-iindex-urlThe 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-urlflag.--extra-index-urlextra-index-urlExtra 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-urlflags are provided, earlier values take priority.--find-links,-ffind-linksLocations 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 (.tar.gzor.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.
--upgrade-package,-Pupgrade-packageAllow upgrades for a specific package, ignoring pinned versions in any existing output file
--index-strategyindex-strategyThe 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-match). This prevents "dependency confusion" attacks, whereby an attack can upload a malicious package under the same name to a secondary.Possible values:
first-index: Only use results from the first index that returns a match for a given package nameunsafe-first-match: Search for every package name across all indexes, exhausting the versions from the first index before moving on to the nextunsafe-best-match: Search for every package name across all indexes, preferring the "best" version found. If a package version is in multiple indexes, only look at the entry for the first index
--keyring-providerkeyring-providerAttempt to use
keyringfor authentication for index URLs.At present, only
--keyring-provider subprocessis supported, which configures uv to use thekeyringCLI to handle authentication.Defaults to
disabled.Possible values:
disabled: Do not use keyring for credential lookupsubprocess: Use thekeyringcommand for credential lookup
--resolutionresolutionThe strategy to use when selecting between the different compatible versions for a given package requirement.
By default, uv will use the latest compatible version of each package (
highest).Possible values:
highest: Resolve the highest compatible version of each packagelowest: Resolve the lowest compatible version of each packagelowest-direct: Resolve the lowest compatible version of any direct dependencies, and the highest compatible version of any transitive dependencies
--prereleaseprereleaseThe strategy to use when considering pre-release versions.
By default, uv will accept pre-releases for packages that only publish pre-releases, along with first-party requirements that contain an explicit pre-release marker in the declared specifiers (
if-necessary-or-explicit).Possible values:
disallow: Disallow all pre-release versionsallow: Allow all pre-release versionsif-necessary: Allow pre-release versions if all versions of a package are pre-releaseexplicit: Allow pre-release versions for first-party packages with explicit pre-release markers in their version requirementsif-necessary-or-explicit: Allow pre-release versions if all versions of a package are pre-release, or if the package has an explicit pre-release marker in its version requirements
--config-setting,-Cconfig-settingSettings to pass to the PEP 517 build backend, specified as
KEY=VALUEpairs--exclude-newerexclude-newerLimit candidate packages to those that were uploaded prior to the given date.
Accepts both RFC 3339 timestamps (e.g.,
2006-12-02T02:07:43Z) and UTC dates in the same format (e.g.,2006-12-02).--link-modelink-modeThe 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, andhardlinkon Linux and Windows.Possible values:
clone: Clone (i.e., copy-on-write) packages from the wheel into thesite-packagesdirectorycopy: Copy packages from the wheel into thesite-packagesdirectoryhardlink: Hard link packages from the wheel into thesite-packagesdirectorysymlink: Symbolically link packages from the wheel into thesite-packagesdirectory
--no-build-packageno-build-packageDon’t build source distributions for a specific package
--no-binary-packageno-binary-packageDon’t install pre-built wheels for a specific package
--refresh-packagerefresh-packageRefresh cached data for a specific package
--python,-ppythonThe Python interpreter to use to build the run 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--pythonoption allows you to specify a different interpreter.Supported formats:
3.10looks for an installed Python 3.10 usingpy --list-pathson Windows, orpython3.10on Linux and macOS.python3.10orpython.exelooks for a binary with the given name inPATH./home/ferris/.local/bin/python3.10uses the exact Python at the given path.
--cache-dircache-dirPath to the cache directory.
Defaults to
$HOME/Library/Caches/uvon macOS,$XDG_CACHE_HOME/uvor$HOME/.cache/uvon Linux, and{FOLDERID_LocalAppData}\uv\cacheon Windows.--python-preferencepython-preferenceWhether to prefer uv-managed or system Python installations.
By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.
Possible values:
only-managed: Only use managed Python installations; never use system Python installationsmanaged: Prefer managed Python installations over system Python installationssystem: Prefer system Python installations over managed Python installationsonly-system: Only use system Python installations; never use managed Python installations
--python-fetchpython-fetchWhether to automatically download Python when required
Possible values:
automatic: Automatically fetch managed Python installations when neededmanual: Do not automatically fetch managed Python installations; require explicit installation
--colorcolor-choiceControl colors in output
[default: auto]
Possible values:
auto: Enables colored output only when the output is going to a terminal or TTY with supportalways: Enables colored output regardless of the detected environmentnever: Disables colored output
--config-fileconfig-fileThe path to a
uv.tomlfile to use for configuration.While uv configuration can be included in a
pyproject.tomlfile, it is not allowed in this context.
uv tree
Display the project's dependency tree (experimental)
Usage
uv tree [OPTIONS]
Options
--depth,-ddepthMaximum display depth of the dependency tree
[default: 255]
--pruneprunePrune the given package from the display of the dependency tree
--packagepackageDisplay only the specified packages
--no-build-packageno-build-packageDon’t build source distributions for a specific package
--no-binary-packageno-binary-packageDon’t install pre-built wheels for a specific package
--index-url,-iindex-urlThe 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-urlflag.--extra-index-urlextra-index-urlExtra 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-urlflags are provided, earlier values take priority.--find-links,-ffind-linksLocations 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 (.tar.gzor.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.
--upgrade-package,-Pupgrade-packageAllow upgrades for a specific package, ignoring pinned versions in any existing output file
--index-strategyindex-strategyThe 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-match). This prevents "dependency confusion" attacks, whereby an attack can upload a malicious package under the same name to a secondary.Possible values:
first-index: Only use results from the first index that returns a match for a given package nameunsafe-first-match: Search for every package name across all indexes, exhausting the versions from the first index before moving on to the nextunsafe-best-match: Search for every package name across all indexes, preferring the "best" version found. If a package version is in multiple indexes, only look at the entry for the first index
--keyring-providerkeyring-providerAttempt to use
keyringfor authentication for index URLs.At present, only
--keyring-provider subprocessis supported, which configures uv to use thekeyringCLI to handle authentication.Defaults to
disabled.Possible values:
disabled: Do not use keyring for credential lookupsubprocess: Use thekeyringcommand for credential lookup
--resolutionresolutionThe strategy to use when selecting between the different compatible versions for a given package requirement.
By default, uv will use the latest compatible version of each package (
highest).Possible values:
highest: Resolve the highest compatible version of each packagelowest: Resolve the lowest compatible version of each packagelowest-direct: Resolve the lowest compatible version of any direct dependencies, and the highest compatible version of any transitive dependencies
--prereleaseprereleaseThe strategy to use when considering pre-release versions.
By default, uv will accept pre-releases for packages that only publish pre-releases, along with first-party requirements that contain an explicit pre-release marker in the declared specifiers (
if-necessary-or-explicit).Possible values:
disallow: Disallow all pre-release versionsallow: Allow all pre-release versionsif-necessary: Allow pre-release versions if all versions of a package are pre-releaseexplicit: Allow pre-release versions for first-party packages with explicit pre-release markers in their version requirementsif-necessary-or-explicit: Allow pre-release versions if all versions of a package are pre-release, or if the package has an explicit pre-release marker in its version requirements
--config-setting,-Cconfig-settingSettings to pass to the PEP 517 build backend, specified as
KEY=VALUEpairs--exclude-newerexclude-newerLimit candidate packages to those that were uploaded prior to the given date.
Accepts both RFC 3339 timestamps (e.g.,
2006-12-02T02:07:43Z) and UTC dates in the same format (e.g.,2006-12-02).--link-modelink-modeThe 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, andhardlinkon Linux and Windows.Possible values:
clone: Clone (i.e., copy-on-write) packages from the wheel into thesite-packagesdirectorycopy: Copy packages from the wheel into thesite-packagesdirectoryhardlink: Hard link packages from the wheel into thesite-packagesdirectorysymlink: Symbolically link packages from the wheel into thesite-packagesdirectory
--python-versionpython-versionThe Python version to use when filtering the tree (via
--filter). For example, pass--python-version 3.10to display the dependencies that would be included when installing on Python 3.10--python-platformpython-platformThe platform to use when filtering the tree (via
--filter). For example, pass--platform windowsto 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-gnuoraaarch64-apple-darwin.Possible values:
windows: An alias forx86_64-pc-windows-msvc, the default target for Windowslinux: An alias forx86_64-unknown-linux-gnu, the default target for Linuxmacos: An alias foraarch64-apple-darwin, the default target for macOSx86_64-pc-windows-msvc: An x86 Windows targetx86_64-unknown-linux-gnu: An x86 Linux target. Equivalent tox86_64-manylinux_2_17aarch64-apple-darwin: An ARM-based macOS target, as seen on Apple Silicon devicesx86_64-apple-darwin: An x86 macOS targetaarch64-unknown-linux-gnu: An ARM64 Linux target. Equivalent toaarch64-manylinux_2_17aarch64-unknown-linux-musl: An ARM64 Linux targetx86_64-unknown-linux-musl: Anx86_64Linux targetx86_64-manylinux_2_17: Anx86_64target for themanylinux_2_17platformx86_64-manylinux_2_28: Anx86_64target for themanylinux_2_28platformx86_64-manylinux_2_31: Anx86_64target for themanylinux_2_31platformaarch64-manylinux_2_17: An ARM64 target for themanylinux_2_17platformaarch64-manylinux_2_28: An ARM64 target for themanylinux_2_28platformaarch64-manylinux_2_31: An ARM64 target for themanylinux_2_31platform
--python,-ppythonThe Python interpreter for which packages should be listed.
By default, uv installs into the virtual environment in the current working directory or any parent directory. The
--pythonoption allows you to specify a different interpreter, which is intended for use in continuous integration (CI) environments or other automated workflows.Supported formats:
3.10looks for an installed Python 3.10 usingpy --list-pathson Windows, orpython3.10on Linux and macOS.python3.10orpython.exelooks for a binary with the given name inPATH./home/ferris/.local/bin/python3.10uses the exact Python at the given path.
--cache-dircache-dirPath to the cache directory.
Defaults to
$HOME/Library/Caches/uvon macOS,$XDG_CACHE_HOME/uvor$HOME/.cache/uvon Linux, and{FOLDERID_LocalAppData}\uv\cacheon Windows.--python-preferencepython-preferenceWhether to prefer uv-managed or system Python installations.
By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.
Possible values:
only-managed: Only use managed Python installations; never use system Python installationsmanaged: Prefer managed Python installations over system Python installationssystem: Prefer system Python installations over managed Python installationsonly-system: Only use system Python installations; never use managed Python installations
--python-fetchpython-fetchWhether to automatically download Python when required
Possible values:
automatic: Automatically fetch managed Python installations when neededmanual: Do not automatically fetch managed Python installations; require explicit installation
--colorcolor-choiceControl colors in output
[default: auto]
Possible values:
auto: Enables colored output only when the output is going to a terminal or TTY with supportalways: Enables colored output regardless of the detected environmentnever: Disables colored output
--config-fileconfig-fileThe path to a
uv.tomlfile to use for configuration.While uv configuration can be included in a
pyproject.tomlfile, it is not allowed in this context.
uv tool
Run and manage tools provided by Python packages (experimental)
Usage
uv tool [OPTIONS] <COMMAND>
Commands
uv tool runRun a tool
uv tool installInstall a tool
uv tool listList installed tools
uv tool uninstallUninstall a tool
uv tool update-shellEnsure that the tool executable directory is on
PATHuv tool dirShow the tools directory
uv tool run
Run a tool
Usage
uv tool run [OPTIONS] [COMMAND]
Options
--fromfromUse the given package to provide the command.
By default, the package name is assumed to match the command name.
--withwithRun with the given packages installed
--with-requirementswith-requirementsRun with all packages listed in the given
requirements.txtfiles--index-url,-iindex-urlThe 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-urlflag.--extra-index-urlextra-index-urlExtra 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-urlflags are provided, earlier values take priority.--find-links,-ffind-linksLocations 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 (.tar.gzor.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.
--upgrade-package,-Pupgrade-packageAllow upgrades for a specific package, ignoring pinned versions in any existing output file
--reinstall-packagereinstall-packageReinstall a specific package, regardless of whether it’s already installed. Implies
--refresh-package--index-strategyindex-strategyThe 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-match). This prevents "dependency confusion" attacks, whereby an attack can upload a malicious package under the same name to a secondary.Possible values:
first-index: Only use results from the first index that returns a match for a given package nameunsafe-first-match: Search for every package name across all indexes, exhausting the versions from the first index before moving on to the nextunsafe-best-match: Search for every package name across all indexes, preferring the "best" version found. If a package version is in multiple indexes, only look at the entry for the first index
--keyring-providerkeyring-providerAttempt to use
keyringfor authentication for index URLs.At present, only
--keyring-provider subprocessis supported, which configures uv to use thekeyringCLI to handle authentication.Defaults to
disabled.Possible values:
disabled: Do not use keyring for credential lookupsubprocess: Use thekeyringcommand for credential lookup
--resolutionresolutionThe strategy to use when selecting between the different compatible versions for a given package requirement.
By default, uv will use the latest compatible version of each package (
highest).Possible values:
highest: Resolve the highest compatible version of each packagelowest: Resolve the lowest compatible version of each packagelowest-direct: Resolve the lowest compatible version of any direct dependencies, and the highest compatible version of any transitive dependencies
--prereleaseprereleaseThe strategy to use when considering pre-release versions.
By default, uv will accept pre-releases for packages that only publish pre-releases, along with first-party requirements that contain an explicit pre-release marker in the declared specifiers (
if-necessary-or-explicit).Possible values:
disallow: Disallow all pre-release versionsallow: Allow all pre-release versionsif-necessary: Allow pre-release versions if all versions of a package are pre-releaseexplicit: Allow pre-release versions for first-party packages with explicit pre-release markers in their version requirementsif-necessary-or-explicit: Allow pre-release versions if all versions of a package are pre-release, or if the package has an explicit pre-release marker in its version requirements
--config-setting,-Cconfig-settingSettings to pass to the PEP 517 build backend, specified as
KEY=VALUEpairs--exclude-newerexclude-newerLimit candidate packages to those that were uploaded prior to the given date.
Accepts both RFC 3339 timestamps (e.g.,
2006-12-02T02:07:43Z) and UTC dates in the same format (e.g.,2006-12-02).--link-modelink-modeThe method to use when installing packages from the global cache.
Defaults to
clone(also known as Copy-on-Write) on macOS, andhardlinkon Linux and Windows.Possible values:
clone: Clone (i.e., copy-on-write) packages from the wheel into thesite-packagesdirectorycopy: Copy packages from the wheel into thesite-packagesdirectoryhardlink: Hard link packages from the wheel into thesite-packagesdirectorysymlink: Symbolically link packages from the wheel into thesite-packagesdirectory
--no-build-packageno-build-packageDon’t build source distributions for a specific package
--no-binary-packageno-binary-packageDon’t install pre-built wheels for a specific package
--refresh-packagerefresh-packageRefresh cached data for a specific package
--python,-ppythonThe Python interpreter to use to build the run 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--pythonoption allows you to specify a different interpreter.Supported formats:
3.10looks for an installed Python 3.10 usingpy --list-pathson Windows, orpython3.10on Linux and macOS.python3.10orpython.exelooks for a binary with the given name inPATH./home/ferris/.local/bin/python3.10uses the exact Python at the given path.
--cache-dircache-dirPath to the cache directory.
Defaults to
$HOME/Library/Caches/uvon macOS,$XDG_CACHE_HOME/uvor$HOME/.cache/uvon Linux, and{FOLDERID_LocalAppData}\uv\cacheon Windows.--python-preferencepython-preferenceWhether to prefer uv-managed or system Python installations.
By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.
Possible values:
only-managed: Only use managed Python installations; never use system Python installationsmanaged: Prefer managed Python installations over system Python installationssystem: Prefer system Python installations over managed Python installationsonly-system: Only use system Python installations; never use managed Python installations
--python-fetchpython-fetchWhether to automatically download Python when required
Possible values:
automatic: Automatically fetch managed Python installations when neededmanual: Do not automatically fetch managed Python installations; require explicit installation
--colorcolor-choiceControl colors in output
[default: auto]
Possible values:
auto: Enables colored output only when the output is going to a terminal or TTY with supportalways: Enables colored output regardless of the detected environmentnever: Disables colored output
--config-fileconfig-fileThe path to a
uv.tomlfile to use for configuration.While uv configuration can be included in a
pyproject.tomlfile, it is not allowed in this context.
uv tool install
Install a tool
Usage
uv tool install [OPTIONS] <PACKAGE>
Arguments
PACKAGEThe package to install commands from
Options
--withwithInclude the following extra requirements
--with-requirementswith-requirementsRun all requirements listed in the given
requirements.txtfiles--index-url,-iindex-urlThe 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-urlflag.--extra-index-urlextra-index-urlExtra 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-urlflags are provided, earlier values take priority.--find-links,-ffind-linksLocations 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 (.tar.gzor.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.
--upgrade-package,-Pupgrade-packageAllow upgrades for a specific package, ignoring pinned versions in any existing output file
--reinstall-packagereinstall-packageReinstall a specific package, regardless of whether it’s already installed. Implies
--refresh-package--index-strategyindex-strategyThe 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-match). This prevents "dependency confusion" attacks, whereby an attack can upload a malicious package under the same name to a secondary.Possible values:
first-index: Only use results from the first index that returns a match for a given package nameunsafe-first-match: Search for every package name across all indexes, exhausting the versions from the first index before moving on to the nextunsafe-best-match: Search for every package name across all indexes, preferring the "best" version found. If a package version is in multiple indexes, only look at the entry for the first index
--keyring-providerkeyring-providerAttempt to use
keyringfor authentication for index URLs.At present, only
--keyring-provider subprocessis supported, which configures uv to use thekeyringCLI to handle authentication.Defaults to
disabled.Possible values:
disabled: Do not use keyring for credential lookupsubprocess: Use thekeyringcommand for credential lookup
--resolutionresolutionThe strategy to use when selecting between the different compatible versions for a given package requirement.
By default, uv will use the latest compatible version of each package (
highest).Possible values:
highest: Resolve the highest compatible version of each packagelowest: Resolve the lowest compatible version of each packagelowest-direct: Resolve the lowest compatible version of any direct dependencies, and the highest compatible version of any transitive dependencies
--prereleaseprereleaseThe strategy to use when considering pre-release versions.
By default, uv will accept pre-releases for packages that only publish pre-releases, along with first-party requirements that contain an explicit pre-release marker in the declared specifiers (
if-necessary-or-explicit).Possible values:
disallow: Disallow all pre-release versionsallow: Allow all pre-release versionsif-necessary: Allow pre-release versions if all versions of a package are pre-releaseexplicit: Allow pre-release versions for first-party packages with explicit pre-release markers in their version requirementsif-necessary-or-explicit: Allow pre-release versions if all versions of a package are pre-release, or if the package has an explicit pre-release marker in its version requirements
--config-setting,-Cconfig-settingSettings to pass to the PEP 517 build backend, specified as
KEY=VALUEpairs--exclude-newerexclude-newerLimit candidate packages to those that were uploaded prior to the given date.
Accepts both RFC 3339 timestamps (e.g.,
2006-12-02T02:07:43Z) and UTC dates in the same format (e.g.,2006-12-02).--link-modelink-modeThe method to use when installing packages from the global cache.
Defaults to
clone(also known as Copy-on-Write) on macOS, andhardlinkon Linux and Windows.Possible values:
clone: Clone (i.e., copy-on-write) packages from the wheel into thesite-packagesdirectorycopy: Copy packages from the wheel into thesite-packagesdirectoryhardlink: Hard link packages from the wheel into thesite-packagesdirectorysymlink: Symbolically link packages from the wheel into thesite-packagesdirectory
--no-build-packageno-build-packageDon’t build source distributions for a specific package
--no-binary-packageno-binary-packageDon’t install pre-built wheels for a specific package
--refresh-packagerefresh-packageRefresh cached data for a specific package
--python,-ppythonThe Python interpreter to use to build the tool environment.
By default, uv will search for a Python executable in the
PATH. uv ignores virtual environments while looking for interpreter for tools. The--pythonoption allows you to specify a different interpreter.Supported formats:
3.10looks for an installed Python 3.10 usingpy --list-pathson Windows, orpython3.10on Linux and macOS.python3.10orpython.exelooks for a binary with the given name inPATH./home/ferris/.local/bin/python3.10uses the exact Python at the given path.
--cache-dircache-dirPath to the cache directory.
Defaults to
$HOME/Library/Caches/uvon macOS,$XDG_CACHE_HOME/uvor$HOME/.cache/uvon Linux, and{FOLDERID_LocalAppData}\uv\cacheon Windows.--python-preferencepython-preferenceWhether to prefer uv-managed or system Python installations.
By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.
Possible values:
only-managed: Only use managed Python installations; never use system Python installationsmanaged: Prefer managed Python installations over system Python installationssystem: Prefer system Python installations over managed Python installationsonly-system: Only use system Python installations; never use managed Python installations
--python-fetchpython-fetchWhether to automatically download Python when required
Possible values:
automatic: Automatically fetch managed Python installations when neededmanual: Do not automatically fetch managed Python installations; require explicit installation
--colorcolor-choiceControl colors in output
[default: auto]
Possible values:
auto: Enables colored output only when the output is going to a terminal or TTY with supportalways: Enables colored output regardless of the detected environmentnever: Disables colored output
--config-fileconfig-fileThe path to a
uv.tomlfile to use for configuration.While uv configuration can be included in a
pyproject.tomlfile, it is not allowed in this context.
uv tool list
List installed tools
Usage
uv tool list [OPTIONS]
Options
--cache-dircache-dirPath to the cache directory.
Defaults to
$HOME/Library/Caches/uvon macOS,$XDG_CACHE_HOME/uvor$HOME/.cache/uvon Linux, and{FOLDERID_LocalAppData}\uv\cacheon Windows.--python-preferencepython-preferenceWhether to prefer uv-managed or system Python installations.
By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.
Possible values:
only-managed: Only use managed Python installations; never use system Python installationsmanaged: Prefer managed Python installations over system Python installationssystem: Prefer system Python installations over managed Python installationsonly-system: Only use system Python installations; never use managed Python installations
--python-fetchpython-fetchWhether to automatically download Python when required
Possible values:
automatic: Automatically fetch managed Python installations when neededmanual: Do not automatically fetch managed Python installations; require explicit installation
--colorcolor-choiceControl colors in output
[default: auto]
Possible values:
auto: Enables colored output only when the output is going to a terminal or TTY with supportalways: Enables colored output regardless of the detected environmentnever: Disables colored output
--config-fileconfig-fileThe path to a
uv.tomlfile to use for configuration.While uv configuration can be included in a
pyproject.tomlfile, it is not allowed in this context.
uv tool uninstall
Uninstall a tool
Usage
uv tool uninstall [OPTIONS] <NAME>
Arguments
NAMEThe name of the tool to uninstall
Options
--cache-dircache-dirPath to the cache directory.
Defaults to
$HOME/Library/Caches/uvon macOS,$XDG_CACHE_HOME/uvor$HOME/.cache/uvon Linux, and{FOLDERID_LocalAppData}\uv\cacheon Windows.--python-preferencepython-preferenceWhether to prefer uv-managed or system Python installations.
By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.
Possible values:
only-managed: Only use managed Python installations; never use system Python installationsmanaged: Prefer managed Python installations over system Python installationssystem: Prefer system Python installations over managed Python installationsonly-system: Only use system Python installations; never use managed Python installations
--python-fetchpython-fetchWhether to automatically download Python when required
Possible values:
automatic: Automatically fetch managed Python installations when neededmanual: Do not automatically fetch managed Python installations; require explicit installation
--colorcolor-choiceControl colors in output
[default: auto]
Possible values:
auto: Enables colored output only when the output is going to a terminal or TTY with supportalways: Enables colored output regardless of the detected environmentnever: Disables colored output
--config-fileconfig-fileThe path to a
uv.tomlfile to use for configuration.While uv configuration can be included in a
pyproject.tomlfile, it is not allowed in this context.
uv tool update-shell
Ensure that the tool executable directory is on PATH
Usage
uv tool update-shell [OPTIONS]
Options
--cache-dircache-dirPath to the cache directory.
Defaults to
$HOME/Library/Caches/uvon macOS,$XDG_CACHE_HOME/uvor$HOME/.cache/uvon Linux, and{FOLDERID_LocalAppData}\uv\cacheon Windows.--python-preferencepython-preferenceWhether to prefer uv-managed or system Python installations.
By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.
Possible values:
only-managed: Only use managed Python installations; never use system Python installationsmanaged: Prefer managed Python installations over system Python installationssystem: Prefer system Python installations over managed Python installationsonly-system: Only use system Python installations; never use managed Python installations
--python-fetchpython-fetchWhether to automatically download Python when required
Possible values:
automatic: Automatically fetch managed Python installations when neededmanual: Do not automatically fetch managed Python installations; require explicit installation
--colorcolor-choiceControl colors in output
[default: auto]
Possible values:
auto: Enables colored output only when the output is going to a terminal or TTY with supportalways: Enables colored output regardless of the detected environmentnever: Disables colored output
--config-fileconfig-fileThe path to a
uv.tomlfile to use for configuration.While uv configuration can be included in a
pyproject.tomlfile, it is not allowed in this context.
uv tool dir
Show the tools directory
Usage
uv tool dir [OPTIONS]
Options
--cache-dircache-dirPath to the cache directory.
Defaults to
$HOME/Library/Caches/uvon macOS,$XDG_CACHE_HOME/uvor$HOME/.cache/uvon Linux, and{FOLDERID_LocalAppData}\uv\cacheon Windows.--python-preferencepython-preferenceWhether to prefer uv-managed or system Python installations.
By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.
Possible values:
only-managed: Only use managed Python installations; never use system Python installationsmanaged: Prefer managed Python installations over system Python installationssystem: Prefer system Python installations over managed Python installationsonly-system: Only use system Python installations; never use managed Python installations
--python-fetchpython-fetchWhether to automatically download Python when required
Possible values:
automatic: Automatically fetch managed Python installations when neededmanual: Do not automatically fetch managed Python installations; require explicit installation
--colorcolor-choiceControl colors in output
[default: auto]
Possible values:
auto: Enables colored output only when the output is going to a terminal or TTY with supportalways: Enables colored output regardless of the detected environmentnever: Disables colored output
--config-fileconfig-fileThe path to a
uv.tomlfile to use for configuration.While uv configuration can be included in a
pyproject.tomlfile, it is not allowed in this context.
uv python
Manage Python versions and installations (experimental)
Usage
uv python [OPTIONS] <COMMAND>
Commands
uv python listList the available Python installations
uv python installDownload and install Python versions
uv python findSearch for a Python installation
uv python pinPin to a specific Python version
uv python dirShow the uv Python installation directory
uv python uninstallUninstall Python versions
uv python list
List the available Python installations
Usage
uv python list [OPTIONS]
Options
--cache-dircache-dirPath to the cache directory.
Defaults to
$HOME/Library/Caches/uvon macOS,$XDG_CACHE_HOME/uvor$HOME/.cache/uvon Linux, and{FOLDERID_LocalAppData}\uv\cacheon Windows.--python-preferencepython-preferenceWhether to prefer uv-managed or system Python installations.
By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.
Possible values:
only-managed: Only use managed Python installations; never use system Python installationsmanaged: Prefer managed Python installations over system Python installationssystem: Prefer system Python installations over managed Python installationsonly-system: Only use system Python installations; never use managed Python installations
--python-fetchpython-fetchWhether to automatically download Python when required
Possible values:
automatic: Automatically fetch managed Python installations when neededmanual: Do not automatically fetch managed Python installations; require explicit installation
--colorcolor-choiceControl colors in output
[default: auto]
Possible values:
auto: Enables colored output only when the output is going to a terminal or TTY with supportalways: Enables colored output regardless of the detected environmentnever: Disables colored output
--config-fileconfig-fileThe path to a
uv.tomlfile to use for configuration.While uv configuration can be included in a
pyproject.tomlfile, it is not allowed in this context.
uv python install
Download and install Python versions
Usage
uv python install [OPTIONS] [TARGETS]...
Arguments
TARGETSThe Python version(s) to install.
If not provided, the requested Python version(s) will be read from the
.python-versionsor.python-versionfiles. If neither file is present, uv will check if it has installed any Python versions. If not, it will install the latest stable version of Python.
Options
--cache-dircache-dirPath to the cache directory.
Defaults to
$HOME/Library/Caches/uvon macOS,$XDG_CACHE_HOME/uvor$HOME/.cache/uvon Linux, and{FOLDERID_LocalAppData}\uv\cacheon Windows.--python-preferencepython-preferenceWhether to prefer uv-managed or system Python installations.
By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.
Possible values:
only-managed: Only use managed Python installations; never use system Python installationsmanaged: Prefer managed Python installations over system Python installationssystem: Prefer system Python installations over managed Python installationsonly-system: Only use system Python installations; never use managed Python installations
--python-fetchpython-fetchWhether to automatically download Python when required
Possible values:
automatic: Automatically fetch managed Python installations when neededmanual: Do not automatically fetch managed Python installations; require explicit installation
--colorcolor-choiceControl colors in output
[default: auto]
Possible values:
auto: Enables colored output only when the output is going to a terminal or TTY with supportalways: Enables colored output regardless of the detected environmentnever: Disables colored output
--config-fileconfig-fileThe path to a
uv.tomlfile to use for configuration.While uv configuration can be included in a
pyproject.tomlfile, it is not allowed in this context.
uv python find
Search for a Python installation
Usage
uv python find [OPTIONS] [REQUEST]
Arguments
REQUESTThe Python request
Options
--cache-dircache-dirPath to the cache directory.
Defaults to
$HOME/Library/Caches/uvon macOS,$XDG_CACHE_HOME/uvor$HOME/.cache/uvon Linux, and{FOLDERID_LocalAppData}\uv\cacheon Windows.--python-preferencepython-preferenceWhether to prefer uv-managed or system Python installations.
By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.
Possible values:
only-managed: Only use managed Python installations; never use system Python installationsmanaged: Prefer managed Python installations over system Python installationssystem: Prefer system Python installations over managed Python installationsonly-system: Only use system Python installations; never use managed Python installations
--python-fetchpython-fetchWhether to automatically download Python when required
Possible values:
automatic: Automatically fetch managed Python installations when neededmanual: Do not automatically fetch managed Python installations; require explicit installation
--colorcolor-choiceControl colors in output
[default: auto]
Possible values:
auto: Enables colored output only when the output is going to a terminal or TTY with supportalways: Enables colored output regardless of the detected environmentnever: Disables colored output
--config-fileconfig-fileThe path to a
uv.tomlfile to use for configuration.While uv configuration can be included in a
pyproject.tomlfile, it is not allowed in this context.
uv python pin
Pin to a specific Python version
Usage
uv python pin [OPTIONS] [REQUEST]
Arguments
REQUESTThe Python version
Options
--cache-dircache-dirPath to the cache directory.
Defaults to
$HOME/Library/Caches/uvon macOS,$XDG_CACHE_HOME/uvor$HOME/.cache/uvon Linux, and{FOLDERID_LocalAppData}\uv\cacheon Windows.--python-preferencepython-preferenceWhether to prefer uv-managed or system Python installations.
By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.
Possible values:
only-managed: Only use managed Python installations; never use system Python installationsmanaged: Prefer managed Python installations over system Python installationssystem: Prefer system Python installations over managed Python installationsonly-system: Only use system Python installations; never use managed Python installations
--python-fetchpython-fetchWhether to automatically download Python when required
Possible values:
automatic: Automatically fetch managed Python installations when neededmanual: Do not automatically fetch managed Python installations; require explicit installation
--colorcolor-choiceControl colors in output
[default: auto]
Possible values:
auto: Enables colored output only when the output is going to a terminal or TTY with supportalways: Enables colored output regardless of the detected environmentnever: Disables colored output
--config-fileconfig-fileThe path to a
uv.tomlfile to use for configuration.While uv configuration can be included in a
pyproject.tomlfile, it is not allowed in this context.
uv python dir
Show the uv Python installation directory
Usage
uv python dir [OPTIONS]
Options
--cache-dircache-dirPath to the cache directory.
Defaults to
$HOME/Library/Caches/uvon macOS,$XDG_CACHE_HOME/uvor$HOME/.cache/uvon Linux, and{FOLDERID_LocalAppData}\uv\cacheon Windows.--python-preferencepython-preferenceWhether to prefer uv-managed or system Python installations.
By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.
Possible values:
only-managed: Only use managed Python installations; never use system Python installationsmanaged: Prefer managed Python installations over system Python installationssystem: Prefer system Python installations over managed Python installationsonly-system: Only use system Python installations; never use managed Python installations
--python-fetchpython-fetchWhether to automatically download Python when required
Possible values:
automatic: Automatically fetch managed Python installations when neededmanual: Do not automatically fetch managed Python installations; require explicit installation
--colorcolor-choiceControl colors in output
[default: auto]
Possible values:
auto: Enables colored output only when the output is going to a terminal or TTY with supportalways: Enables colored output regardless of the detected environmentnever: Disables colored output
--config-fileconfig-fileThe path to a
uv.tomlfile to use for configuration.While uv configuration can be included in a
pyproject.tomlfile, it is not allowed in this context.
uv python uninstall
Uninstall Python versions
Usage
uv python uninstall [OPTIONS] <TARGETS>...
Arguments
TARGETSThe Python version(s) to uninstall
Options
--cache-dircache-dirPath to the cache directory.
Defaults to
$HOME/Library/Caches/uvon macOS,$XDG_CACHE_HOME/uvor$HOME/.cache/uvon Linux, and{FOLDERID_LocalAppData}\uv\cacheon Windows.--python-preferencepython-preferenceWhether to prefer uv-managed or system Python installations.
By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.
Possible values:
only-managed: Only use managed Python installations; never use system Python installationsmanaged: Prefer managed Python installations over system Python installationssystem: Prefer system Python installations over managed Python installationsonly-system: Only use system Python installations; never use managed Python installations
--python-fetchpython-fetchWhether to automatically download Python when required
Possible values:
automatic: Automatically fetch managed Python installations when neededmanual: Do not automatically fetch managed Python installations; require explicit installation
--colorcolor-choiceControl colors in output
[default: auto]
Possible values:
auto: Enables colored output only when the output is going to a terminal or TTY with supportalways: Enables colored output regardless of the detected environmentnever: Disables colored output
--config-fileconfig-fileThe path to a
uv.tomlfile to use for configuration.While uv configuration can be included in a
pyproject.tomlfile, it is not allowed in this context.
uv pip
Manage Python packages with a pip-compatible interface
Usage
uv pip [OPTIONS] <COMMAND>
Commands
uv pip compileCompile a
requirements.infile to arequirements.txtfileuv pip syncSync an environment with a
requirements.txtfileuv pip installInstall packages into an environment
uv pip uninstallUninstall packages from an environment
uv pip freezeList, in requirements format, packages installed in an environment
uv pip listList, in tabular format, packages installed in an environment
uv pip showShow information about one or more installed packages
uv pip treeDisplay the dependency tree for an environment
uv pip checkVerify installed packages have compatible dependencies
uv pip compile
Compile a requirements.in file to a requirements.txt file
Usage
uv pip compile [OPTIONS] <SRC_FILE>...
Arguments
SRC_FILEInclude all packages listed in the given
requirements.infiles.If a
pyproject.toml,setup.py, orsetup.cfgfile is provided, uv will extract the requirements for the relevant project.If
-is provided, then requirements will be read from stdin.
Options
--constraint,-cconstraintConstrain 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
--constraintoption.--overrideoverrideOverride 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.
--build-constraint,-bbuild-constraintConstrain 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.--extraextraInclude optional dependencies from the extra group name; may be provided more than once.
Only applies to
pyproject.toml,setup.py, andsetup.cfgsources.--index-url,-iindex-urlThe 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-urlflag.--extra-index-urlextra-index-urlExtra 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-urlflags are provided, earlier values take priority.--find-links,-ffind-linksLocations 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 (.tar.gzor.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.
--upgrade-package,-Pupgrade-packageAllow upgrades for a specific package, ignoring pinned versions in any existing output file
--index-strategyindex-strategyThe 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-match). This prevents "dependency confusion" attacks, whereby an attack can upload a malicious package under the same name to a secondary.Possible values:
first-index: Only use results from the first index that returns a match for a given package nameunsafe-first-match: Search for every package name across all indexes, exhausting the versions from the first index before moving on to the nextunsafe-best-match: Search for every package name across all indexes, preferring the "best" version found. If a package version is in multiple indexes, only look at the entry for the first index
--keyring-providerkeyring-providerAttempt to use
keyringfor authentication for index URLs.At present, only
--keyring-provider subprocessis supported, which configures uv to use thekeyringCLI to handle authentication.Defaults to
disabled.Possible values:
disabled: Do not use keyring for credential lookupsubprocess: Use thekeyringcommand for credential lookup
--resolutionresolutionThe strategy to use when selecting between the different compatible versions for a given package requirement.
By default, uv will use the latest compatible version of each package (
highest).Possible values:
highest: Resolve the highest compatible version of each packagelowest: Resolve the lowest compatible version of each packagelowest-direct: Resolve the lowest compatible version of any direct dependencies, and the highest compatible version of any transitive dependencies
--prereleaseprereleaseThe strategy to use when considering pre-release versions.
By default, uv will accept pre-releases for packages that only publish pre-releases, along with first-party requirements that contain an explicit pre-release marker in the declared specifiers (
if-necessary-or-explicit).Possible values:
disallow: Disallow all pre-release versionsallow: Allow all pre-release versionsif-necessary: Allow pre-release versions if all versions of a package are pre-releaseexplicit: Allow pre-release versions for first-party packages with explicit pre-release markers in their version requirementsif-necessary-or-explicit: Allow pre-release versions if all versions of a package are pre-release, or if the package has an explicit pre-release marker in its version requirements
--config-setting,-Cconfig-settingSettings to pass to the PEP 517 build backend, specified as
KEY=VALUEpairs--exclude-newerexclude-newerLimit candidate packages to those that were uploaded prior to the given date.
Accepts both RFC 3339 timestamps (e.g.,
2006-12-02T02:07:43Z) and UTC dates in the same format (e.g.,2006-12-02).--link-modelink-modeThe 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, andhardlinkon Linux and Windows.Possible values:
clone: Clone (i.e., copy-on-write) packages from the wheel into thesite-packagesdirectorycopy: Copy packages from the wheel into thesite-packagesdirectoryhardlink: Hard link packages from the wheel into thesite-packagesdirectorysymlink: Symbolically link packages from the wheel into thesite-packagesdirectory
--refresh-packagerefresh-packageRefresh cached data for a specific package
--output-file,-ooutput-fileWrite the compiled requirements to the given
requirements.txtfile.If the file already exists, the existing versions will be preferred when resolving dependencies, unless
--upgradeis also specified.--annotation-styleannotation-styleThe 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 linesplit: Render each annotation on its own line
--custom-compile-commandcustom-compile-commandThe 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.--pythonpythonThe Python interpreter against which to compile the requirements.
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--pythonoption allows you to specify a different interpreter.Supported formats:
3.10looks for an installed Python 3.10 usingpy --list-pathson Windows, orpython3.10on Linux and macOS.python3.10orpython.exelooks for a binary with the given name inPATH./home/ferris/.local/bin/python3.10uses the exact Python at the given path.
--no-binaryno-binaryDon’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:.--only-binaryonly-binaryOnly 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:.--python-version,-ppython-versionThe minimum Python version that should be supported by the resolved requirements (e.g.,
3.8or3.8.17).If a patch version is omitted, the minimum patch version is assumed. For example,
3.8is mapped to3.8.0.--python-platformpython-platformThe 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-gnuoraaarch64-apple-darwin.Possible values:
windows: An alias forx86_64-pc-windows-msvc, the default target for Windowslinux: An alias forx86_64-unknown-linux-gnu, the default target for Linuxmacos: An alias foraarch64-apple-darwin, the default target for macOSx86_64-pc-windows-msvc: An x86 Windows targetx86_64-unknown-linux-gnu: An x86 Linux target. Equivalent tox86_64-manylinux_2_17aarch64-apple-darwin: An ARM-based macOS target, as seen on Apple Silicon devicesx86_64-apple-darwin: An x86 macOS targetaarch64-unknown-linux-gnu: An ARM64 Linux target. Equivalent toaarch64-manylinux_2_17aarch64-unknown-linux-musl: An ARM64 Linux targetx86_64-unknown-linux-musl: Anx86_64Linux targetx86_64-manylinux_2_17: Anx86_64target for themanylinux_2_17platformx86_64-manylinux_2_28: Anx86_64target for themanylinux_2_28platformx86_64-manylinux_2_31: Anx86_64target for themanylinux_2_31platformaarch64-manylinux_2_17: An ARM64 target for themanylinux_2_17platformaarch64-manylinux_2_28: An ARM64 target for themanylinux_2_28platformaarch64-manylinux_2_31: An ARM64 target for themanylinux_2_31platform
--no-emit-packageno-emit-packageSpecify a package to omit from the output resolution. Its dependencies will still be included in the resolution. Equivalent to pip-compile’s
--unsafe-packageoption--cache-dircache-dirPath to the cache directory.
Defaults to
$HOME/Library/Caches/uvon macOS,$XDG_CACHE_HOME/uvor$HOME/.cache/uvon Linux, and{FOLDERID_LocalAppData}\uv\cacheon Windows.--python-preferencepython-preferenceWhether to prefer uv-managed or system Python installations.
By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.
Possible values:
only-managed: Only use managed Python installations; never use system Python installationsmanaged: Prefer managed Python installations over system Python installationssystem: Prefer system Python installations over managed Python installationsonly-system: Only use system Python installations; never use managed Python installations
--python-fetchpython-fetchWhether to automatically download Python when required
Possible values:
automatic: Automatically fetch managed Python installations when neededmanual: Do not automatically fetch managed Python installations; require explicit installation
--colorcolor-choiceControl colors in output
[default: auto]
Possible values:
auto: Enables colored output only when the output is going to a terminal or TTY with supportalways: Enables colored output regardless of the detected environmentnever: Disables colored output
--config-fileconfig-fileThe path to a
uv.tomlfile to use for configuration.While uv configuration can be included in a
pyproject.tomlfile, it is not allowed in this context.
uv pip sync
Sync an environment with a requirements.txt file
Usage
uv pip sync [OPTIONS] <SRC_FILE>...
Arguments
SRC_FILEInclude all packages listed in the given
requirements.txtfiles.If a
pyproject.toml,setup.py, orsetup.cfgfile is provided, uv will extract the requirements for the relevant project.If
-is provided, then requirements will be read from stdin.
Options
--constraint,-cconstraintConstrain 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
--constraintoption.--build-constraint,-bbuild-constraintConstrain 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.--index-url,-iindex-urlThe 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-urlflag.--extra-index-urlextra-index-urlExtra 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-urlflags are provided, earlier values take priority.--find-links,-ffind-linksLocations 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 (.tar.gzor.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.
--reinstall-packagereinstall-packageReinstall a specific package, regardless of whether it’s already installed. Implies
--refresh-package--index-strategyindex-strategyThe 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-match). This prevents "dependency confusion" attacks, whereby an attack can upload a malicious package under the same name to a secondary.Possible values:
first-index: Only use results from the first index that returns a match for a given package nameunsafe-first-match: Search for every package name across all indexes, exhausting the versions from the first index before moving on to the nextunsafe-best-match: Search for every package name across all indexes, preferring the "best" version found. If a package version is in multiple indexes, only look at the entry for the first index
--keyring-providerkeyring-providerAttempt to use
keyringfor authentication for index URLs.At present, only
--keyring-provider subprocessis supported, which configures uv to use thekeyringCLI to handle authentication.Defaults to
disabled.Possible values:
disabled: Do not use keyring for credential lookupsubprocess: Use thekeyringcommand for credential lookup
--config-setting,-Cconfig-settingSettings to pass to the PEP 517 build backend, specified as
KEY=VALUEpairs--exclude-newerexclude-newerLimit candidate packages to those that were uploaded prior to the given date.
Accepts both RFC 3339 timestamps (e.g.,
2006-12-02T02:07:43Z) and UTC dates in the same format (e.g.,2006-12-02).--link-modelink-modeThe method to use when installing packages from the global cache.
Defaults to
clone(also known as Copy-on-Write) on macOS, andhardlinkon Linux and Windows.Possible values:
clone: Clone (i.e., copy-on-write) packages from the wheel into thesite-packagesdirectorycopy: Copy packages from the wheel into thesite-packagesdirectoryhardlink: Hard link packages from the wheel into thesite-packagesdirectorysymlink: Symbolically link packages from the wheel into thesite-packagesdirectory
--refresh-packagerefresh-packageRefresh cached data for a specific package
--python,-ppythonThe Python interpreter into which packages should be installed.
By default, uv installs into the virtual environment in the current working directory or any parent directory. The
--pythonoption allows you to specify a different interpreter, which is intended for use in continuous integration (CI) environments or other automated workflows.Supported formats:
3.10looks for an installed Python 3.10 usingpy --list-pathson Windows, orpython3.10on Linux and macOS.python3.10orpython.exelooks for a binary with the given name inPATH./home/ferris/.local/bin/python3.10uses the exact Python at the given path.
--targettargetInstall 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
--prefixprefixInstall 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
--pythonto install into an alternate environment, as scripts and other artifacts installed via--prefixwill reference the installing interpreter, rather than any interpreter added to the--prefixdirectory, rendering them non-portable.--no-binaryno-binaryDon’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:.--only-binaryonly-binaryOnly 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:.--python-versionpython-versionThe minimum Python version that should be supported by the requirements (e.g.,
3.7or3.7.9).If a patch version is omitted, the minimum patch version is assumed. For example,
3.7is mapped to3.7.0.--python-platformpython-platformThe 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-gnuoraaarch64-apple-darwin.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-platformoption is intended for advanced use cases.Possible values:
windows: An alias forx86_64-pc-windows-msvc, the default target for Windowslinux: An alias forx86_64-unknown-linux-gnu, the default target for Linuxmacos: An alias foraarch64-apple-darwin, the default target for macOSx86_64-pc-windows-msvc: An x86 Windows targetx86_64-unknown-linux-gnu: An x86 Linux target. Equivalent tox86_64-manylinux_2_17aarch64-apple-darwin: An ARM-based macOS target, as seen on Apple Silicon devicesx86_64-apple-darwin: An x86 macOS targetaarch64-unknown-linux-gnu: An ARM64 Linux target. Equivalent toaarch64-manylinux_2_17aarch64-unknown-linux-musl: An ARM64 Linux targetx86_64-unknown-linux-musl: Anx86_64Linux targetx86_64-manylinux_2_17: Anx86_64target for themanylinux_2_17platformx86_64-manylinux_2_28: Anx86_64target for themanylinux_2_28platformx86_64-manylinux_2_31: Anx86_64target for themanylinux_2_31platformaarch64-manylinux_2_17: An ARM64 target for themanylinux_2_17platformaarch64-manylinux_2_28: An ARM64 target for themanylinux_2_28platformaarch64-manylinux_2_31: An ARM64 target for themanylinux_2_31platform
--cache-dircache-dirPath to the cache directory.
Defaults to
$HOME/Library/Caches/uvon macOS,$XDG_CACHE_HOME/uvor$HOME/.cache/uvon Linux, and{FOLDERID_LocalAppData}\uv\cacheon Windows.--python-preferencepython-preferenceWhether to prefer uv-managed or system Python installations.
By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.
Possible values:
only-managed: Only use managed Python installations; never use system Python installationsmanaged: Prefer managed Python installations over system Python installationssystem: Prefer system Python installations over managed Python installationsonly-system: Only use system Python installations; never use managed Python installations
--python-fetchpython-fetchWhether to automatically download Python when required
Possible values:
automatic: Automatically fetch managed Python installations when neededmanual: Do not automatically fetch managed Python installations; require explicit installation
--colorcolor-choiceControl colors in output
[default: auto]
Possible values:
auto: Enables colored output only when the output is going to a terminal or TTY with supportalways: Enables colored output regardless of the detected environmentnever: Disables colored output
--config-fileconfig-fileThe path to a
uv.tomlfile to use for configuration.While uv configuration can be included in a
pyproject.tomlfile, it is not allowed in this context.
uv pip install
Install packages into an environment
Usage
uv pip install [OPTIONS] <PACKAGE|--requirement <REQUIREMENT>|--editable <EDITABLE>>
Arguments
PACKAGEInstall all listed packages
Options
--requirement,-rrequirementInstall all packages listed in the given
requirements.txtfiles.If a
pyproject.toml,setup.py, orsetup.cfgfile is provided, uv will extract the requirements for the relevant project.If
-is provided, then requirements will be read from stdin.--editable,-eeditableInstall the editable package based on the provided local file path
--constraint,-cconstraintConstrain 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
--constraintoption.--overrideoverrideOverride 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.
--build-constraint,-bbuild-constraintConstrain 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.--extraextraInclude optional dependencies from the extra group name; may be provided more than once.
Only applies to
pyproject.toml,setup.py, andsetup.cfgsources.--index-url,-iindex-urlThe 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-urlflag.--extra-index-urlextra-index-urlExtra 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-urlflags are provided, earlier values take priority.--find-links,-ffind-linksLocations 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 (.tar.gzor.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.
--upgrade-package,-Pupgrade-packageAllow upgrades for a specific package, ignoring pinned versions in any existing output file
--reinstall-packagereinstall-packageReinstall a specific package, regardless of whether it’s already installed. Implies
--refresh-package--index-strategyindex-strategyThe 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-match). This prevents "dependency confusion" attacks, whereby an attack can upload a malicious package under the same name to a secondary.Possible values:
first-index: Only use results from the first index that returns a match for a given package nameunsafe-first-match: Search for every package name across all indexes, exhausting the versions from the first index before moving on to the nextunsafe-best-match: Search for every package name across all indexes, preferring the "best" version found. If a package version is in multiple indexes, only look at the entry for the first index
--keyring-providerkeyring-providerAttempt to use
keyringfor authentication for index URLs.At present, only
--keyring-provider subprocessis supported, which configures uv to use thekeyringCLI to handle authentication.Defaults to
disabled.Possible values:
disabled: Do not use keyring for credential lookupsubprocess: Use thekeyringcommand for credential lookup
--resolutionresolutionThe strategy to use when selecting between the different compatible versions for a given package requirement.
By default, uv will use the latest compatible version of each package (
highest).Possible values:
highest: Resolve the highest compatible version of each packagelowest: Resolve the lowest compatible version of each packagelowest-direct: Resolve the lowest compatible version of any direct dependencies, and the highest compatible version of any transitive dependencies
--prereleaseprereleaseThe strategy to use when considering pre-release versions.
By default, uv will accept pre-releases for packages that only publish pre-releases, along with first-party requirements that contain an explicit pre-release marker in the declared specifiers (
if-necessary-or-explicit).Possible values:
disallow: Disallow all pre-release versionsallow: Allow all pre-release versionsif-necessary: Allow pre-release versions if all versions of a package are pre-releaseexplicit: Allow pre-release versions for first-party packages with explicit pre-release markers in their version requirementsif-necessary-or-explicit: Allow pre-release versions if all versions of a package are pre-release, or if the package has an explicit pre-release marker in its version requirements
--config-setting,-Cconfig-settingSettings to pass to the PEP 517 build backend, specified as
KEY=VALUEpairs--exclude-newerexclude-newerLimit candidate packages to those that were uploaded prior to the given date.
Accepts both RFC 3339 timestamps (e.g.,
2006-12-02T02:07:43Z) and UTC dates in the same format (e.g.,2006-12-02).--link-modelink-modeThe method to use when installing packages from the global cache.
Defaults to
clone(also known as Copy-on-Write) on macOS, andhardlinkon Linux and Windows.Possible values:
clone: Clone (i.e., copy-on-write) packages from the wheel into thesite-packagesdirectorycopy: Copy packages from the wheel into thesite-packagesdirectoryhardlink: Hard link packages from the wheel into thesite-packagesdirectorysymlink: Symbolically link packages from the wheel into thesite-packagesdirectory
--refresh-packagerefresh-packageRefresh cached data for a specific package
--python,-ppythonThe Python interpreter into which packages should be installed.
By default, uv installs into the virtual environment in the current working directory or any parent directory. The
--pythonoption allows you to specify a different interpreter, which is intended for use in continuous integration (CI) environments or other automated workflows.Supported formats:
3.10looks for an installed Python 3.10 usingpy --list-pathson Windows, orpython3.10on Linux and macOS.python3.10orpython.exelooks for a binary with the given name inPATH./home/ferris/.local/bin/python3.10uses the exact Python at the given path.
--targettargetInstall 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
--prefixprefixInstall 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
--pythonto install into an alternate environment, as scripts and other artifacts installed via--prefixwill reference the installing interpreter, rather than any interpreter added to the--prefixdirectory, rendering them non-portable.--no-binaryno-binaryDon’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:.--only-binaryonly-binaryOnly 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:.--python-versionpython-versionThe minimum Python version that should be supported by the requirements (e.g.,
3.7or3.7.9).If a patch version is omitted, the minimum patch version is assumed. For example,
3.7is mapped to3.7.0.--python-platformpython-platformThe 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-gnuoraaarch64-apple-darwin.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-platformoption is intended for advanced use cases.Possible values:
windows: An alias forx86_64-pc-windows-msvc, the default target for Windowslinux: An alias forx86_64-unknown-linux-gnu, the default target for Linuxmacos: An alias foraarch64-apple-darwin, the default target for macOSx86_64-pc-windows-msvc: An x86 Windows targetx86_64-unknown-linux-gnu: An x86 Linux target. Equivalent tox86_64-manylinux_2_17aarch64-apple-darwin: An ARM-based macOS target, as seen on Apple Silicon devicesx86_64-apple-darwin: An x86 macOS targetaarch64-unknown-linux-gnu: An ARM64 Linux target. Equivalent toaarch64-manylinux_2_17aarch64-unknown-linux-musl: An ARM64 Linux targetx86_64-unknown-linux-musl: Anx86_64Linux targetx86_64-manylinux_2_17: Anx86_64target for themanylinux_2_17platformx86_64-manylinux_2_28: Anx86_64target for themanylinux_2_28platformx86_64-manylinux_2_31: Anx86_64target for themanylinux_2_31platformaarch64-manylinux_2_17: An ARM64 target for themanylinux_2_17platformaarch64-manylinux_2_28: An ARM64 target for themanylinux_2_28platformaarch64-manylinux_2_31: An ARM64 target for themanylinux_2_31platform
--cache-dircache-dirPath to the cache directory.
Defaults to
$HOME/Library/Caches/uvon macOS,$XDG_CACHE_HOME/uvor$HOME/.cache/uvon Linux, and{FOLDERID_LocalAppData}\uv\cacheon Windows.--python-preferencepython-preferenceWhether to prefer uv-managed or system Python installations.
By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.
Possible values:
only-managed: Only use managed Python installations; never use system Python installationsmanaged: Prefer managed Python installations over system Python installationssystem: Prefer system Python installations over managed Python installationsonly-system: Only use system Python installations; never use managed Python installations
--python-fetchpython-fetchWhether to automatically download Python when required
Possible values:
automatic: Automatically fetch managed Python installations when neededmanual: Do not automatically fetch managed Python installations; require explicit installation
--colorcolor-choiceControl colors in output
[default: auto]
Possible values:
auto: Enables colored output only when the output is going to a terminal or TTY with supportalways: Enables colored output regardless of the detected environmentnever: Disables colored output
--config-fileconfig-fileThe path to a
uv.tomlfile to use for configuration.While uv configuration can be included in a
pyproject.tomlfile, it is not allowed in this context.
uv pip uninstall
Uninstall packages from an environment
Usage
uv pip uninstall [OPTIONS] <PACKAGE|--requirement <REQUIREMENT>>
Arguments
PACKAGEUninstall all listed packages
Options
--requirement,-rrequirementUninstall all packages listed in the given requirements files
--python,-ppythonThe Python interpreter from which packages should be uninstalled.
By default, uv uninstalls from the virtual environment in the current working directory or any parent directory. The
--pythonoption allows you to specify a different interpreter, which is intended for use in continuous integration (CI) environments or other automated workflows.Supported formats:
3.10looks for an installed Python 3.10 usingpy --list-pathson Windows, orpython3.10on Linux and macOS.python3.10orpython.exelooks for a binary with the given name inPATH./home/ferris/.local/bin/python3.10uses the exact Python at the given path.
--keyring-providerkeyring-providerAttempt to use
keyringfor authentication for remote requirements files.At present, only
--keyring-provider subprocessis supported, which configures uv to use thekeyringCLI to handle authentication.Defaults to
disabled.Possible values:
disabled: Do not use keyring for credential lookupsubprocess: Use thekeyringcommand for credential lookup
--targettargetUninstall packages from the specified
--targetdirectory--prefixprefixUninstall packages from the specified
--prefixdirectory--cache-dircache-dirPath to the cache directory.
Defaults to
$HOME/Library/Caches/uvon macOS,$XDG_CACHE_HOME/uvor$HOME/.cache/uvon Linux, and{FOLDERID_LocalAppData}\uv\cacheon Windows.--python-preferencepython-preferenceWhether to prefer uv-managed or system Python installations.
By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.
Possible values:
only-managed: Only use managed Python installations; never use system Python installationsmanaged: Prefer managed Python installations over system Python installationssystem: Prefer system Python installations over managed Python installationsonly-system: Only use system Python installations; never use managed Python installations
--python-fetchpython-fetchWhether to automatically download Python when required
Possible values:
automatic: Automatically fetch managed Python installations when neededmanual: Do not automatically fetch managed Python installations; require explicit installation
--colorcolor-choiceControl colors in output
[default: auto]
Possible values:
auto: Enables colored output only when the output is going to a terminal or TTY with supportalways: Enables colored output regardless of the detected environmentnever: Disables colored output
--config-fileconfig-fileThe path to a
uv.tomlfile to use for configuration.While uv configuration can be included in a
pyproject.tomlfile, it is not allowed in this context.
uv pip freeze
List, in requirements format, packages installed in an environment
Usage
uv pip freeze [OPTIONS]
Options
--python,-ppythonThe Python interpreter for which packages should be listed.
By default, uv lists packages in the currently activated virtual environment, or a virtual environment (
.venv) located in the current working directory or any parent directory, falling back to the system Python if no virtual environment is found.Supported formats:
3.10looks for an installed Python 3.10 usingpy --list-pathson Windows, orpython3.10on Linux and macOS.python3.10orpython.exelooks for a binary with the given name inPATH./home/ferris/.local/bin/python3.10uses the exact Python at the given path.
--cache-dircache-dirPath to the cache directory.
Defaults to
$HOME/Library/Caches/uvon macOS,$XDG_CACHE_HOME/uvor$HOME/.cache/uvon Linux, and{FOLDERID_LocalAppData}\uv\cacheon Windows.--python-preferencepython-preferenceWhether to prefer uv-managed or system Python installations.
By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.
Possible values:
only-managed: Only use managed Python installations; never use system Python installationsmanaged: Prefer managed Python installations over system Python installationssystem: Prefer system Python installations over managed Python installationsonly-system: Only use system Python installations; never use managed Python installations
--python-fetchpython-fetchWhether to automatically download Python when required
Possible values:
automatic: Automatically fetch managed Python installations when neededmanual: Do not automatically fetch managed Python installations; require explicit installation
--colorcolor-choiceControl colors in output
[default: auto]
Possible values:
auto: Enables colored output only when the output is going to a terminal or TTY with supportalways: Enables colored output regardless of the detected environmentnever: Disables colored output
--config-fileconfig-fileThe path to a
uv.tomlfile to use for configuration.While uv configuration can be included in a
pyproject.tomlfile, it is not allowed in this context.
uv pip list
List, in tabular format, packages installed in an environment
Usage
uv pip list [OPTIONS]
Options
--excludeexcludeExclude the specified package(s) from the output
--formatformatSelect the output format between:
columns(default),freeze, orjson[default: columns]
Possible values:
columns: Display the list of packages in a human-readable tablefreeze: Display the list of packages in apip freeze-like format, with one package per line alongside its versionjson: Display the list of packages in a machine-readable JSON format
--python,-ppythonThe Python interpreter for which packages should be listed.
By default, uv lists packages in the currently activated virtual environment, or a virtual environment (
.venv) located in the current working directory or any parent directory, falling back to the system Python if no virtual environment is found.Supported formats:
3.10looks for an installed Python 3.10 usingpy --list-pathson Windows, orpython3.10on Linux and macOS.python3.10orpython.exelooks for a binary with the given name inPATH./home/ferris/.local/bin/python3.10uses the exact Python at the given path.
--cache-dircache-dirPath to the cache directory.
Defaults to
$HOME/Library/Caches/uvon macOS,$XDG_CACHE_HOME/uvor$HOME/.cache/uvon Linux, and{FOLDERID_LocalAppData}\uv\cacheon Windows.--python-preferencepython-preferenceWhether to prefer uv-managed or system Python installations.
By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.
Possible values:
only-managed: Only use managed Python installations; never use system Python installationsmanaged: Prefer managed Python installations over system Python installationssystem: Prefer system Python installations over managed Python installationsonly-system: Only use system Python installations; never use managed Python installations
--python-fetchpython-fetchWhether to automatically download Python when required
Possible values:
automatic: Automatically fetch managed Python installations when neededmanual: Do not automatically fetch managed Python installations; require explicit installation
--colorcolor-choiceControl colors in output
[default: auto]
Possible values:
auto: Enables colored output only when the output is going to a terminal or TTY with supportalways: Enables colored output regardless of the detected environmentnever: Disables colored output
--config-fileconfig-fileThe path to a
uv.tomlfile to use for configuration.While uv configuration can be included in a
pyproject.tomlfile, it is not allowed in this context.
uv pip show
Show information about one or more installed packages
Usage
uv pip show [OPTIONS] [PACKAGE]...
Arguments
PACKAGEThe package(s) to display
Options
--python,-ppythonThe Python interpreter for which packages should be listed.
By default, uv lists packages in the currently activated virtual environment, or a virtual environment (
.venv) located in the current working directory or any parent directory, falling back to the system Python if no virtual environment is found.Supported formats:
3.10looks for an installed Python 3.10 usingpy --list-pathson Windows, orpython3.10on Linux and macOS.python3.10orpython.exelooks for a binary with the given name inPATH./home/ferris/.local/bin/python3.10uses the exact Python at the given path.
--cache-dircache-dirPath to the cache directory.
Defaults to
$HOME/Library/Caches/uvon macOS,$XDG_CACHE_HOME/uvor$HOME/.cache/uvon Linux, and{FOLDERID_LocalAppData}\uv\cacheon Windows.--python-preferencepython-preferenceWhether to prefer uv-managed or system Python installations.
By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.
Possible values:
only-managed: Only use managed Python installations; never use system Python installationsmanaged: Prefer managed Python installations over system Python installationssystem: Prefer system Python installations over managed Python installationsonly-system: Only use system Python installations; never use managed Python installations
--python-fetchpython-fetchWhether to automatically download Python when required
Possible values:
automatic: Automatically fetch managed Python installations when neededmanual: Do not automatically fetch managed Python installations; require explicit installation
--colorcolor-choiceControl colors in output
[default: auto]
Possible values:
auto: Enables colored output only when the output is going to a terminal or TTY with supportalways: Enables colored output regardless of the detected environmentnever: Disables colored output
--config-fileconfig-fileThe path to a
uv.tomlfile to use for configuration.While uv configuration can be included in a
pyproject.tomlfile, it is not allowed in this context.
uv pip tree
Display the dependency tree for an environment
Usage
uv pip tree [OPTIONS]
Options
--depth,-ddepthMaximum display depth of the dependency tree
[default: 255]
--pruneprunePrune the given package from the display of the dependency tree
--packagepackageDisplay only the specified packages
--python,-ppythonThe Python interpreter for which packages should be listed.
By default, uv lists packages in the currently activated virtual environment, or a virtual environment (
.venv) located in the current working directory or any parent directory, falling back to the system Python if no virtual environment is found.Supported formats:
3.10looks for an installed Python 3.10 usingpy --list-pathson Windows, orpython3.10on Linux and macOS.python3.10orpython.exelooks for a binary with the given name inPATH./home/ferris/.local/bin/python3.10uses the exact Python at the given path.
--cache-dircache-dirPath to the cache directory.
Defaults to
$HOME/Library/Caches/uvon macOS,$XDG_CACHE_HOME/uvor$HOME/.cache/uvon Linux, and{FOLDERID_LocalAppData}\uv\cacheon Windows.--python-preferencepython-preferenceWhether to prefer uv-managed or system Python installations.
By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.
Possible values:
only-managed: Only use managed Python installations; never use system Python installationsmanaged: Prefer managed Python installations over system Python installationssystem: Prefer system Python installations over managed Python installationsonly-system: Only use system Python installations; never use managed Python installations
--python-fetchpython-fetchWhether to automatically download Python when required
Possible values:
automatic: Automatically fetch managed Python installations when neededmanual: Do not automatically fetch managed Python installations; require explicit installation
--colorcolor-choiceControl colors in output
[default: auto]
Possible values:
auto: Enables colored output only when the output is going to a terminal or TTY with supportalways: Enables colored output regardless of the detected environmentnever: Disables colored output
--config-fileconfig-fileThe path to a
uv.tomlfile to use for configuration.While uv configuration can be included in a
pyproject.tomlfile, it is not allowed in this context.
uv pip check
Verify installed packages have compatible dependencies
Usage
uv pip check [OPTIONS]
Options
--python,-ppythonThe Python interpreter for which packages should be listed.
By default, uv lists packages in the currently activated virtual environment, or a virtual environment (
.venv) located in the current working directory or any parent directory, falling back to the system Python if no virtual environment is found.Supported formats:
3.10looks for an installed Python 3.10 usingpy --list-pathson Windows, orpython3.10on Linux and macOS.python3.10orpython.exelooks for a binary with the given name inPATH./home/ferris/.local/bin/python3.10uses the exact Python at the given path.
--cache-dircache-dirPath to the cache directory.
Defaults to
$HOME/Library/Caches/uvon macOS,$XDG_CACHE_HOME/uvor$HOME/.cache/uvon Linux, and{FOLDERID_LocalAppData}\uv\cacheon Windows.--python-preferencepython-preferenceWhether to prefer uv-managed or system Python installations.
By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.
Possible values:
only-managed: Only use managed Python installations; never use system Python installationsmanaged: Prefer managed Python installations over system Python installationssystem: Prefer system Python installations over managed Python installationsonly-system: Only use system Python installations; never use managed Python installations
--python-fetchpython-fetchWhether to automatically download Python when required
Possible values:
automatic: Automatically fetch managed Python installations when neededmanual: Do not automatically fetch managed Python installations; require explicit installation
--colorcolor-choiceControl colors in output
[default: auto]
Possible values:
auto: Enables colored output only when the output is going to a terminal or TTY with supportalways: Enables colored output regardless of the detected environmentnever: Disables colored output
--config-fileconfig-fileThe path to a
uv.tomlfile to use for configuration.While uv configuration can be included in a
pyproject.tomlfile, it is not allowed in this context.
uv venv
Create a virtual environment
Usage
uv venv [OPTIONS] [NAME]
Arguments
NAMEThe path to the virtual environment to create
Options
--python,-ppythonThe Python interpreter to use for the virtual environment.
Supported formats:
3.10looks for an installed Python 3.10 usingpy --list-pathson Windows, orpython3.10on Linux and macOS.python3.10orpython.exelooks for a binary with the given name inPATH./home/ferris/.local/bin/python3.10uses the exact Python at the given path.
Note that this is different from
--python-versioninpip compile, which takes3.10or3.10.13and doesn’t look for a Python interpreter on disk.--promptpromptProvide an alternative prompt prefix for the virtual environment.
The default behavior depends on whether the virtual environment path is provided:
- If provided (
uv venv project), the prompt is set to the virtual environment’s directory name. - If not provided (
uv venv), the prompt is set to the current directory’s name. 
Possible values:
.: Use the current directory name.- Any string: Use the given string.
 
- If provided (
 --index-url,-iindex-urlThe 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-urlflag.--extra-index-urlextra-index-urlExtra 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-urlflags are provided, earlier values take priority.--find-links,-ffind-linksLocations 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 (.tar.gzor.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.
--index-strategyindex-strategyThe 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-match). This prevents "dependency confusion" attacks, whereby an attack can upload a malicious package under the same name to a secondary.Possible values:
first-index: Only use results from the first index that returns a match for a given package nameunsafe-first-match: Search for every package name across all indexes, exhausting the versions from the first index before moving on to the nextunsafe-best-match: Search for every package name across all indexes, preferring the "best" version found. If a package version is in multiple indexes, only look at the entry for the first index
--keyring-providerkeyring-providerAttempt to use
keyringfor authentication for index URLs.At present, only
--keyring-provider subprocessis supported, which configures uv to use thekeyringCLI to handle authentication.Defaults to
disabled.Possible values:
disabled: Do not use keyring for credential lookupsubprocess: Use thekeyringcommand for credential lookup
--exclude-newerexclude-newerLimit candidate packages to those that were uploaded prior to the given date.
Accepts both RFC 3339 timestamps (e.g.,
2006-12-02T02:07:43Z) and UTC dates in the same format (e.g.,2006-12-02).--link-modelink-modeThe 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, andhardlinkon Linux and Windows.Possible values:
clone: Clone (i.e., copy-on-write) packages from the wheel into thesite-packagesdirectorycopy: Copy packages from the wheel into thesite-packagesdirectoryhardlink: Hard link packages from the wheel into thesite-packagesdirectorysymlink: Symbolically link packages from the wheel into thesite-packagesdirectory
--cache-dircache-dirPath to the cache directory.
Defaults to
$HOME/Library/Caches/uvon macOS,$XDG_CACHE_HOME/uvor$HOME/.cache/uvon Linux, and{FOLDERID_LocalAppData}\uv\cacheon Windows.--python-preferencepython-preferenceWhether to prefer uv-managed or system Python installations.
By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.
Possible values:
only-managed: Only use managed Python installations; never use system Python installationsmanaged: Prefer managed Python installations over system Python installationssystem: Prefer system Python installations over managed Python installationsonly-system: Only use system Python installations; never use managed Python installations
--python-fetchpython-fetchWhether to automatically download Python when required
Possible values:
automatic: Automatically fetch managed Python installations when neededmanual: Do not automatically fetch managed Python installations; require explicit installation
--colorcolor-choiceControl colors in output
[default: auto]
Possible values:
auto: Enables colored output only when the output is going to a terminal or TTY with supportalways: Enables colored output regardless of the detected environmentnever: Disables colored output
--config-fileconfig-fileThe path to a
uv.tomlfile to use for configuration.While uv configuration can be included in a
pyproject.tomlfile, it is not allowed in this context.
uv cache
Manage uv's cache
Usage
uv cache [OPTIONS] <COMMAND>
Commands
uv cache cleanClear the cache, removing all entries or those linked to specific packages
uv cache prunePrune all unreachable objects from the cache
uv cache dirShow the cache directory
uv cache clean
Clear the cache, removing all entries or those linked to specific packages
Usage
uv cache clean [OPTIONS] [PACKAGE]...
Arguments
PACKAGEThe packages to remove from the cache
Options
--cache-dircache-dirPath to the cache directory.
Defaults to
$HOME/Library/Caches/uvon macOS,$XDG_CACHE_HOME/uvor$HOME/.cache/uvon Linux, and{FOLDERID_LocalAppData}\uv\cacheon Windows.--python-preferencepython-preferenceWhether to prefer uv-managed or system Python installations.
By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.
Possible values:
only-managed: Only use managed Python installations; never use system Python installationsmanaged: Prefer managed Python installations over system Python installationssystem: Prefer system Python installations over managed Python installationsonly-system: Only use system Python installations; never use managed Python installations
--python-fetchpython-fetchWhether to automatically download Python when required
Possible values:
automatic: Automatically fetch managed Python installations when neededmanual: Do not automatically fetch managed Python installations; require explicit installation
--colorcolor-choiceControl colors in output
[default: auto]
Possible values:
auto: Enables colored output only when the output is going to a terminal or TTY with supportalways: Enables colored output regardless of the detected environmentnever: Disables colored output
--config-fileconfig-fileThe path to a
uv.tomlfile to use for configuration.While uv configuration can be included in a
pyproject.tomlfile, it is not allowed in this context.
uv cache prune
Prune all unreachable objects from the cache
Usage
uv cache prune [OPTIONS]
Options
--cache-dircache-dirPath to the cache directory.
Defaults to
$HOME/Library/Caches/uvon macOS,$XDG_CACHE_HOME/uvor$HOME/.cache/uvon Linux, and{FOLDERID_LocalAppData}\uv\cacheon Windows.--python-preferencepython-preferenceWhether to prefer uv-managed or system Python installations.
By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.
Possible values:
only-managed: Only use managed Python installations; never use system Python installationsmanaged: Prefer managed Python installations over system Python installationssystem: Prefer system Python installations over managed Python installationsonly-system: Only use system Python installations; never use managed Python installations
--python-fetchpython-fetchWhether to automatically download Python when required
Possible values:
automatic: Automatically fetch managed Python installations when neededmanual: Do not automatically fetch managed Python installations; require explicit installation
--colorcolor-choiceControl colors in output
[default: auto]
Possible values:
auto: Enables colored output only when the output is going to a terminal or TTY with supportalways: Enables colored output regardless of the detected environmentnever: Disables colored output
--config-fileconfig-fileThe path to a
uv.tomlfile to use for configuration.While uv configuration can be included in a
pyproject.tomlfile, it is not allowed in this context.
uv cache dir
Show the cache directory
Usage
uv cache dir [OPTIONS]
Options
--cache-dircache-dirPath to the cache directory.
Defaults to
$HOME/Library/Caches/uvon macOS,$XDG_CACHE_HOME/uvor$HOME/.cache/uvon Linux, and{FOLDERID_LocalAppData}\uv\cacheon Windows.--python-preferencepython-preferenceWhether to prefer uv-managed or system Python installations.
By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.
Possible values:
only-managed: Only use managed Python installations; never use system Python installationsmanaged: Prefer managed Python installations over system Python installationssystem: Prefer system Python installations over managed Python installationsonly-system: Only use system Python installations; never use managed Python installations
--python-fetchpython-fetchWhether to automatically download Python when required
Possible values:
automatic: Automatically fetch managed Python installations when neededmanual: Do not automatically fetch managed Python installations; require explicit installation
--colorcolor-choiceControl colors in output
[default: auto]
Possible values:
auto: Enables colored output only when the output is going to a terminal or TTY with supportalways: Enables colored output regardless of the detected environmentnever: Disables colored output
--config-fileconfig-fileThe path to a
uv.tomlfile to use for configuration.While uv configuration can be included in a
pyproject.tomlfile, it is not allowed in this context.
uv version
Display uv's version
Usage
uv version [OPTIONS]
Options
--output-formatoutput-format--cache-dircache-dirPath to the cache directory.
Defaults to
$HOME/Library/Caches/uvon macOS,$XDG_CACHE_HOME/uvor$HOME/.cache/uvon Linux, and{FOLDERID_LocalAppData}\uv\cacheon Windows.--python-preferencepython-preferenceWhether to prefer uv-managed or system Python installations.
By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.
Possible values:
only-managed: Only use managed Python installations; never use system Python installationsmanaged: Prefer managed Python installations over system Python installationssystem: Prefer system Python installations over managed Python installationsonly-system: Only use system Python installations; never use managed Python installations
--python-fetchpython-fetchWhether to automatically download Python when required
Possible values:
automatic: Automatically fetch managed Python installations when neededmanual: Do not automatically fetch managed Python installations; require explicit installation
--colorcolor-choiceControl colors in output
[default: auto]
Possible values:
auto: Enables colored output only when the output is going to a terminal or TTY with supportalways: Enables colored output regardless of the detected environmentnever: Disables colored output
--config-fileconfig-fileThe path to a
uv.tomlfile to use for configuration.While uv configuration can be included in a
pyproject.tomlfile, it is not allowed in this context.
uv help
Display documentation for a command
Usage
uv help [OPTIONS] [COMMAND]...
Arguments
COMMAND
Options
--cache-dircache-dirPath to the cache directory.
Defaults to
$HOME/Library/Caches/uvon macOS,$XDG_CACHE_HOME/uvor$HOME/.cache/uvon Linux, and{FOLDERID_LocalAppData}\uv\cacheon Windows.--python-preferencepython-preferenceWhether to prefer uv-managed or system Python installations.
By default, uv prefers using Python versions it manages. However, it will use system Python installations if a uv-managed Python is not installed. This option allows prioritizing or ignoring system Python installations.
Possible values:
only-managed: Only use managed Python installations; never use system Python installationsmanaged: Prefer managed Python installations over system Python installationssystem: Prefer system Python installations over managed Python installationsonly-system: Only use system Python installations; never use managed Python installations
--python-fetchpython-fetchWhether to automatically download Python when required
Possible values:
automatic: Automatically fetch managed Python installations when neededmanual: Do not automatically fetch managed Python installations; require explicit installation
--colorcolor-choiceControl colors in output
[default: auto]
Possible values:
auto: Enables colored output only when the output is going to a terminal or TTY with supportalways: Enables colored output regardless of the detected environmentnever: Disables colored output
--config-fileconfig-fileThe path to a
uv.tomlfile to use for configuration.While uv configuration can be included in a
pyproject.tomlfile, it is not allowed in this context.