1.2 KiB
1.2 KiB
Docfill MVP Design
Goal
Build the smallest local Go command-line tool that a digital employee can call to fill Word or Excel templates from Excel or SQLite data.
MVP Scope
- Input data:
.xlsxtable or SQLite query result. - Template files:
.docxor.xlsx. - Placeholder syntax:
{{column_name}}. - Output: one generated file per input row.
- Invocation:
docfill run --config task.json.
Explicit Non-Goals
- No web UI.
- No permission system.
- No workflow engine.
- No template designer.
- No direct business-system integration.
- No AI guessing of fields.
- No complex Word layout manipulation.
Config Shape
{
"data": {
"type": "excel",
"path": "./data.xlsx",
"sheet": "Sheet1"
},
"template": {
"path": "./template.docx"
},
"output": {
"path": "./out/report_{{name}}_{{_row}}.docx"
}
}
For SQLite, data uses type: "sqlite" and query.
Constraints
- Keep the implementation boring and inspectable.
- Infer template behavior from file extension.
- Treat Excel first row or SQL column names as placeholder keys.
- If a Word placeholder is split across Word XML runs, MVP may not replace it; users should type placeholders as plain contiguous text.