Created
April 28, 2025 09:34
-
-
Save thomascamminady/4268b64ccc8a4bd949181a00318d4004 to your computer and use it in GitHub Desktop.
uv script template
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env -S uv run --script | |
# /// script | |
# requires-python = ">=3.13" | |
# dependencies = [ | |
# "fire", | |
# ] | |
# /// | |
# pyright: reportMissingModuleSource=false | |
# pyright: reportMissingImports=false | |
import fire | |
def main(name: str) -> None: | |
"""Greet the user. | |
Run this script with the command: | |
`uv run script.py --name="You"` | |
Or: | |
`chmod +x script.py` | |
`./script.py --name="You"` | |
""" | |
print(f"Hello {name}!") | |
if __name__ == "__main__": | |
fire.Fire(main) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment