{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/cmdx-yaml/latest.json",
  "x-lintel": {
    "source": "https://raw.githubusercontent.com/suzuki-shunsuke/cmdx/refs/heads/main/json-schema/cmdx.json",
    "sourceSha256": "c8765b358cc2f9d71964e4a47de898efda0a46554586848aa790d135730d10fb",
    "fileMatch": [
      ".cmdx.yaml",
      ".cmdx.yml",
      "cmdx.yaml",
      "cmdx.yml"
    ],
    "parsers": [
      "yaml"
    ]
  },
  "$ref": "#/$defs/Config",
  "$defs": {
    "Arg": {
      "properties": {
        "name": {
          "type": "string"
        },
        "usage": {
          "type": "string"
        },
        "default": {
          "type": "string"
        },
        "input_envs": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "script_envs": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "required": {
          "type": "boolean"
        },
        "prompt": {
          "$ref": "#/$defs/Prompt"
        },
        "validate": {
          "items": {
            "$ref": "#/$defs/Validate"
          },
          "type": "array"
        }
      },
      "required": [
        "name"
      ],
      "type": "object",
      "additionalProperties": false
    },
    "Config": {
      "properties": {
        "tasks": {
          "items": {
            "$ref": "#/$defs/Task"
          },
          "type": "array"
        },
        "input_envs": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "script_envs": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "environment": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "timeout": {
          "$ref": "#/$defs/Timeout"
        },
        "quiet": {
          "type": "boolean"
        }
      },
      "required": [
        "tasks"
      ],
      "type": "object",
      "additionalProperties": false
    },
    "Flag": {
      "properties": {
        "name": {
          "type": "string"
        },
        "short": {
          "type": "string"
        },
        "usage": {
          "type": "string"
        },
        "default": {
          "type": "string"
        },
        "input_envs": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "script_envs": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "type": {
          "type": "string"
        },
        "required": {
          "type": "boolean"
        },
        "prompt": {
          "$ref": "#/$defs/Prompt"
        },
        "validate": {
          "items": {
            "$ref": "#/$defs/Validate"
          },
          "type": "array"
        }
      },
      "required": [
        "name"
      ],
      "type": "object",
      "additionalProperties": false
    },
    "Prompt": {
      "properties": {
        "type": {
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "help": {
          "type": "string"
        },
        "options": {
          "items": {
            "type": "string"
          },
          "type": "array"
        }
      },
      "required": [
        "type"
      ],
      "type": "object",
      "additionalProperties": false
    },
    "Require": {
      "properties": {
        "exec": {
          "items": {
            "$ref": "#/$defs/StrList"
          },
          "type": "array"
        },
        "environment": {
          "items": {
            "$ref": "#/$defs/StrList"
          },
          "type": "array"
        }
      },
      "type": "object",
      "additionalProperties": false
    },
    "StrList": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        }
      ]
    },
    "Task": {
      "properties": {
        "name": {
          "type": "string"
        },
        "short": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "usage": {
          "type": "string"
        },
        "flags": {
          "items": {
            "$ref": "#/$defs/Flag"
          },
          "type": "array"
        },
        "args": {
          "items": {
            "$ref": "#/$defs/Arg"
          },
          "type": "array"
        },
        "input_envs": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "script_envs": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "environment": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "script": {
          "type": "string"
        },
        "timeout": {
          "$ref": "#/$defs/Timeout"
        },
        "require": {
          "$ref": "#/$defs/Require"
        },
        "quiet": {
          "type": "boolean"
        },
        "shell": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "tasks": {
          "items": {
            "$ref": "#/$defs/Task"
          },
          "type": "array"
        }
      },
      "required": [
        "name"
      ],
      "type": "object",
      "additionalProperties": false
    },
    "Timeout": {
      "properties": {
        "duration": {
          "type": "integer"
        },
        "kill_after": {
          "type": "integer"
        }
      },
      "type": "object",
      "additionalProperties": false
    },
    "Validate": {
      "properties": {
        "type": {
          "type": "string"
        },
        "regexp": {
          "type": "string"
        },
        "min_length": {
          "type": "integer"
        },
        "max_length": {
          "type": "integer"
        },
        "prefix": {
          "type": "string"
        },
        "suffix": {
          "type": "string"
        },
        "contain": {
          "type": "string"
        },
        "enum": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "min": {
          "type": "integer"
        },
        "max": {
          "type": "integer"
        }
      },
      "type": "object",
      "additionalProperties": false
    }
  }
}
