Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

uv

БесплатноБез исполняемых скриптовНе проверен

Installs Python packages, creates virtual environments, locks dependencies and manages Python versions with one fast command-line tool that replaces pip…

TerminalSkillsот TerminalSkills★ 221 звезда на GitHub

Об этом скилле

uv — Fast Python package and project manager

Overview

uv is a single binary from Astral that covers the whole Python workflow: projects with a cross-platform lockfile (uv.lock), single-file scripts with inline dependencies, command-line tools (uvx), Python interpreter installs, and a drop-in uv pip interface. It downloads Python itself when needed, so a machine needs nothing but uv.

Instructions

Installation

# Package managers
pipx install uv
brew install uv
winget install --id=astral-sh.uv -e

Astral also publishes a standalone installer for machines without a package manager; the installation page at https://docs.astral.sh/uv/getting-started/installation/ has the current command and checksums.

uv --version
uv self update     # standalone installer only; otherwise upgrade with the package manager

To pin a release, put the version in the installer URL: https://astral.sh/uv/0.13.7/install.sh.

Create a project

uv init dispatch-api               # packaged app: src/dispatch_api/, uv_build backend, console script
uv init --no-package cron-jobs     # flat layout with main.py and no build system
uv init --lib geo-utils            # library with a py.typed marker
uv init --bare --python 3.12       # only pyproject.toml, in the current directory

uv init also writes .python-version, README.md, .gitignore and initialises git. --bare writes nothing but pyproject.toml, which makes it the right choice inside an existing repository.

Manage dependencies

uv add 'httpx>=0.27' 'pydantic>=2.7,<3'     # runtime dependencies
uv add --dev pytest ruff                    # dev group, not shipped to production
uv add --group docs mkdocs                  # any named dependency group
uv add --optional postgres 'psycopg[binary]'   # extra: pip install dispatch-api[postgres]
uv add -r requirements.txt                  # import an existing requirements file
uv remove httpx

uv lock --upgrade-package pydantic          # bump one package within its constraints
uv lock --upgrade                           # bump everything
uv tree --outdated --depth 1                # what has a newer release

The first uv add creates .venv/ and uv.lock. Every change updates pyproject.toml, the lockfile and the environment together.

Run and sync

uv run pytest                        # locks and syncs if needed, then runs inside .venv
uv run python -m dispatch_api
uv run --with rich python -c "import rich"   # one extra package for this command only

uv sync                              # install everything, dev group included
uv sync --locked                     # CI: fail if uv.lock does not match pyproject.toml
uv sync --frozen --no-dev            # production: use uv.lock as-is, skip the dev group
uv sync --extra postgres
uv lock --check                      # exit non-zero when the lockfile is stale

No activation is needed; uv run finds the project environment by itself.

Scripts with inline dependencies

uv init --script fetch-rates.py --python 3.12
uv add --script fetch-rates.py 'httpx<1' rich
uv run fetch-rates.py
uv lock --script fetch-rates.py      # writes fetch-rates.py.lock for reproducible runs

uv add --script maintains a metadata block at the top of the file:

# /// script
# requires-python = ">=3.12"
# dependencies = [
#     "httpx<1",
#     "rich>=15.0.0",
# ]
# ///

Add #!/usr/bin/env -S uv run --script as the first line and chmod +x the file to run it directly.

Tools

uvx ruff check .                         # run without installing; uvx = uv tool run
uvx [email protected] check .                  # exact version
uvx --from 'markitdown[pdf]' markitdown q3-board-report.pdf   # command name differs from the spec
uv tool install ruff                     # permanent, isolated install on PATH
uv tool upgrade --all
uv tool list
uv tool uninstall ruff

Installed tools land in the directory printed by uv tool dir --bin; uv warns when that directory is not on PATH.

Python versions

uv python install 3.12 3.13
uv python list --only-installed
uv python pin 3.12              # writes .python-version
uv run --python 3.13 pytest     # one-off run on another interpreter
uv python upgrade 3.12          # latest patch release of 3.12
uv venv --python 3.12           # plain virtual environment at .venv

Requests accept 3.12, 3.12.3, >=3.11,<3.13, [email protected] and 3.13t (free-threaded). uv downloads a missing interpreter automatically; pass --no-python-downloads to forbid that.

pip-compatible interface

uv venv
uv pip install -r requirements.txt
uv pip compile requirements.in -o requirements.txt --universal
uv pip sync requirements.txt        # removes anything not listed
uv pip install --python .venv/bin/python 'rich>=13'

CI and Docker

name: ci
on: [push, pull_request]
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
Полный SKILL.md на GitHub

Установить uv в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

_scores.json

FAQ

Что делает скилл uv?

Installs Python packages, creates virtual environments, locks dependencies and manages Python versions with one fast command-line tool that replaces pip, pip-tools, pipx, poetry, pyenv and virtualenv. Use when a user asks to set up a Python project, add or upgrade a dependency, create a lockfile, migrate from requirements.txt, run a script with inline dependencies, install a Python version, run a tool with uvx, or speed up installs in CI and Docker.

Как установить скилл uv?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл uv запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить uv с