How to use uvs to install single-file Python scripts as command-line tools.
Known to work on Linux and Windows. Mac should be okay but I don't know.
- uv installed and available in your PATH
Install uvs as a command-line tool:
uv tool install https://github.com/maphew/uvs.gitNow you can use uvs:
uvs --helpCreate a script with PEP 723 inline metadata using uv and install it as a tool:
> uv init --script uvs-hello.py
Initialized script at `uvs-hello.py`
> uvs install uvs-hello.py
Running: uv tool install C:\...\uvs-_asjfho3\uvs-hello
⠋ Installing...⠋ Resolving dependencies...
Resolved 1 package in 3ms
Built uvs-hello @ file:///C:/.../uvs-_asjfho3/uvs-hello
Prepared 1 package in 27ms
Installed 1 package in 16ms
+ uvs-hello==0.1.0 (from file:///C:/.../uvs-_asjfho3/uvs-hello)
Installed 1 executable: uvs-hello
╭──────── Installation Complete ───────────╮
│ ✓ Successfully installed uvs-hello │
│ │
│ Source: C:\...\dev\play\uvs-hello.py │
│ Version: 0.1.0 │
│ Run 'uvs-hello' to use your new tool │
╰──────────────────────────────────────────╯
> uvs-hello
Hello from uvs-hello.py!# List tools installed with uvs
# (note: this is different from `uv tool list`)
> uvs list
Tool Name Source Path Version Installed At
fgmirror C:\...\dev\fgmirror.py 0.1.0 2025-10-07T03:00:27
> uvs show fgmirror
Tool Details: fgmirror
Property Value
Name fgmirror
Source C:\...\dev\fgmirror.py
Version 0.1.0
Installed 2025-10-07T03:00:27.171189+00:00
Hash 5192febbfb2df230...- Modify your script (e.g., change the print statement in
my-tool.py) - Reinstall with the
--updateflag:
> uvs update my-tool.pyUvs will detect changes and bump the version automatically.
# one tool
uvs uninstall my-tool
# all uvs tools
uvs uninstall --all
# Preview without actually removing:
uvs uninstall --dry-run my-tooluvs install --help
Usage: uvs install [OPTIONS] [SCRIPT]
Install a script as a CLI tool.
SCRIPT is the path to the Python script to install. The script should:
- Contain PEP723 metadata in a comment block
- Have a main() function that will be called when the tool is executed
Examples:
uvs install my-script.py # Install with default name
uvs install --name my-tool script.py # Custom tool name
uvs install --all ./scripts/ # Install all scripts in directory
uvs install --dry-run script.py # Preview without installing
uvs install --editable --python 3.11 script.py # Development install
PEP723 Metadata Example:
# /// script
# requires-python = ">=3.8"
# dependencies = ["requests", "click"]
# ///
Options:
-n, --name TEXT Override tool name (default: derived from filename)
--version TEXT Initial package version (default: 0.1.0)
-e, --editable Install in editable mode for development
--tempdir PATH Directory for temporary package generation
--python TEXT Python version to use for installation (e.g., 3.11)
--dry-run Generate package but do not install
--all Install all .py files in directory
--help Show this message and exit.
uvs uninstall --help
Usage: uvs uninstall [OPTIONS] [TOOL_NAME]
Uninstall an installed tool.
Examples:
uvs uninstall my-tool # Uninstall a specific tool
uvs uninstall --all # Uninstall all tools
uvs uninstall --dry-run tool # Preview what would be uninstalled
Options:
--all Uninstall all installed tools
--dry-run Show what would be uninstalled without actually
uninstalling
--backup / --no-backup Create a backup of the registry before uninstalling
--force Force uninstall without confirmation
--help Show this message and exit.
- Create your script with inline script metadata
- Test it directly:
uv run my-script.py - Install it:
uvs my-script.py - Test the installed command:
my-script - Iterate: make changes, then
uvs --update my-script.py
- Organize scripts in a directory
- Use
--allto install all at once - Use
--listto see what's installed - Use
--whichto find sources when needed
Install uv following the official installation guide.
- Check that your script has a
main()function - Verify all dependencies are correctly specified in the PEP 723 metadata
- Verify script executes properly with
uv run myscript.py - Use
uvs --dry-runto inspect the generated package
- Check the tool name with
uvs --list - Verify the tool was installed with uvs (not directly with uv)
- Use
uv tool listto see all tools installed with uv
- Check if the tool is still in use by another process
- Try running with
--forceflag to skip confirmation - Use
uv tool listto verify the tool exists in uv's registry - Use
uvs uninstall --dry-run tool-nameto preview what would be removed
- Explore the examples directory for more complex scripts
- Readme-full for extended docs and development notes
Initial idea, development, quality control, and LLM wrangling: matt wilkie @maphewyk, [email protected].
IDE and AI orchestration: Kilo Code
LLM assistants: Claude Sonnet 4.5 (architecture), GLM 4.6 (code backbone), GPT5-Mini (docs), Grok Code Fast 1 (implementation, testing)