{ "$schema": "http://json-schema.org/draft-07/schema", "definitions": { "argument": { "title": "argument", "description": "A positional argument of the current script or sub-command\nhttps://bashly.dev/configuration/argument/", "type": "object", "required": [ "name" ], "properties": { "name": { "title": "name", "description": "A name of the current positional argument\nhttps://bashly.dev/configuration/argument/#name", "type": "string", "minLength": 1, "examples": [ "user" ] }, "help": { "title": "help", "description": "A description of the current positional argument\nhttps://bashly.dev/configuration/argument/#help", "type": "string", "minLength": 1, "examples": [ "AWS Username" ] }, "default": { "title": "default", "description": "A default value of the current positional argument\nhttps://bashly.dev/configuration/argument/#default", "oneOf": [ { "type": "string" }, { "type": "array", "minItems": 1, "items": { "type": "string" } } ], "examples": [ "*.jpg" ] }, "required": { "title": "required", "description": "Whether the current positional argument is required\nhttps://bashly.dev/configuration/argument/#required", "type": "boolean", "default": true }, "allowed": { "title": "allowed", "description": "Valid values of the current positional argument\nhttps://bashly.dev/configuration/argument/#allowed", "type": "array", "minItems": 1, "uniqueItems": true, "items": { "description": "A valid value of the current positional argument", "type": "string", "minLength": 1, "examples": [ "eu" ] } }, "repeatable": { "title": "repeatable", "description": "Whether the current positional argument can be repeated\nhttps://bashly.dev/configuration/argument/#repeatable", "type": "boolean", "default": false }, "validate": { "title": "validate", "description": "A validation function of the current positional argument\nhttps://bashly.dev/configuration/argument/#validate", "oneOf": [ { "type": "string" }, { "type": "array", "minItems": 1, "items": { "type": "string" } } ], "examples": [ "file_exists", "dir_exists", "integer", "non_empty", [ "file_exists", "file_writable" ] ] }, "unique": { "title": "unique", "description": "Whether the current positional argument is unique\nhttps://bashly.dev/configuration/argument/#unique", "type": "boolean", "default": false } }, "dependencies": { "unique": { "properties": { "repeatable": { "const": true } } } }, "patternProperties": { "^x_.": { "title": "custom property", "description": "A custom property of any type", "examples": [ "Anything" ] } }, "additionalProperties": false }, "flag": { "title": "flag", "description": "A flag of the current script or sub-command\nhttps://bashly.dev/configuration/flag/", "type": "object", "anyOf": [ { "required": [ "long" ] }, { "required": [ "short" ] } ], "properties": { "long": { "title": "long", "description": "A long form of the current flag\nhttps://bashly.dev/configuration/flag/#long", "type": "string", "pattern": "^--", "examples": [ "--ssh" ] }, "short": { "title": "short", "description": "A short form of the current flag\nhttps://bashly.dev/configuration/flag/#short", "type": "string", "pattern": "^-[^-]", "examples": [ "-s" ] }, "help": { "title": "help", "description": "A description of the current flag\nhttps://bashly.dev/configuration/flag/#help", "type": "string", "minLength": 1, "examples": [ "Clone using SSH" ] }, "arg": { "title": "arg", "description": "An argument name of the current flag\nhttps://bashly.dev/configuration/flag/#arg", "type": "string", "minLength": 1, "examples": [ "user" ] }, "default": { "title": "default", "description": "A default value of the current flag\nhttps://bashly.dev/configuration/flag/#default", "oneOf": [ { "type": "string" }, { "type": "array", "minItems": 1, "items": { "type": "string" } } ], "examples": [ "*.jpg" ] }, "required": { "title": "required", "description": "Whether the current flag is required\nhttps://bashly.dev/configuration/flag/#required", "type": "boolean", "default": true }, "allowed": { "title": "allowed", "description": "Valid values of the current flag\nhttps://bashly.dev/configuration/flag/#allowed", "type": "array", "minItems": 1, "uniqueItems": true, "items": { "description": "A valid value of the current positional argument", "type": "string", "minLength": 1, "examples": [ "user" ] } }, "conflicts": { "title": "conflicts", "description": "Mutually exclusive flags of the current flag\nhttps://bashly.dev/configuration/flag/#conflicts", "type": "array", "minItems": 1, "uniqueItems": true, "items": { "description": "The long form of the required flag", "type": "string", "minLength": 1, "examples": [ "--no-cache" ] } }, "needs": { "title": "needs", "description": "Additional flags required by the current flag\nhttps://bashly.dev/configuration/flag/#needs", "type": "array", "minItems": 1, "uniqueItems": true, "items": { "description": "The long form of the required flag", "type": "string", "minLength": 1, "examples": [ "--command" ] } }, "completions": { "title": "completions", "description": "Completions of the current flag\nhttps://bashly.dev/configuration/flag/#completions", "type": "array", "minItems": 1, "uniqueItems": true, "items": { "description": "A completion of the current flag", "type": "string", "minLength": 1 } }, "private": { "title": "private", "description": "Whether the current flag is hidden from help\nhttps://bashly.dev/configuration/flag/#private", "type": "boolean", "default": false }, "repeatable": { "title": "repeatable", "description": "Whether the current flag can be repeated\nhttps://bashly.dev/configuration/flag/#repeatable", "type": "boolean", "default": false }, "validate": { "title": "validate", "description": "A validation function of the current flag\nhttps://bashly.dev/configuration/flag/#validate", "oneOf": [ { "type": "string" }, { "type": "array", "minItems": 1, "items": { "type": "string" } } ], "examples": [ "file_exists", "dir_exists", "integer", "non_empty", [ "file_exists", "file_writable" ] ] }, "unique": { "title": "unique", "description": "Whether the current flag is unique\nhttps://bashly.dev/configuration/flag/#unique", "type": "boolean", "default": false } }, "dependencies": { "unique": { "properties": { "repeatable": { "const": true } } } }, "patternProperties": { "^x_.": { "title": "custom property", "description": "A custom property of any type", "examples": [ "Anything" ] } }, "additionalProperties": false }, "environment-variable": { "title": "environment variable", "description": "An environment variable of the current application\nhttps://bashly.dev/configuration/environment-variable/#environment-variable", "type": "object", "required": [ "name" ], "properties": { "name": { "title": "name", "description": "A name of the current environment variable\nhttps://bashly.dev/configuration/environment-variable/#name", "type": "string", "minLength": 1, "examples": [ "config_path" ] }, "help": { "title": "help", "description": "A description of the current environment variable\nhttps://bashly.dev/configuration/environment-variable/#help", "type": "string", "minLength": 1, "examples": [ "Location of the config file" ] }, "private": { "title": "private", "description": "Whether the current environment variable is hidden from help\nhttps://bashly.dev/configuration/environment-variable/#private", "type": "boolean", "default": false }, "required": { "title": "required", "description": "Whether the current environment variable is required\nhttps://bashly.dev/configuration/environment-variable/#required", "type": "boolean", "default": true }, "validate": { "title": "validate", "description": "A validation function for the current environment variable\nhttps://bashly.dev/configuration/environment-variable/#validate", "oneOf": [ { "type": "string" }, { "type": "array", "minItems": 1, "items": { "type": "string" } } ], "examples": [ "file_exists", "dir_exists", "integer", "non_empty", [ "file_exists", "file_writable" ] ] }, "allowed": { "title": "allowed", "description": "Valid values of the current environment variable\nhttps://bashly.dev/configuration/environment-variable/#allowed", "type": "array", "minItems": 1, "uniqueItems": true, "items": { "description": "A valid value of the current environment variable", "type": "string", "minLength": 1, "examples": [ "production" ] } }, "default": { "title": "default", "description": "A default value of the current environment variable\nhttps://bashly.dev/configuration/environment-variable/#default", "type": "string", "examples": [ "~/config.ini" ] } }, "patternProperties": { "^x_.": { "title": "custom property", "description": "A custom property of any type", "examples": [ "Anything" ] } }, "additionalProperties": false }, "variable": { "title": "variable", "description": "A global bash variable\nhttps://bashly.dev/configuration/variable/#variable", "type": "object", "required": [ "name" ], "properties": { "name": { "title": "name", "description": "A name for the current variable\nhttps://bashly.dev/configuration/variable/#name", "type": "string", "minLength": 1, "examples": [ "output_dir" ] }, "value": { "title": "value", "description": "A value for the current variable\nhttps://bashly.dev/configuration/variable/#value", "examples": [ "./output", [ "development", "production" ], { "verbosity": 3, "debug": true } ] } }, "patternProperties": { "^x_.": { "title": "custom property", "description": "A custom property of any type", "examples": [ "Anything" ] } }, "additionalProperties": false }, "name-property": { "title": "name", "description": "A name of the current script or sub-command\nhttps://bashly.dev/configuration/command/#name", "type": "string", "minLength": 1, "examples": [ "source" ] }, "sub-command-alias-property": { "$comment": "'sub-command-' prefix is used as this property is marked with 'Sub-Commands Only' badge", "title": "alias", "oneOf": [ { "description": "An alias of the current sub-command\nhttps://bashly.dev/configuration/command/#alias", "type": "string", "minLength": 1, "examples": [ "s" ] }, { "description": "Aliases of the current sub-command\nhttps://bashly.dev/configuration/command/#alias", "type": "array", "minItems": 1, "uniqueItems": true, "items": { "description": "An alias of the current sub-command", "type": "string", "minLength": 1, "examples": [ "s" ] } } ] }, "help-property": { "title": "help", "description": "A description of the current script or sub-command\nhttps://bashly.dev/configuration/command/#help", "type": "string", "minLength": 1, "examples": [ "URL to download from" ] }, "help-header-override-property": { "title": "help_header_override", "description": "Bash code (or function call) that will be executed at the beginning of the help message\nhttps://bashly.dev/configuration/command/#help-header-override", "type": "string", "minLength": 1, "examples": [ "generate_ascii_art_logo" ] }, "args-property": { "title": "args", "description": "Arguments of the current script or sub-command\nhttps://bashly.dev/configuration/command/#args", "type": "array", "minItems": 1, "uniqueItems": true, "items": { "$ref": "#/definitions/argument" } }, "flags-property": { "title": "flags", "description": "Flags of the current script or sub-command\nhttps://bashly.dev/configuration/command/#flags", "type": "array", "minItems": 1, "uniqueItems": true, "items": { "$ref": "#/definitions/flag" } }, "commands-property": { "title": "commands", "description": "Subcommands of the current script or sub-command\nhttps://bashly.dev/configuration/command/#commands", "type": "array", "minItems": 1, "uniqueItems": true, "items": { "$ref": "#/definitions/command-property" } }, "root-version-property": { "$comment": "'root-' prefix is used as this property is marked with 'Root Command Only' badge", "title": "version", "description": "A version of the current script\nhttps://bashly.dev/configuration/command/#version", "type": "string", "minLength": 1, "examples": [ "0.1.0" ] }, "sub-command-default-property": { "title": "default", "description": "Whether to use the current command as a fallback when CLI used incorrectly\nhttps://bashly.dev/configuration/command/#default", "oneOf": [ { "type": "boolean", "default": false }, { "type": "string", "enum": [ "force" ] } ] }, "environment-variables-property": { "title": "environment variables", "description": "Environment variables of the current application\nhttps://bashly.dev/configuration/environment-variable/#environment-variable", "type": "array", "minItems": 1, "uniqueItems": true, "items": { "$ref": "#/definitions/environment-variable" } }, "variables-property": { "title": "variables", "description": "Bash variables for the current application\nhttps://bashly.dev/configuration/command/#variables", "type": "array", "minItems": 1, "uniqueItems": true, "items": { "$ref": "#/definitions/variable" } }, "examples-property": { "title": "examples", "oneOf": [ { "description": "An example of the current script or sub-command\nhttps://bashly.dev/configuration/command/#examples", "type": "string", "minLength": 1, "examples": [ "cli upload profile.png -u admin -p s3cr3t" ] }, { "description": "Examples of the current script or sub-command\nhttps://bashly.dev/configuration/command/#examples", "type": "array", "minItems": 1, "uniqueItems": true, "items": { "description": "An example of the current script or sub-command\nhttps://bashly.dev/configuration/command/#examples", "type": "string", "minLength": 1, "examples": [ "cli upload profile.png -u admin -p s3cr3t" ] } } ] }, "footer-property": { "title": "footer", "description": "A description footer for the current script or sub-command\nhttps://bashly.dev/configuration/command/#footer", "type": "string", "minLength": 1, "examples": [ "This will appear at the end of the --help message" ] }, "sub-command-group-property": { "title": "group", "description": "A group of the current sub-command\nhttps://bashly.dev/configuration/command/#group", "type": "string", "minLength": 1, "examples": [ "File" ] }, "catch-all-property": { "title": "catch all", "description": "Whether to allow additional arguments or flags for the current command\nhttps://bashly.dev/configuration/command/#catch_all", "oneOf": [ { "type": "boolean", "default": false }, { "type": "string", "minLength": 1, "examples": [ "Additional arguments or flags for AWS CLI" ] }, { "type": "object", "properties": { "label": { "description": "A label for the current argument or flag\nhttps://bashly.dev/configuration/command/#catch_all", "type": "string", "minLength": 1, "examples": [ "AWS Params" ] }, "help": { "description": "A description for the current argument or flag\nhttps://bashly.dev/configuration/command/#catch_all", "type": "string", "minLength": 1, "examples": [ "Additional arguments or flags for AWS CLI" ] }, "required": { "description": "Whether the current argument or flag is required\nhttps://bashly.dev/configuration/command/#catch_all", "type": "boolean", "default": false }, "catch_help": { "description": "Whether to also disable the --help flag and catch it like any other\nhttps://bashly.dev/configuration/command/#catch_all", "type": "boolean", "default": false } }, "additionalProperties": false } ] }, "completions-property": { "title": "completions", "description": "Completions of the current script or sub-command\nhttps://bashly.dev/configuration/command/#completions", "type": "array", "minItems": 1, "uniqueItems": true, "items": { "description": "A completion of the current script or sub-command", "type": "string", "minLength": 1, "examples": [ "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" ] } }, "dependencies-command-property": { "title": "command", "description": "Dependencies of the current script or sub-command\nhttps://bashly.dev/configuration/dependency/#command", "type": "array", "minItems": 1, "uniqueItems": true, "items": { "description": "A dependency of the current script or sub-command\nhttps://bashly.dev/configuration/dependency/#command", "type": "string", "minLength": 1, "examples": [ "git" ] } }, "dependencies-help-property": { "title": "help", "description": "A help for the current dependency\nhttps://bashly.dev/configuration/dependency/#help", "type": "string", "minLength": 1, "examples": [ "Run 'sudo apt install git'" ] }, "dependencies-property": { "title": "dependencies", "oneOf": [ { "description": "Dependencies of the current script or sub-command\nhttps://bashly.dev/configuration/dependency/#dependency", "type": "array", "minItems": 1, "uniqueItems": true, "items": { "description": "A dependency of the current script or sub-command\nhttps://bashly.dev/configuration/dependency/#dependency", "oneOf": [ { "type": "string", "minLength": 1 }, { "type": "null" } ] } }, { "description": "Dependencies of the current script or sub-command\nhttps://bashly.dev/configuration/dependency/#dependency", "type": "object", "patternProperties": { ".": { "description": "A dependency of the current script or sub-command\nhttps://bashly.dev/configuration/dependency/#dependency", "oneOf": [ { "type": "string", "minLength": 1 }, { "type": "null" }, { "type": "object", "required": [ "command" ], "properties": { "command": { "$ref": "#/definitions/dependencies-command-property" }, "help": { "$ref": "#/definitions/dependencies-help-property" } }, "additionalProperties": false } ] } }, "additionalProperties": false } ] }, "sub-command-expose-property": { "title": "expose", "description": "Whether to expose the current sub-command if it has sub-commands\nhttps://bashly.dev/configuration/command/#expose", "oneOf": [ { "type": "boolean", "default": false }, { "type": "string", "enum": [ "always" ] } ] }, "root-extensible-property": { "title": "extensible", "description": "Whether to delegate the current unknown command to an external executable\nhttps://bashly.dev/configuration/command/#extensible", "oneOf": [ { "type": "boolean", "default": false }, { "type": "string", "examples": [ "git" ] } ] }, "filename-property": { "title": "filename", "description": "A partial file path of the current script or sub-command\nhttps://bashly.dev/configuration/command/#filename", "type": "string", "minLength": 1, "examples": [ "dir_commands/list.sh" ] }, "argfile-property": { "title": "argfile", "description": "A file containing flag defaults to autoload for the current script or sub-command.\nEach supported flag must appear on a single line, optionally followed by its value.\nNon-flag lines are ignored.\nhttps://bashly.dev/configuration/command/#argfile", "type": "string", "minLength": 1, "examples": [ ".mycli" ] }, "filters-property": { "title": "filters", "description": "Filters of the current script or sub-command\nhttps://bashly.dev/configuration/command/#filters", "type": "array", "minItems": 1, "items": { "description": "A filter of the current script or sub-command", "type": "string", "minLength": 1, "examples": [ "docker_running" ] } }, "function-property": { "title": "function", "description": "An internal function for the current script or sub-command\nhttps://bashly.dev/configuration/command/#function", "type": "string", "minLength": 1, "examples": [ "deprecated_container_start" ] }, "sub-command-private-property": { "title": "private", "description": "Whether hide the current sub-command from help\nhttps://bashly.dev/configuration/command/#private", "type": "boolean", "default": false }, "sub-command-import-property": { "title": "import", "description": "A file import for the current sub-command\nhttps://bashly.dev/configuration/command/#import", "type": "string", "minLength": 1, "examples": [ "src/download_command.sh" ] }, "command-property": { "title": "command", "description": "A command of the current application\nhttps://bashly.dev/configuration/command/#command", "type": "object", "properties": { "name": { "$ref": "#/definitions/name-property" }, "alias": { "$ref": "#/definitions/sub-command-alias-property" }, "help": { "$ref": "#/definitions/help-property" }, "help_header_override": { "$ref": "#/definitions/help-header-override-property" }, "args": { "$ref": "#/definitions/args-property" }, "flags": { "$ref": "#/definitions/flags-property" }, "commands": { "$ref": "#/definitions/commands-property" }, "default": { "$ref": "#/definitions/sub-command-default-property" }, "environment_variables": { "$ref": "#/definitions/environment-variables-property" }, "variables": { "$ref": "#/definitions/variables-property" }, "examples": { "$ref": "#/definitions/examples-property" }, "footer": { "$ref": "#/definitions/footer-property" }, "group": { "$ref": "#/definitions/sub-command-group-property" }, "catch_all": { "$ref": "#/definitions/catch-all-property" }, "completions": { "$ref": "#/definitions/completions-property" }, "dependencies": { "$ref": "#/definitions/dependencies-property" }, "expose": { "$ref": "#/definitions/sub-command-expose-property" }, "filename": { "$ref": "#/definitions/filename-property" }, "argfile": { "$ref": "#/definitions/argfile-property" }, "filters": { "$ref": "#/definitions/filters-property" }, "function": { "$ref": "#/definitions/function-property" }, "private": { "$ref": "#/definitions/sub-command-private-property" }, "import": { "$ref": "#/definitions/sub-command-import-property" } }, "patternProperties": { "^x_.": { "title": "custom property", "description": "A custom property of any type", "examples": [ "Anything" ] } }, "additionalProperties": false } }, "title": "cli", "description": "A CLI of the current application\nhttps://bashly.dev/usage/getting-started/", "type": "object", "properties": { "name": { "$ref": "#/definitions/name-property" }, "help": { "$ref": "#/definitions/help-property" }, "help_header_override": { "$ref": "#/definitions/help-header-override-property" }, "args": { "$ref": "#/definitions/args-property" }, "flags": { "$ref": "#/definitions/flags-property" }, "commands": { "$ref": "#/definitions/commands-property" }, "version": { "$ref": "#/definitions/root-version-property" }, "environment_variables": { "$ref": "#/definitions/environment-variables-property" }, "variables": { "$ref": "#/definitions/variables-property" }, "examples": { "$ref": "#/definitions/examples-property" }, "footer": { "$ref": "#/definitions/footer-property" }, "catch_all": { "$ref": "#/definitions/catch-all-property" }, "completions": { "$ref": "#/definitions/completions-property" }, "dependencies": { "$ref": "#/definitions/dependencies-property" }, "extensible": { "$ref": "#/definitions/root-extensible-property" }, "filename": { "$ref": "#/definitions/filename-property" }, "argfile": { "$ref": "#/definitions/argfile-property" }, "filters": { "$ref": "#/definitions/filters-property" }, "function": { "$ref": "#/definitions/function-property" } }, "patternProperties": { "^x_.": { "title": "custom property", "description": "A custom property of any type", "examples": [ "Anything" ] } }, "additionalProperties": false }