single-file-uv-scripter

Create self-contained Python scripts with inline dependencies for uv run execution.

31|6|Updated Dec 13, 2025
One-click install
npx skills add https://github.com/WaterplanAI/agentic-config --skill single-file-uv-scripter-waterplanai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: single-file-uv-scripter
Source: https://github.com/WaterplanAI/agentic-config/tree/main/core/skills/single-file-uv-scripter
Command: npx skills add https://github.com/WaterplanAI/agentic-config --skill single-file-uv-scripter-waterplanai

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill enables developers to create Python scripts that are self-contained by embedding inline dependencies using a PEP 723-style header. These scripts can be executed with uv run without requiring external installs or environment setup.

Core Features & Use Cases

  • Inline dependency declarations in the script header for zero-config execution with uv run.
  • Self-contained packaging reduces setup friction for CLI tools, automation tasks, and data-processing scripts.
  • Use Case: Build a portable CLI tool that automatically installs dependencies on first run and executes under uv.

Quick Start

Create a minimal script.py with an inline metadata header, then run uv run script.py to execute it.

Frequently Asked Questions about single-file-uv-scripter

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

FAQPage Schema
How do I create a self-contained Python script that runs without manual package installation?

Self-contained Python scripts embed inline dependencies using a PEP 723-style metadata header. When you run the script with uv run, it automatically installs those dependencies and executes without requiring separate environment setup or manual package management.

What is PEP 723 and why use it for Python scripts?

PEP 723 defines a standard format for embedding script metadata, including dependencies, directly in Python files. It enables zero-config execution by letting tools like uv read and install dependencies from the script itself, eliminating external configuration files.

Can I use uv run to execute Python scripts with inline dependencies?

Yes. uv run executes Python scripts that declare inline dependencies via a PEP 723 metadata block. It automatically installs the specified dependencies on first run and handles all package management, making scripts portable across environments.

How do I ship a CLI tool or automation script that works across different environments?

Package your Python script as self-contained by adding a PEP 723 metadata header with inline dependencies and an optional requires-python directive. Users run it with uv run, which auto-installs dependencies and executes the script without manual setup, ensuring portability.

What are the limitations of inline dependencies in Python scripts?

Inline dependencies require uv to be available on the target system and work best for small CLI tools and automation tasks. Complex projects with many dependencies or custom build steps are better served by traditional package management and virtual environments.

Do I need to specify a Python version when using inline script dependencies?

You can optionally declare a requires-python directive in the PEP 723 metadata block to specify version constraints. uv respects this requirement during execution, ensuring the script runs only on compatible Python versions.