uv

Execute Python scripts with inline metadata and per-script dependencies.

2.8k|212|Updated Nov 2, 2025
One-click install
npx skills add https://github.com/mitsuhiko/agent-stuff --skill uv-mitsuhiko
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: uv
Source: https://github.com/mitsuhiko/agent-stuff/tree/main/skills/uv
Command: npx skills add https://github.com/mitsuhiko/agent-stuff --skill uv-mitsuhiko

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill lets you run Python scripts with inline metadata and per-script dependencies, eliminating manual environment setup and simplifying reproducible automation.

Core Features & Use Cases

  • Inline Script Metadata: declare requires-python and dependencies directly in the script body for repeatable runs.
  • Per-Script Dependency Management: automatically resolves and applies dependencies for each script without global pollution.
  • Use Case: automate a nightly data-cleaning task by writing a single script that specifies its runtime and libraries, then run it with uv.

Quick Start

Use uv run script.py to execute a script that contains an inline metadata block; add dependencies with uv add if needed.

Frequently Asked Questions about uv

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run Python scripts with inline metadata and per-script dependencies?

To run Python scripts with inline metadata, use the uv run command to execute the file. This automatically resolves and applies the declared dependencies for that specific script without polluting your global environment.

What is inline script metadata used for in Python automation?

Inline script metadata in Python automation is used to declare requires-python and dependencies directly in the script body. This ensures repeatable runs by specifying the exact runtime and libraries needed for reproducible workflows.

Can I specify a Python version constraint for a single script?

Yes, you can specify a Python version constraint for a single script using inline metadata. By declaring requires-python directly in the script body, the runner applies the correct runtime for that specific file.

Does uv work for reproducible workflows without manual environment setup?

Yes, uv works for reproducible workflows by eliminating manual environment setup. It automatically performs per-script dependency resolution based on the inline metadata block, ensuring the script runs with its declared libraries.

What is the best way to manage dependencies for a standalone Python script?

The best way to manage dependencies for a standalone Python script is using inline metadata blocks. You declare the libraries directly in the script body, and tools like uv automatically resolve them per-script without global pollution.

Why does running a Python script fail when dependencies are not installed globally?

Running a Python script fails without global dependencies because traditional execution expects libraries to be pre-installed in the environment. Using inline metadata with uv resolves this by automatically managing per-script dependencies.