{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://json.schemastore.org/lefthook.json", "$defs": { "Command": { "properties": { "run": { "type": "string" }, "files": { "type": "string" }, "root": { "type": "string" }, "fail_text": { "type": "string" }, "timeout": { "type": "string", "examples": [ "15s" ] }, "skip": { "oneOf": [ { "type": "boolean" }, { "type": "array" } ] }, "only": { "oneOf": [ { "type": "boolean" }, { "type": "array" } ] }, "tags": { "oneOf": [ { "type": "string" }, { "type": "array" } ], "items": { "type": "string" } }, "file_types": { "oneOf": [ { "type": "string" }, { "type": "array" } ], "items": { "type": "string" } }, "glob": { "oneOf": [ { "type": "string" }, { "type": "array" } ], "items": { "type": "string" } }, "exclude": { "oneOf": [ { "type": "string" }, { "type": "array" } ], "items": { "type": "string" } }, "env": { "additionalProperties": { "type": "string" }, "type": "object" }, "priority": { "type": "integer" }, "interactive": { "type": "boolean" }, "use_stdin": { "type": "boolean" }, "stage_fixed": { "type": "boolean" } }, "additionalProperties": false, "type": "object", "required": [ "run" ] }, "Group": { "properties": { "root": { "type": "string" }, "parallel": { "type": "boolean" }, "piped": { "type": "boolean" }, "jobs": { "items": { "$ref": "#/$defs/Job" }, "type": "array" } }, "additionalProperties": false, "type": "object", "required": [ "jobs" ] }, "Hook": { "properties": { "parallel": { "type": "boolean" }, "piped": { "type": "boolean" }, "follow": { "type": "boolean" }, "fail_on_changes": { "type": "string", "enum": [ "true", "1", "0", "false", "never", "always", "ci", "non-ci" ] }, "fail_on_changes_diff": { "type": "boolean" }, "files": { "type": "string" }, "exclude_tags": { "items": { "type": "string" }, "type": "array" }, "exclude": { "items": { "type": "string" }, "type": "array" }, "skip": { "oneOf": [ { "type": "boolean" }, { "type": "array" } ] }, "only": { "oneOf": [ { "type": "boolean" }, { "type": "array" } ] }, "setup": { "items": { "$ref": "#/$defs/SetupInstruction" }, "type": "array" }, "jobs": { "items": { "$ref": "#/$defs/Job" }, "type": "array" }, "commands": { "additionalProperties": { "$ref": "#/$defs/Command" }, "type": "object" }, "scripts": { "additionalProperties": { "$ref": "#/$defs/Script" }, "type": "object" } }, "additionalProperties": false, "type": "object" }, "Job": { "oneOf": [ { "required": [ "run" ], "title": "Run a command" }, { "required": [ "script" ], "title": "Run a script" }, { "required": [ "group" ], "title": "Run a group" } ], "properties": { "name": { "type": "string" }, "run": { "type": "string" }, "script": { "type": "string" }, "runner": { "type": "string" }, "args": { "type": "string" }, "root": { "type": "string" }, "files": { "type": "string" }, "fail_text": { "type": "string" }, "timeout": { "type": "string", "examples": [ "15s" ] }, "glob": { "oneOf": [ { "type": "string" }, { "type": "array" } ], "items": { "type": "string" } }, "exclude": { "oneOf": [ { "type": "string" }, { "type": "array" } ], "items": { "type": "string" } }, "tags": { "items": { "type": "string" }, "type": "array" }, "file_types": { "oneOf": [ { "type": "string" }, { "type": "array" } ], "items": { "type": "string" } }, "env": { "additionalProperties": { "type": "string" }, "type": "object" }, "interactive": { "type": "boolean" }, "use_stdin": { "type": "boolean" }, "stage_fixed": { "type": "boolean" }, "skip": { "oneOf": [ { "type": "boolean" }, { "type": "array" } ] }, "only": { "oneOf": [ { "type": "boolean" }, { "type": "array" } ] }, "group": { "$ref": "#/$defs/Group" } }, "additionalProperties": false, "type": "object" }, "Remote": { "properties": { "git_url": { "type": "string", "description": "A URL to Git repository. It will be accessed with privileges of the machine lefthook runs on." }, "ref": { "type": "string", "description": "An optional *branch* or *tag* name" }, "configs": { "items": { "type": "string" }, "type": "array", "description": "An optional array of config paths from remote's root", "default": [ "lefthook.yml" ] }, "refetch": { "type": "boolean", "description": "Set to true if you want to always refetch the remote" }, "refetch_frequency": { "type": "string", "description": "Provide a frequency for the remotes refetches", "examples": [ "24h" ] } }, "additionalProperties": false, "type": "object" }, "Script": { "properties": { "runner": { "type": "string" }, "args": { "type": "string" }, "skip": { "oneOf": [ { "type": "boolean" }, { "type": "array" } ] }, "only": { "oneOf": [ { "type": "boolean" }, { "type": "array" } ] }, "tags": { "oneOf": [ { "type": "string" }, { "type": "array" } ], "items": { "type": "string" } }, "env": { "additionalProperties": { "type": "string" }, "type": "object" }, "priority": { "type": "integer" }, "fail_text": { "type": "string" }, "timeout": { "type": "string", "examples": [ "15s" ] }, "interactive": { "type": "boolean" }, "use_stdin": { "type": "boolean" }, "stage_fixed": { "type": "boolean" } }, "additionalProperties": false, "type": "object" }, "SetupInstruction": { "oneOf": [ { "required": [ "run" ], "title": "Run a command" } ], "properties": { "run": { "type": "string" } }, "additionalProperties": false, "type": "object" } }, "$comment": "Last updated on 2026.02.28.", "properties": { "min_version": { "type": "string", "description": "Specify a minimum version for the lefthook binary" }, "lefthook": { "type": "string", "description": "Lefthook executable path or command" }, "source_dir": { "type": "string", "description": "Change a directory for script files. Directory for script files contains folders with git hook names which contain script files.", "default": ".lefthook/" }, "source_dir_local": { "type": "string", "description": "Change a directory for local script files (not stored in VCS)", "default": ".lefthook-local/" }, "rc": { "type": "string", "description": "Provide an rc file - a simple sh script" }, "output": { "oneOf": [ { "type": "boolean" }, { "type": "array" } ], "description": "Manage verbosity by skipping the printing of output of some steps" }, "colors": { "oneOf": [ { "type": "boolean" }, { "type": "object" } ], "description": "Enable disable or set your own colors for lefthook output" }, "extends": { "items": { "type": "string" }, "type": "array", "description": "Specify files to extend config with" }, "no_tty": { "type": "boolean", "description": "Whether hide spinner and other interactive things" }, "assert_lefthook_installed": { "type": "boolean" }, "skip_lfs": { "type": "boolean", "description": "Skip running Git LFS hooks (enabled by default)" }, "no_auto_install": { "type": "boolean", "description": "Do not automatically install hooks when running lefthook" }, "install_non_git_hooks": { "type": "boolean", "description": "Install non-Git hooks to .git/hooks" }, "glob_matcher": { "type": "string", "enum": [ "gobwas", "doublestar" ], "description": "Choose the glob matching engine: 'gobwas' (default) or 'doublestar' (standard ** behavior)", "default": "gobwas" }, "remotes": { "items": { "$ref": "#/$defs/Remote" }, "type": "array", "description": "Provide multiple remote configs to use lefthook configurations shared across projects. Lefthook will automatically download and merge configurations into main config." }, "templates": { "additionalProperties": { "type": "string" }, "type": "object", "description": "Custom templates for replacements in run commands." }, "$schema": { "type": "string" }, "pre-commit": { "$ref": "#/$defs/Hook" }, "applypatch-msg": { "$ref": "#/$defs/Hook" }, "pre-applypatch": { "$ref": "#/$defs/Hook" }, "post-applypatch": { "$ref": "#/$defs/Hook" }, "pre-merge-commit": { "$ref": "#/$defs/Hook" }, "prepare-commit-msg": { "$ref": "#/$defs/Hook" }, "commit-msg": { "$ref": "#/$defs/Hook" }, "post-commit": { "$ref": "#/$defs/Hook" }, "pre-rebase": { "$ref": "#/$defs/Hook" }, "post-checkout": { "$ref": "#/$defs/Hook" }, "post-merge": { "$ref": "#/$defs/Hook" }, "pre-push": { "$ref": "#/$defs/Hook" }, "pre-receive": { "$ref": "#/$defs/Hook" }, "update": { "$ref": "#/$defs/Hook" }, "proc-receive": { "$ref": "#/$defs/Hook" }, "post-receive": { "$ref": "#/$defs/Hook" }, "post-update": { "$ref": "#/$defs/Hook" }, "reference-transaction": { "$ref": "#/$defs/Hook" }, "push-to-checkout": { "$ref": "#/$defs/Hook" }, "pre-auto-gc": { "$ref": "#/$defs/Hook" }, "post-rewrite": { "$ref": "#/$defs/Hook" }, "sendemail-validate": { "$ref": "#/$defs/Hook" }, "fsmonitor-watchman": { "$ref": "#/$defs/Hook" }, "p4-changelist": { "$ref": "#/$defs/Hook" }, "p4-prepare-changelist": { "$ref": "#/$defs/Hook" }, "p4-post-changelist": { "$ref": "#/$defs/Hook" }, "p4-pre-submit": { "$ref": "#/$defs/Hook" }, "post-index-change": { "$ref": "#/$defs/Hook" } }, "additionalProperties": { "properties": { "parallel": { "type": "boolean" }, "piped": { "type": "boolean" }, "follow": { "type": "boolean" }, "fail_on_changes": { "type": "string", "enum": [ "true", "1", "0", "false", "never", "always", "ci", "non-ci" ] }, "fail_on_changes_diff": { "type": "boolean" }, "files": { "type": "string" }, "exclude_tags": { "items": { "type": "string" }, "type": "array" }, "exclude": { "items": { "type": "string" }, "type": "array" }, "skip": { "oneOf": [ { "type": "boolean" }, { "type": "array" } ] }, "only": { "oneOf": [ { "type": "boolean" }, { "type": "array" } ] }, "setup": { "items": { "$ref": "#/$defs/SetupInstruction" }, "type": "array" }, "jobs": { "items": { "$ref": "#/$defs/Job" }, "type": "array" }, "commands": { "additionalProperties": { "$ref": "#/$defs/Command" }, "type": "object" }, "scripts": { "additionalProperties": { "$ref": "#/$defs/Script" }, "type": "object" } }, "additionalProperties": false, "type": "object" }, "type": "object" }