Python for JS Devs · Reference
uv Cheat Sheet
The one-glance reference for day-to-day uv. Source: docs.astral.sh/uv.
Project lifecycle
uv init myapp | Scaffold a new project |
uv add httpx | Add a dependency |
uv add --dev ruff | Add a dev-only dependency |
uv remove httpx | Remove a dependency |
uv sync | Install exactly what the lockfile says |
uv lock | Re-resolve & update uv.lock |
Running code
uv run main.py | Run a script in the project env |
uv run python | Open the REPL |
uv run pytest | Run an installed tool/command |
uv run -m app | Run a module (like python -m) |
Python versions
uv python install 3.13 | Install an interpreter |
uv python pin 3.13 | Pin for this project (.python-version) |
uv python list | List available/installed |
Tools (npx-style)
uvx ruff check | Run a tool without installing |
uv tool install ruff | Install a tool globally |
JS → uv quick map
npm init→uv init · npm i x→uv add x · npm i→uv sync · node f.js→uv run f.py · npx t→uvx t · nvm use→uv python pin · package.json→pyproject.toml · package-lock.json→uv.lock
Don't
You don't need python -m venv, source .venv/bin/activate, or bare pip install when using uv. uv run and uv add handle the venv for you. Reach for uv pip … only when deliberately dropping to the low-level pip interface.