Python scripts

From edmundmiller/dotfiles · View interactive version

Python scripts is an AI agent skill from the GitHub repository edmundmiller/dotfiles. Use when writing standalone Python scripts (one-off scripts, utilities, not part of a larger Python project with pyproject.toml or setup.py). Provides UV shebang template and best practices.

How to use this skill

Skill file

Standalone Python Scripts

UV Shebang Template

For standalone Python scripts, always use the UV shebang format:

#!/usr/bin/env -S uv run --script
#
# /// script
# dependencies = [
#   "requests",
#   "click",
# ]
# [tool.uv]
# exclude-newer = "2025-08-23T00:00:00Z"
# ///

import requests
import click

# Your script code here

Key Points

When to Use

✅ Use this for:

❌ Don't use this for:

Example Script

#!/usr/bin/env -S uv run --script
#
# /// script
# dependencies = [
#   "httpx",
#   "rich",
# ]
# [tool.uv]
# exclude-newer = "2025-08-23T00:00:00Z"
# ///

import httpx
from rich import print

def main():
    response = httpx.get("https://api.github.com")
    print(f"Status: {response.status_code}")

if __name__ == "__main__":
    main()

Making Scripts Executable

chmod +x script.py
./script.py  # Run directly
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.