CLI Reference
uv
An extremely fast Python package manager.
Usage
Commands
uv authManage authentication
uv runRun a command or script
uv initCreate a new project
uv addAdd dependencies to the project
uv removeRemove dependencies from the project
uv versionRead or update the project's version
uv syncUpdate the project's environment
uv lockUpdate the project's lockfile
uv exportExport the project's lockfile to an alternate format
uv treeDisplay the project's dependency tree
uv formatFormat Python code in the project
uv toolRun and install commands provided by Python packages
uv pythonManage Python versions and installations
uv pipManage Python packages with a pip-compatible interface
uv venvCreate a virtual environment
uv buildBuild Python packages into source distributions and wheels
uv publishUpload distributions to an index
uv cacheManage uv's cache
uv selfManage the uv executable
uv helpDisplay documentation for a command
uv auth
Manage authentication
Usage
Commands
uv auth loginLogin to a service
uv auth logoutLogout of a service
uv auth tokenShow the authentication token for a service
uv auth dirShow the path to the uv credentials directory
uv auth login
Login to a service
Usage
Arguments
- SERVICE
The domain or URL of the service to log into
Options
--allow-insecure-host,--trusted-hostallow-insecure-hostAllow insecure connections to a host.
Can be provided multiple times.
Expects to receive either a hostname (e.g.,
localhost), a host-port pair (e.g.,localhost:8080), or a URL (e.g.,https://localhost).WARNING: Hosts included in this list will not be verified against the system's certificate store. Only use
--allow-insecure-hostin a secure network with verified sources, as it bypasses SSL verification and could expose you to MITM attacks.May also be set with the
UV_INSECURE_HOSTenvironment variable.--cache-dircache-dirPath to the cache directory.
Defaults to
$XDG_CACHE_HOME/uvor$HOME/.cache/uvon macOS and Linux, and%LOCALAPPDATA%\uv\cacheon Windows.To view the location of the cache directory, run
uv cache dir.May also be set with the
UV_CACHE_DIRenvironment variable.--colorcolor-choiceControl the use of color in output.
By default, uv will automatically detect support for colors when writing to a terminal.
Possible values:
auto: Enables colored output only when the output is going to a terminal or TTY with 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.May also be set with the
UV_CONFIG_FILEenvironment variable.--directorydirectoryChange to the given directory prior to running the command.
Relative paths are resolved with the given directory as the base.
See
--projectto only change the project root directory.May also be set with the
UV_WORKING_DIRenvironment variable.--help,-hDisplay the concise help for this command
--keyring-providerkeyring-providerThe keyring provider to use for storage of credentials.
Only
--keyring-provider nativeis supported forlogin, which uses the system keyring via an integration built into uv.May also be set with the
UV_KEYRING_PROVIDERenvironment variable.Possible values:
disabled: Do not use keyring for credential lookupsubprocess: Use thekeyringcommand for credential lookup