CLI helper for keeping Python venvs outside synced project folders
Project description
uvlink
uvlink is a CLI tool that moves .venv folders into a local cache and creates a symlink in your project, so cloud services like Dropbox or iCloud only sync your actual code—not hundreds of megabytes of dependencies.
[!CAUTION] Since
v0.6.0, the cache directory includes the venv type in its folder name and stores the environment under a matching subdirectory (e.g.~/.local/share/uvlink/cache/<project-name>-<hash>-.venv/.venv). Delete caches created with older versions and rerunuvlink linkto migrate.
Requirements
- Python 3.12+
- macOS or Linux with symlink support
[!WARNING] uvlink is currently only tested on Apple Silicon (M-series) machines running macOS Tahoe. Other operating systems or architectures have not been validated yet.
Install
Using uv tool (recommended)
$ uv tool install uvlink
This installs the CLI into your ~/.local/bin (or platform equivalent) with isolated dependencies handled by Astral's uv.
Using pip
$ pip install uvlink
Quick Start
Navigate to any Python project (which may be created by uv init for instance) and run:
$ cd /path/to/your/project
$ uvlink link
This creates a .venv symlink in your project pointing to a cached environment under ~/.local/share/uvlink/cache/<project-name>-<hash>-.venv/.venv. Now your cloud service ignores the heavy virtual environment files.
After linking, you can do for example uv sync to install dependencies into .venv, which is now a symlink to the cached environment.
List all linked projects:
$ uvlink ls
Shows all projects having cached environments and whether their symlinks are still linked.
Clean up unlinked caches:
$ uvlink gc
Removes cached environments for projects that no longer have working symlinks, freeing up disk space.
Demo
Advanced Usage
uvlink ships with a Typer CLI. Run uvlink --help for all options.
Specify a project directory:
$ uvlink --project-dir /path/to/project link
Works from any location without needing to cd into the project directory first.
Notes
uvlink stores environments under ~/.local/share/uvlink/cache/<project-name>-<hash>-<venv_type>/<venv_type> and makes a symlink ./.venv back into that. Each project receives a stable hash based on its absolute path, so repeated runs target the same cache location.
Contributing
Issues and pull requests are welcome. Please keep docstrings and comments in the Google style already used throughout the codebase and run the included linters/formatters before submitting. A pre-commit configuration is provided that runs Ruff and Black; install it with pre-commit install to match formatting.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file uvlink-0.6.0.tar.gz.
File metadata
- Download URL: uvlink-0.6.0.tar.gz
- Upload date:
- Size: 5.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.10 {"installer":{"name":"uv","version":"0.9.10"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bfb9b478e2f1a924253c176b06911a59844aa1caaaaf3b5c3590bd05865bfffb
|
|
| MD5 |
48908ce1bb7a1e001e125feead321871
|
|
| BLAKE2b-256 |
0b070906a1bd11b5ff7b9df182c08086eb0cfdbcb138dc1fb8b28dca26a18b83
|
File details
Details for the file uvlink-0.6.0-py3-none-any.whl.
File metadata
- Download URL: uvlink-0.6.0-py3-none-any.whl
- Upload date:
- Size: 7.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.10 {"installer":{"name":"uv","version":"0.9.10"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d70a14a6f21d6fbc514222c8d696369b82add9f9b5f1a22bbb0121133b9d00b2
|
|
| MD5 |
0b16ecbe315ddc018b0f3966e65f8419
|
|
| BLAKE2b-256 |
82e2a3db28633590cd81655a99e80c0d9f9a068a50f027d0f65c77074a7f61a6
|