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 myappScaffold a new project
uv add httpxAdd a dependency
uv add --dev ruffAdd a dev-only dependency
uv remove httpxRemove a dependency
uv syncInstall exactly what the lockfile says
uv lockRe-resolve & update uv.lock

Running code

uv run main.pyRun a script in the project env
uv run pythonOpen the REPL
uv run pytestRun an installed tool/command
uv run -m appRun a module (like python -m)

Python versions

uv python install 3.13Install an interpreter
uv python pin 3.13Pin for this project (.python-version)
uv python listList available/installed

Tools (npx-style)

uvx ruff checkRun a tool without installing
uv tool install ruffInstall 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.