{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "type": "object",
    "required": [
        "commands"
    ],
    "properties": {
        "constants": {
            "type": "object"
        },
        "commands": {
            "type": "array",
            "items": {
                "$ref": "#/definitions/command"
            },
            "minItems": 1
        }
    },
    "definitions": {
        "command": {
            "type": "object",
            "properties": {
                "command": {
                    "type": "string"
                },
                "help": {
                    "type": "string"
                },
                "short_help": {
                    "type": "string"
                },
                "arguments": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/argument"
                    }
                },
                "templates": {
                    "type": "array",
                    "items": {
                        "anyOf": [
                            {
                                "$ref": "#/definitions/template"
                            },
                            {
                                "$ref": "#/definitions/directory"
                            }
                        ]
                    },
                    "minItems": 1
                }
            },
            "required": [
                "templates"
            ]
        },
        "argument": {
            "type": "object",
            "properties": {
                "name": {
                    "type": "string"
                },
                "help": {
                    "type": "string"
                }
            },
            "required": [
                "name"
            ]
        },
        "template": {
            "type": "object",
            "properties": {
                "source": {
                    "type": "string"
                },
                "destination": {
                    "type": "string"
                }
            },
            "required": [
                "source",
                "destination"
            ]
        },
        "directory": {
            "type": "object",
            "properties": {
                "directory": {
                    "type": "string"
                }
            },
            "required": [
                "directory"
            ]
        }
    }
}