Home

tmpl @400fb642540353a70521cf1f302b9482eb934f76 - refs - log -
-
https://git.jolheiser.com/tmpl.git
Template automation
tmpl / schema / tmpl.json
- raw
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://git.jojodev.com/jolheiser/tmpl/raw/branch/main/schema/tmpl.json",
  "title": "tmpl template",
  "description": "A template for tmpl",
  "type": "object",
  "required": [
    "prompts"
  ],
  "additionalProperties": false,
  "properties": {
    "prompts": {
      "description": "Template prompts",
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "required": [
          "id"
        ],
        "additionalProperties": false,
        "properties": {
          "id": {
            "description": "The unique prompt ID",
            "type": "string"
          },
          "label": {
            "description": "A label to show instead of the ID when prompting",
            "type": "string"
          },
          "help": {
            "description": "A help message for more information on a prompt",
            "type": "string"
          },
          "default": {
            "description": "A default value for the prompt",
            "type": "string"
          },
          "options": {
            "description": "A set of options for this prompt",
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "string"
            }
          },
          "type": {
            "description": "The type of prompt",
            "type": "string",
            "enum": ["input", "multi", "select", "confirm", "editor"]
          }
        },
        "anyOf": [
          {
            "properties": {
              "type": {
                "const": "select"
              }
            },
            "required": ["options"]
          },
          {
            "properties": {
              "type": {
                "not": {
                  "const": "select"
                }
              }
            }
          }
        ]
      }
    }
  }
}