uv command reference

13-06-2025

Configuration:

Environment variables:

  • UV_CONFIG_FILE=~/.config/uv/uv.toml
index-url = "[https://nexus.ny1.ninetyone.com/repository/pypy-all/simple"](https://nexus.ny1.ninetyone.com/repository/pypy-all/simple")
native-tls = true
allow-insecure-host = ["nexus.ny1.ninetyone.com"]
  • UV_DEFAULT_INDEX = [https://nexus.ny1.ninetyone.com/repository/pypy-all/simple](https://nexus.ny1.ninetyone.com/repository/pypy-all/simple`)
  • UV_PROJECT_ENVIRONMENT = .venv
  • UV_INSECURE_HOST = nexus.ny1.ninetyone.com
  • UV_NATIVE_TLS = true

Loading from .env files:

echo "MY_VAR='Hello, world!'" > .env
uv run --env-file .env -- python -c 'import os; print(os.getenv("MY_VAR"))'

Inline script metadata:

# /// script
# requires-python = ">=3.11"
# dependencies = [
#   "requests<3",
#   "rich",
# ]
# ///
 
import requests
import rich

Working with pip:

  • uv pip install -r requirements.txt

Finding and deleting installed python executables:

uv python list
uv python uninstall --all