Python inline scripts

From jahands/prompts · View interactive version

Python inline scripts is an AI agent skill from the GitHub repository jahands/prompts. Guide for running inline Python scripts with uv. This should be used when the user says "use inline python

How to use this skill

Skill file

Run inline scripts with uv, declaring dependencies in the script metadata. List only PyPI packages: stdlib modules (json, os, re) aren't on PyPI, so listing them makes uv fail to resolve the script. Target Python 3.12+.

uv run --no-project -q --script - < <(cat <<'EOF'
# /// script
# requires-python = ">=3.12"
# dependencies = ["httpx"]
# ///
import httpx
print(httpx.get("https://api.github.com/zen").text)
EOF
)
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.