Loading...
Loading...
Uses the uv Python package and project manager correctly for dependencies, venvs, and scripts. Use when creating or modifying Python projects, adding dependencies, running scripts with inline deps, managing virtual environments, pinning Python versions, running CLI tools from PyPI, setting the IDE Python interpreter, or using uv in CI (e.g. GitHub Actions) or Docker containers. Use when the user mentions uv, pyproject.toml, uv.lock, uv run, uv add, uv sync, .venv, Python interpreter, poetry, pipenv, conda, CI, Docker, GitHub Actions, or asks to use uv instead of pip or poetry.
npx skill4agent add untitled-data-company/data-skills uvUser needs to...
│
├─ Repo uses poetry / pipenv / conda (poetry.lock, Pipfile, environment.yml)
│ → Ask: "This repo uses [poetry/pipenv/conda]. Do you want to switch to uv?"
│ → If yes: prefer the migrate-to-uv tool (uvx migrate-to-uv in project root) to convert metadata and lockfile; then uv sync. Remove legacy files only after user confirms.
│ → If no: do not use uv for project management; use the existing tool or uv pip only if appropriate.
│
├─ Repo has requirements.txt (no pyproject.toml)
│ → Ask: "This repo uses requirements.txt. Do you want to convert to uv (pyproject.toml + uv.lock)?"
│ → If yes: guide conversion (uv init, uv add from requirements, then uv sync)
│ → If no: use Pip-Compatible workflow (uv pip)
│
├─ Manage a project (pyproject.toml, lockfile, team repo)
│ → Use PROJECT workflow (uv init, uv add, uv sync, uv run)
│
├─ Run a single script with dependencies
│ → Use SCRIPT workflow (uv add --script, uv run <script>)
│
├─ Run a one-off CLI tool (no project)
│ → Use uvx: uvx <package> [args] or uv tool install <package>
│
└─ User declined conversion; existing pip/requirements workflow
→ Use uv pip (uv venv, uv pip sync, uv pip compile)pyproject.tomluv init [project-name]
cd [project-name]
uv add <package> [package2...]
uv sync
uv run python main.py
# or: uv run <any command>uv sync # install from lockfile (or resolve and lock)
uv add <package> # add dependency, update lockfile and env
uv remove <package> # remove dependency
uv run <command> # run in project venv (creates .venv if needed)
uv lock # refresh lockfile onlyuv python pin 3.11 # writes .python-version
uv python install 3.11 # ensure that version is availableuv addpyproject.tomluv syncuv adduv removeuv runpip install.venv.gitignoreuv.lockuv add --script# /// script
# requires-python = ">=3.10"
# dependencies = ["requests"]
# ///
import requests
print(requests.get("https://example.com"))uv add --script example.py requestsuv run example.pyuv run#!/usr/bin/env -S uv run --script
# /// script
# requires-python = ">=3.10"
# dependencies = ["requests"]
# ///uv add --script <file>uv run <script>.pypip install#!/usr/bin/env -S uv run --scriptuvx <package> [args]
# e.g. uvx ruff check .
# e.g. uvx pycowsay "hello"uv tool install <package>
# e.g. uv tool install ruffuvxuv tool installpyproject.tomluv inituv add -r requirements.txtuv add -r requirements.in -c requirements.txtuv syncrequirements.txtpipuv venv # create .venv
uv pip sync requirements.txt # install from locked requirements
uv pip compile requirements.in -o requirements.txt # compile/lockuv pippipastral-sh/setup-uvuv.lockpyproject.tomluv sync --lockeduv cache prune --cighcr.io/astral-sh/uvuv.lockpyproject.tomluv sync.venvUV_COMPILE_BYTECODE=1UV_LINK_MODE=copy--no-editable.venv.vscode/settings.jsonpython.defaultInterpreterPath.venv"${workspaceFolder}/.venv/bin/python""${workspaceFolder}/.venv/Scripts/python.exe".vscode/settings.jsonpython.defaultInterpreterPath.vscode/uv inituv sync.venv.vscode/settings.json.venvuv inituv init <name>uv adduv syncuv runuv add <package>uv add --dev <package>uv run <command>uv run script.pyuvx <tool>uv runsource .venv/bin/activateuv.lockuv syncuv sync --lockedpyproject.tomlpyproject.toml.venvpython.defaultInterpreterPath.vscode/settings.json| Task | Command |
|---|---|
| New project | |
| Add dependency | |
| Add dev dependency | |
| Remove dependency | |
| Install from lock | |
| Update lockfile | |
| Run in project | |
| Run script | |
| Run CLI tool once | |
| Install tool | |
| Create venv | |
| Pin Python | |
| Install Python | |