{
  "clide": 1,
  "name": "Save a document",
  "description": "Saves words as a dated Markdown document, in a folder you choose or in Documents/CLIDE Reports, never over another.",
  "tags": ["document", "text", "starter"],
  "input": [
    { "id": "title", "type": "text", "label": "Title", "required": true, "placeholder": "Weekly report" },
    { "id": "words", "type": "textarea", "label": "Words", "required": true, "help": "Markdown is fine: # headings, - lists, **bold**." },
    { "id": "folder", "type": "folder", "label": "Save in", "help": "Leave it empty for Documents/CLIDE Reports in your home folder." }
  ],
  "sentence": "Save {{title}}",
  "run": {
    "command": "bun",
    "args": ["./save-a-document.ts", "--title", "{{title}}", { "when": "folder", "args": ["--folder", "{{folder}}"] }],
    "stdin": "{{words}}"
  },
  "output": [
    { "id": "document", "type": "file", "label": "Document", "from": "match", "pattern": "Saved to (.+)" }
  ]
}
