Skip to content

Instantly share code, notes, and snippets.

@chand1012
Last active June 30, 2025 16:10
Show Gist options
  • Save chand1012/218372f3e1101dfa7f915dc35c0e66d8 to your computer and use it in GitHub Desktop.
Save chand1012/218372f3e1101dfa7f915dc35c0e66d8 to your computer and use it in GitHub Desktop.
Magentic and PEP 723 example. https://chand1012.mit-license.org
#!/usr/bin/env -S uv run --script
# /// script
# requires-python = ">=3.10"
# dependencies = [
# "fire",
# "magentic"
# ]
# ///
import fire
from magentic import prompt
@prompt('Add more "dude"ness to: {phrase}')
def dudeify(phrase: str) -> str: ... # No function body as this is never executed
if __name__=="__main__":
fire.Fire(dudeify)
@chand1012
Copy link
Author

Be sure to put a space between the triple slashes and the word script in the metadata! I didn't do this on the version revision and it doesn't work!
CleanShot 2025-06-30 at 12 09 53

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment