uv-script
A lightweight, zero-dependency script runner for uv. Define project scripts in pyproject.toml and run them through uv run.
$ uvs --list
check lint -> test
format ruff format src/
lint ruff check src/
test pytest tests/ -v
Why?
uv is a fantastic package manager but has no built-in task runner. If you've been using Hatch just for its scripts, or reaching for Poe the Poet / Taskipy to fill the gap, uvs offers a simpler alternative:
- Zero runtime dependencies — stdlib only (
tomllib,argparse,subprocess) - uv-native — every command runs through
uv run, so your venv, lockfile, and Python version are always in sync - Familiar — if you've used npm scripts or Hatch scripts, you already know how this works
Installation
# As a dev dependency in your project
uv add --dev uv-script
# Or run without installing
uvx uv-script --list
Quick start
Add a [tool.uvs.scripts] section to your pyproject.toml:
[tool.uvs.scripts]
test = "pytest tests/ -v"
lint = "ruff check src/"
format = "ruff format src/"
check = ["lint", "test"]
Then run:
uvs test # runs: uv run pytest tests/ -v
uvs check # runs lint, then test (stops on first failure)
uvs --list # shows all available scripts
Configuration
Scripts are defined under [tool.uvs.scripts] in pyproject.toml. Three formats are supported:
Simple command
A string value runs a single command through uv run:
[tool.uvs.scripts]
test = "pytest tests/ -v"
lint = "ruff check ."
Composite script
An array of strings runs multiple steps sequentially. Items can reference other script names or be raw commands. Execution stops on the first non-zero exit code.
[tool.uvs.scripts]
lint = "ruff check ."
test = "pytest tests/"
check = ["lint", "test"]
full = ["ruff format --check .", "lint", "test"]
Table with options
A table gives you control over environment variables and help text:
[tool.uvs.scripts.serve]
cmd = "python -m flask run"
env = { FLASK_DEBUG = "1", FLASK_APP = "app.py" }
help = "Start the development server"
[tool.uvs.scripts.deploy]
cmd = "python scripts/deploy.py"
env = { ENV = "production" }
help = "Deploy to production"
| Key | Type | Required | Description |
|---|---|---|---|
cmd |
string | yes | The command to run |
env |
table of strings | no | Environment variables (overlays current) |
help |
string | no | Description shown in --list output |
Editable installs
For monorepos with multiple packages, you can configure editable installs under [tool.uvs]. These are passed as --with-editable flags to every uv run invocation, so local packages take priority over PyPI versions:
[tool.uvs]
editable = ["../shared-lib", "../auth-service"]
[tool.uvs.scripts]
test = "pytest tests/ -v"
Paths are resolved relative to the pyproject.toml directory. To skip editable installs for a single run, use --no-editable:
uvs --no-editable test
Usage
uvs [options] <script> [-- extra-args...]
| Flag | Description |
|---|---|
-l, --list |
List all available scripts |
-v, --verbose |
Print each command before running |
--no-editable |
Ignore editable installs from config |
-V, --version |
Show version and exit |
Passing extra arguments
Use -- to forward arguments to the underlying command:
uvs test -- -k "test_parse" --no-header
# runs: uv run pytest tests/ -v -k test_parse --no-header
For composite scripts, extra arguments are appended to the last command in the chain.
Running from subdirectories
uvs walks up from your current directory to find the nearest pyproject.toml, just like uv does. You can run uvs test from anywhere inside your project.
How it works
uvs is a thin orchestration layer. Every command is prefixed with uv run, which means:
- Your virtual environment is automatically activated
- Dependencies are synced from the lockfile if needed
- The correct Python version is used
There is no magic — uvs test is equivalent to typing uv run pytest tests/ -v yourself.
Development
This project uses uvs to manage its own scripts:
git clone <repo-url> && cd uv-script
uv sync
uvs test # run tests
uvs lint # run linter
uvs check # lint + test
License
MIT
Metadata
Release files for uv-script 0.1.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| uv_script-0.1.9.tar.gz | 6.0 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| uv_script-0.1.9-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.7 kB
Release files / uv_script-0.1.9.tar.gz
| Download URL | uv_script-0.1.9.tar.gz |
|---|---|
| Size | 6.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fda8dd28a1e037d0f41b5f0a0e7f15dd1ecc3deb03fe799f895fd7be639a81ac
|
|
BLAKE2b-256 checksum How to use checksums |
b7324dbefcb9bb6197b588f1edfa6c50d2b18342e8c2b002be796ee3a0453ad3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 12, 2026.
Transparency logRelease files / uv_script-0.1.9-py3-none-any.whl
| Download URL | uv_script-0.1.9-py3-none-any.whl |
|---|---|
| Size | 7.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
aea2f419f605617e27c6a3b5ce198c043231f79fdc770cdd0feb58258dd2c456
|
|
BLAKE2b-256 checksum How to use checksums |
82ba10dc44db65ce99720c908c0c6c4cca52d8f2f222b67ca91db5d5ccb38062
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 12, 2026.
Transparency logSecurity for uv-script 0.1.9
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for uv_script-0.1.9.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 12, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.