auto-uv-env ๐Ÿ

License: MIT UV

Automatic UV-based Python virtual environment management for your shell.

auto-uv-env watches directory changes, discovers the nearest pyproject.toml, creates a project-local virtual environment with uv, and activates/deactivates it automatically.

Why auto-uv-env?

Quick Start

1. Install auto-uv-env

Quick install (any system):

curl -LsSf https://auto-uv-env.ashwch.com/install.sh | sh

macOS with Homebrew (recommended for Mac):

brew tap ashwch/tap
brew install auto-uv-env

2. Add to your shell

Zsh (~/.zshrc):

source $(brew --prefix)/share/auto-uv-env/auto-uv-env.zsh

Bash (~/.bashrc):

source $(brew --prefix)/share/auto-uv-env/auto-uv-env.bash

Fish (~/.config/fish/config.fish):

source (brew --prefix)/share/auto-uv-env/auto-uv-env.fish

3. Start using it!

cd my-python-project/src/app
# ๐Ÿ Setting up Python 3.11 with UV...
# โœ… Virtual environment created
# ๐Ÿš€ UV environment activated (Python 3.11.x)

How It Works

  1. Walk upward from $PWD to find the nearest pyproject.toml.
  2. If .auto-uv-env-ignore appears first, activation is skipped for that subtree.
  3. Read requires-python from the discovered project root.
  4. Create <project-root>/.venv when missing.
  5. Activate on entry and deactivate only environments managed by auto-uv-env.
  6. If a manual venv is active, auto-uv-env does not override it.

Features

โšก Performance and Reliability

๐ŸŽฏ Intelligent Activation

๐Ÿ›ก๏ธ Security First

Documentation

Requirements