Fills the placeholders of one Word, PowerPoint or Excel template with your values, formatting kept, with a PDF if you want.
Say it in your own words; the assistant finds this recipe by itself. Examples:
Fill in a Word, PowerPoint or Excel template in ONE command from the values you give: every {{name}}, «name» or [NAME] placeholder in the body, tables, headers, footers, slides, notes and cells is replaced, formatting kept; a table row marked {{#items}} … {{/items}} is repeated per item (invoice lines, attendees); optional PDF of the result. One document, one set of values; for one letter per person use bulk-letters. Use for: fill in this offer template for Fjordline, put the client name and date on the cover slide, complete the budget sheet for 2027, udfyld skabelonen med disse oplysninger. Triggers: template, placeholder, fill in, complete the form, merge fields, skabelon, udfyld, {{...}}, cover page with the client's name.
python3 /skills/fill-template/scripts/fill.py <verb> …. Placeholders are {{name}}, <<name>>,
«name» or [NAME] (capitals in brackets) anywhere in a .docx (body, tables, headers,
footers), a .pptx (all slides, tables, notes) or an .xlsx (every cell, sheet names). Inputs
are in /work/in, results in /work/out. Prints one OK … line or one ERROR … line.
| Need | Command |
|---|---|
| Which placeholders are in the template | fill.py fields /work/in/offer.docx |
| Fill it, values inline | fill.py fill /work/in/offer.docx /work/out/offer-fjordline.docx --values '{"client":"Fjordline Advisory","contact":"Anna Berg","hours":40,"rate":"1.250 DKK","valid_until":"30 November 2026"}' |
| Values from a file, plus a PDF | fill.py fill /work/in/offer.docx /work/out/offer.docx --values /work/in/values.json --pdf /work/out/offer.pdf |
| PowerPoint or Excel template | same fill verb with a .pptx or .xlsx; OUT keeps the type |
| A placeholder you have no value for | --missing blank (remove it) or --missing keep (leave it); default is an error naming it |
| Repeat a table row per item | the row contains {{#lines}} … {{/lines}} and --values has "lines": [{"text": "…", "qty": 2, "price": "…"}, …] |
Placeholder names are matched case-insensitively. Numbers given as numbers land in Excel as
numbers. Run fields first only when the person did not say what the template contains.
Give the person the download link(s) from the OK line.
SKILL.mdgate.jsonscripts/__pycache__/fill.cpython-313.pycscripts/fill.pyWritten by Percerno, MIT licence.