feat(skills): make skill scripts self-executing with uv hashbang
The Python scripts in mpi-pptx-translate, mpi-pdf-to-docx-conversion, and mpi-chinese-text-normalize previously required users to type manually. That is easy to forget and adds friction every time the skill runs. Switch all four scripts to a shebang, so they can be invoked directly: . The PEP 723 metadata blocks remain, so uv still installs the dependencies automatically. Also made the scripts executable and updated their usage messages and SKILL.md instructions to match the direct-execution style.
This commit is contained in:
Regular → Executable
+3
-3
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python3
|
||||
#!/usr/bin/env -S uv run --script
|
||||
# /// script
|
||||
# requires-python = ">=3.9"
|
||||
# dependencies = [
|
||||
@@ -13,7 +13,7 @@ Handles multi-language text, mixed fonts, bullets, numbered lists, verses,
|
||||
attributions, images, and flowing text across pages.
|
||||
|
||||
Usage:
|
||||
uv run convert_pdf_to_docx.py input.pdf output.docx
|
||||
./convert_pdf_to_docx.py input.pdf output.docx
|
||||
|
||||
Requires: uv (dependencies are declared in the /// script block above)
|
||||
"""
|
||||
@@ -552,6 +552,6 @@ def convert_pdf_to_docx(pdf_path: str, docx_path: str, config: dict = None):
|
||||
# CLI
|
||||
if __name__ == "__main__":
|
||||
if len(sys.argv) != 3:
|
||||
print("Usage: uv run convert_pdf_to_docx.py <input.pdf> <output.docx>")
|
||||
print("Usage: ./convert_pdf_to_docx.py <input.pdf> <output.docx>")
|
||||
sys.exit(1)
|
||||
convert_pdf_to_docx(sys.argv[1], sys.argv[2])
|
||||
|
||||
Reference in New Issue
Block a user