Agent skill
uv
Initializes Python projects, manages dependencies, pins Python versions, and runs scripts with uv. Use when adding/removing packages, syncing environments, running tools with uvx, or building distributions.
Install this agent skill to your Project
npx add-skill https://github.com/knoopx/pi/tree/main/agent/skills/uv
SKILL.md
uv
Fast Python package and project manager with built-in virtual environment management.
Project Setup
uv init my-app # App project
uv init my-lib --lib # Library project
uv init --script script.py # Standalone script
uv python pin 3.11 # Pin Python version
Dependencies
uv add requests # Add dependency
uv add --dev pytest # Add dev dependency
uv add --optional ml scikit-learn # Add optional
uv remove requests # Remove dependency
uv tree # Show dependency tree
uv lock # Update lockfile only
uv export > requirements.txt # Export to requirements.txt
Virtual Environment
uv sync # Sync dependencies
uv sync --no-dev # Skip dev deps
uv sync --all-extras # Include all optional
uv sync --refresh # Recreate venv
Running Code
uv run python script.py # Run script
uv run -m pytest # Run module
uv run --with requests script.py # Temp dependency
uv run --extra ml train.py # Use optional deps
uv run --env-file .env script.py # Load .env
Python Management
uv python list # List versions
uv python install 3.12 # Install version
uv python pin 3.11 # Set project version
uv python upgrade --all # Upgrade all
Tools
uvx ruff check . # Run tool once
uv tool install ruff # Install globally
uv tool list # List tools
uv tool upgrade ruff # Upgrade tool
Building & Publishing
uv build # Build distributions
uv publish # Publish to PyPI
Project Versioning
uv version # Show current version
uv version 1.2.3 # Set version
uv version --bump major # Bump major version
uv version --bump minor # Bump minor version
uv version --bump patch # Bump patch version
Code Formatting
uv format # Format Python code
uv format --check # Check formatting without changes
Authentication
uv auth login # Login to package index
uv auth logout # Logout from package index
uv auth status # Show authentication status
pyproject.toml
[project]
name = "my-project"
version = "0.1.0"
requires-python = ">=3.9"
dependencies = ["requests>=2.31.0"]
[project.optional-dependencies]
ml = ["scikit-learn>=1.0.0"]
[dependency-groups]
dev = ["pytest>=7.0.0", "ruff>=0.1.0"]
Tips
uv runhandles venv automatically- Commit
uv.lockfor reproducibility - Use
--withfor one-off dependencies uvxfor running tools without installuv sync --lockedin CI- Tools are isolated from project deps
- Fast: 10-100x faster than pip
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
conventional-commits
Writes and reviews Conventional Commits commit messages (v1.0.0) to support semantic versioning and automated changelogs. Use when drafting git commit messages, PR titles, release notes, or when enforcing a conventional commit format (type(scope): subject, BREAKING CHANGE, footers, revert).
nix-flakes
Creates reproducible builds, manages flake inputs, defines devShells, and builds packages with flake.nix. Use when initializing Nix projects, locking dependencies, or running nix build/develop commands.
skill-authoring
Writes effective pi skills with proper structure, concise content, and progressive disclosure. Use when creating new skills, improving existing skills, or reviewing skill quality.
gtkx
Build GTK4 desktop applications with GTKX React framework. Use when creating React components that render as native GTK widgets, working with GTK4/Libadwaita UI, handling signals, virtual lists, menus, or building Linux desktop UIs.
nu-shell
Processes structured data through pipelines, filters tables, transforms JSON/CSV/YAML, and defines custom commands. Use when scripting with typed parameters or working with tabular data.
nix
Runs packages temporarily, creates isolated shell environments, and evaluates Nix expressions. Use when executing tools without installing, debugging derivations, or working with nixpkgs.
Didn't find tool you were looking for?