Install
openclaw skills install uv-priorityPrioritize uv over pip for all Python package management and execution. When running ANY Python command or CLI tool (python, dbt, pytest, etc.), MUST wrap wi...
openclaw skills install uv-priorityThis is a mandatory skill for all Python-related tasks. When the user mentions Python, dbt, or ANY Python package, you MUST:
uv run or uvxpip installuv add or uv pip install| Command | When to Use | Example |
|---|---|---|
uv run <tool> | Ferramenta do projeto - precisa importar seus módulos, usada regularmente | uv run pytest tests/ |
uvx <tool> | Utilitário externo - usa Python como runtime, mas não é parte do seu app | uvx ruff check . |
Preciso rodar uma ferramenta Python?
├─ A ferramenta precisa importar meus módulos do projeto?
│ └─ SIM → uv run <comando>
└─ A ferramenta só analisa/transforma código externo?
└─ SIM → uvx <comando>
uvx for External Toolsuvx creates a temporary, isolated environment. Use it for tools that:
uvx ruff check . # Linter - analisa sintaxe, não importa seus módulos
uvx black . # Formatter - manipula texto, não importa seus módulos
uvx mypy . # Type checker - analisa tipos, não precisa rodar seu código
uvx isort . # Organizador de imports - só lê arquivos
uvx ruff@latest check . # Use specific version
uv run for Project Toolsuv run uses your project's existing virtual environment. Use it for tools that:
uv run pytest tests/ # Test runner - precisa importar seus módulos
uv run python main.py # Sua aplicação
uv run python -m myapp.cli # CLI do seu app
uv run dbt run # dbt com suas transformações do projeto
If the project already uses
uv runfor a specific tool, continue using it.
uv run ruff check . in the project, don't change to uvxuv run pytest, maintain the patternWhy? Changing from uv run to uvx (or vice-versa) mid-project can:
| NEVER run this | ALWAYS run this instead |
|---|---|
python script.py | uv run python script.py |
python -c "import..." | uv run python -c "import..." |
python -m module | uv run python -m module |
python3 script.py | uv run python3 script.py |
dbt --version | uv run dbt --version |
dbt run | uv run dbt run |
dbt debug | uv run dbt debug |
dbt deps | uv run dbt deps |
pytest | uv run pytest (imports project modules) or uvx pytest (one-off) |
pytest tests/ | uv run pytest tests/ (imports project modules) or uvx pytest tests/ (one-off) |
black . | uvx black . (preferred - external tool) or uv run black . (if already in project) |
ruff check . | uvx ruff check . (preferred - external tool) or uv run ruff check . (if already in project) |
mypy . | uvx mypy . (preferred - external tool) or uv run mypy . (if already in project) |
pip install <package> | uv add <package> |
pip install -r requirements.txt | uv pip install -r requirements.txt |
pip list | uv pip list |
pip freeze | uv pip freeze |
Use when:
NEVER use these pip commands. ALWAYS use the uv equivalent:
| NEVER use pip | ALWAYS use uv |
|---|---|
pip install <package> | uv add <package> |
pip install -r requirements.txt | uv pip install -r requirements.txt |
pip list | uv pip list |
pip freeze | uv pip freeze |
These are commonly installed Python packages that have CLI commands. When installing or running them, always use uv:
| Tool | Install with uv | Run with uv (project) | Run with uvx (external) |
|---|---|---|---|
| dbt (dbt-core) | uv add dbt-snowflake (or dbt-postgres) | uv run dbt <command> | - |
| pytest | uv add pytest | uv run pytest (imports project modules) | uvx pytest (one-off) |
| black (formatter) | uv add black | uv run black (if in project) | uvx black . (preferred) |
| ruff (linter) | uv add ruff | uv run ruff (if in project) | uvx ruff check . (preferred) |
| mypy (type checker) | uv add mypy | uv run mypy (if in project) | uvx mypy . (preferred) |
| flake8 (linter) | uv add flake8 | uv run flake8 | uvx flake8 |
| pylint (linter) | uv add pylint | uv run pylint | uvx pylint |
| isort (import sorter) | uv add isort | uv run isort | uvx isort . |
| poetry (dependency manager) | uv add poetry | uv run poetry | uvx poetry |
| pipenv (dependency manager) | uv add pipenv | uv run pipenv | uvx pipenv |
| cookiecutter (project templates) | uv add cookiecutter | uv run cookiecutter | uvx cookiecutter |
| httpie (HTTP client) | uv add httpie | uv run http | uvx http |
| mycli (MySQL CLI) | uv add mycli | uv run mycli | uvx mycli |
| pgcli (PostgreSQL CLI) | uv add pgcli | uv run pgcli | uvx pgcli |
Note: For linters, formatters, and type checkers, uvx is preferred (doesn't pollute project dependencies). For tools that need to import your project modules (like pytest with your app code), use uv run.
For ANY Python package with a CLI command:
# Option 1: Run as external tool (preferred for linters, formatters, one-off tools)
uvx <cli-command>
# Option 2: Install and run within project environment
uv add <package>
uv run <cli-command>
# Option 3: Run with specific version
uvx <package>@version <cli-command>
| NEVER use pip | ALWAYS use uv |
|---|---|
python -m venv .venv | uv venv |
python script.py | uv run script.py |
python -m module | uv run python -m module |
python -m pip install | uv add |
python -m pip list | uv pip list |
uv (with uv run or uvx) is the ONLY option for Python package management and execution.
Execution priority:
uv run <command> - for tools that need project dependenciesuvx <command> - for external tools that don't need project modulesOnly consider pip as a fallback if:
pipuv is not available on the system