Overview
uv is an extremely fast Python package and project manager with a comprehensive command-line interface. The CLI is organized into logical command categories for managing projects, Python installations, tools, packages, and more.Command Categories
uv organizes commands into several categories based on their purpose:Project Commands
Manage Python projects with dependencies and virtual environments
Python Management
Install and manage Python versions
Tool Commands
Run and install command-line tools from Python packages
Pip Interface
Drop-in pip-compatible commands for package management
Build & Publish
Build distributions and publish packages to indexes
Environment
Create and manage virtual environments
Cache & Maintenance
Manage cache and update uv itself
Authentication
Configure authentication for package indexes
Project Commands
Manage complete Python projects with lockfiles, dependencies, and environments:uv init- Create a new projectuv add- Add dependencies to a projectuv remove- Remove dependencies from a projectuv sync- Sync project environment with lockfileuv lock- Update the project lockfileuv run- Run a command in the project environmentuv tree- Display project dependency treeuv export- Export lockfile to alternate formatsuv version- Read or update project versionuv build- Build source distributions and wheelsuv format- Format Python code using Ruff
Python Management
Install and manage Python interpreters:uv python install- Install Python versionsuv python list- List available and installed Python versionsuv python find- Find a Python interpreteruv python pin- Pin a Python version for a projectuv python uninstall- Uninstall Python versions
Tool Commands
Run and install isolated command-line tools:uv tool run(oruvx) - Run a tool in an ephemeral environmentuv tool install- Install a tool globallyuv tool list- List installed toolsuv tool uninstall- Uninstall a tooluv tool update-shell- Update shell completions
Pip Interface
Drop-in replacement for pip and pip-tools commands:uv pip install- Install packagesuv pip compile- Compile requirements filesuv pip sync- Sync environment with requirementsuv pip uninstall- Uninstall packagesuv pip freeze- List installed packages (requirements format)uv pip list- List installed packages (table format)uv pip show- Show package informationuv pip tree- Display dependency treeuv pip check- Verify package dependencies
Build & Publish
Build and distribute Python packages:uv build- Build source distributions and wheelsuv publish- Upload distributions to an index
Environment
Manage virtual environments:uv venv- Create a virtual environment
Cache & Maintenance
Manage uv’s cache and update the tool itself:uv cache clean- Remove cache entries for specific packagesuv cache prune- Remove all unreachable cache objectsuv cache dir- Show the cache directory pathuv cache size- Show total cache sizeuv self update- Update uv to the latest version
Authentication
Manage authentication for package indexes:uv auth- Configure credentials for authenticated indexes
Global Options
Global options can be used with any uv command and must appear before the command name.Python Options
Control Python interpreter discovery and installation:The Python interpreter to use for the operation.Supports version numbers (
3.12), version specifiers (>=3.8), implementation names (cpython), executable names (python3), or paths (/usr/bin/python3).See uv help python for complete details on Python discovery.Environment variable: UV_PYTHONRequire use of uv-managed Python versions.By default, uv prefers managed Python but will fall back to system Python. This option disables system Python fallback.Environment variable:
UV_MANAGED_PYTHONDisable use of uv-managed Python versions and search only system Python.Environment variable:
UV_NO_MANAGED_PYTHONDisable automatic Python downloads when required versions are not found.Environment variable:
UV_PYTHON_DOWNLOADS=neverOutput Control
Adjust verbosity and formatting:Use quiet output. Suppress non-error messages.Repeat (
-qq) for silent mode with no stdout output.Use verbose output. Show additional details.For fine-grained logging control, use the
RUST_LOG environment variable.Control color output.
auto- Detect terminal support (default)always- Force color outputnever- Disable color output
autoHide progress indicators like spinners and progress bars.Environment variable:
UV_NO_PROGRESSNetwork Options
Configure network behavior and security:Disable network access.When enabled, uv will only use locally cached data and locally available files.Environment variable:
UV_OFFLINEUse the platform’s native TLS certificate store instead of bundled webpki-roots.Useful for corporate environments with custom root certificates.Environment variable:
UV_NATIVE_TLSAllow insecure connections to the specified host.Accepts hostname, host:port, or URL. Can be provided multiple times.Environment variable:
UV_INSECURE_HOSTCache Options
Control cache behavior and location:Avoid using the cache. Uses a temporary directory instead.Environment variable:
UV_NO_CACHEPath to the cache directory.Default locations:
- macOS/Linux:
$XDG_CACHE_HOME/uvor$HOME/.cache/uv - Windows:
%LOCALAPPDATA%\uv\cache
uv cache dir to view the current cache location.Environment variable: UV_CACHE_DIRConfiguration
Control configuration file discovery and location:Path to a
uv.toml configuration file.Configuration in pyproject.toml is not allowed when this option is used.Environment variable: UV_CONFIG_FILEAvoid discovering configuration files (
pyproject.toml, uv.toml).Configuration files are normally discovered in the current directory, parent directories, or user configuration directories.Environment variable: UV_NO_CONFIGDirectory Options
Control working directory and project discovery:Change to the specified directory before running the command.All relative paths are resolved from this directory.Environment variable:
UV_WORKING_DIRDiscover the project in the specified directory.Project files (
pyproject.toml, uv.toml, .python-version) and the virtual environment (.venv) are discovered from the project root. Other arguments remain relative to the current working directory.This setting has no effect when using the uv pip interface.Environment variable: UV_PROJECTOther Options
Display help information for the command.
Display the uv version.
Usage Patterns
Combining Global Options
Global options must appear before the command name:Using Environment Variables
Most options have corresponding environment variables:Configuration Priority
Settings are applied in the following priority order (highest to lowest):- Command-line arguments
- Environment variables
- Project-level configuration (
pyproject.tomloruv.toml) - User-level configuration (
~/.config/uv/uv.toml) - Default values
Getting Help
Display help for any command or subcommand:Help System
uv provides comprehensive help documentation through the CLI:Built-in Help
Access help directly from the command line:Python Discovery Help
Get detailed information about Python interpreter discovery:- Python version request formats
- Discovery rules and priority
- Supported implementations (CPython, PyPy, GraalPy)
- System-specific behavior (PATH, registry on Windows)
Command Aliases
Some commands have convenient aliases:uvx- Alias foruv tool runuv venv- Also acceptsvirtualenvandvuv pip list- Also acceptsls
Shell Completion
Generate shell completion scripts:uv tool update-shell to automatically configure completions for installed tools.
Exit Codes
uv uses standard exit codes:0- Success1- General error (invalid arguments, command failed, etc.)2- Package not found or resolution failed
Next Steps
Project Commands
Learn about project management commands
Python Management
Explore Python installation and management
Tool Commands
Discover tool isolation and execution
Pip Interface
Use familiar pip-compatible commands