← 返回命令列表

Linux command

uv-cache 命令

文件

复制后可按需替换文件名、目录或参数。

常用示例

Show the cache directory

uv cache dir

Remove all cached data

uv cache clean

Remove cached data

uv cache clean [requests]

Remove unused cache entries

uv cache prune

Remove all unzipped cache data

uv cache prune --ci

说明

uv cache manages uv's package cache, which stores downloaded distributions, built wheels, and source archives. The cache significantly speeds up subsequent installations by avoiding redundant downloads and builds. The default cache location is $XDG_CACHE_HOME/uv or ~/.cache/uv on Linux, ~/Library/Caches/uv on macOS, and %LOCALAPPDATA%\uv\cache on Windows. This can be overridden with the UV_CACHE_DIR environment variable or the --cache-dir global option.

参数

dir
Display the path to the cache directory.
clean _package_
Remove all cached data, or data for a specific package if specified.
prune
Remove unused cache entries that are no longer needed by any project.
--ci
Used with prune to remove all unzipped source distributions and pre-built archives, optimizing for CI environments where only the compressed archives are needed.

FAQ

What is the uv-cache command used for?

uv cache manages uv's package cache, which stores downloaded distributions, built wheels, and source archives. The cache significantly speeds up subsequent installations by avoiding redundant downloads and builds. The default cache location is $XDG_CACHE_HOME/uv or ~/.cache/uv on Linux, ~/Library/Caches/uv on macOS, and %LOCALAPPDATA%\uv\cache on Windows. This can be overridden with the UV_CACHE_DIR environment variable or the --cache-dir global option.

How do I run a basic uv-cache example?

Run `uv cache dir` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does dir do in uv-cache?

Display the path to the cache directory.