{
  "id": "pre-commit",
  "name": "pre-commit",
  "description": "Framework for managing and running multi-language Git hooks.",
  "homepage": "https://pre-commit.com",
  "executables": [
    "pre-commit"
  ],
  "commands": {
    "format": 1,
    "label": "pre-commit",
    "description": "Run hooks, install the Git hook script or update hook versions. Other subcommands and stage-specific ref options are not covered.",
    "quality": "ai-draft",
    "base": "fig:pre-commit",
    "parser": {
      "end_of_options": "--",
      "interleave": "permute",
      "long_equals": true,
      "short_attached": true,
      "short_bundles": false
    },
    "source": [
      {
        "id": "fig",
        "kind": "completion",
        "url": "https://github.com/withfig/autocomplete/blob/master/src/pre-commit.ts",
        "license": "MIT"
      }
    ],
    "subcommand": [
      {
        "path": [
          "run"
        ],
        "label": "Run hooks",
        "description": "Run configured hooks on staged files, all files or a chosen file list.",
        "source": [
          {
            "id": "fig",
            "kind": "completion",
            "url": "https://github.com/withfig/autocomplete/blob/master/src/pre-commit.ts",
            "license": "MIT"
          }
        ],
        "field": [
          {
            "id": "hook",
            "label": "Hook id",
            "description": "Run only this hook; leave empty to run all.",
            "type": "string",
            "position": 0,
            "sources": [
              "fig"
            ]
          },
          {
            "id": "all_files",
            "label": "All files",
            "type": "boolean",
            "option": [
              "--all-files",
              "-a"
            ],
            "sources": [
              "fig"
            ]
          },
          {
            "id": "files",
            "label": "Specific files",
            "type": "path",
            "option": [
              "--files"
            ],
            "multiple": true,
            "path": {
              "kind": "file",
              "role": "input"
            },
            "sources": [
              "fig"
            ]
          },
          {
            "id": "show_diff",
            "label": "Show diff on failure",
            "type": "boolean",
            "option": [
              "--show-diff-on-failure"
            ],
            "sources": [
              "fig"
            ]
          },
          {
            "id": "verbose",
            "label": "Verbose",
            "type": "boolean",
            "option": [
              "--verbose",
              "-v"
            ],
            "sources": [
              "fig"
            ]
          },
          {
            "id": "config",
            "label": "Config file",
            "type": "path",
            "option": [
              "--config",
              "-c"
            ],
            "path": {
              "kind": "file",
              "role": "input"
            },
            "sources": [
              "fig"
            ]
          },
          {
            "id": "hook_stage",
            "label": "Hook stage",
            "type": "enum",
            "option": [
              "--hook-stage"
            ],
            "choices": [
              {
                "value": "pre-commit",
                "label": "pre-commit"
              },
              {
                "value": "pre-merge-commit",
                "label": "pre-merge-commit"
              },
              {
                "value": "pre-push",
                "label": "pre-push"
              },
              {
                "value": "prepare-commit-msg",
                "label": "prepare-commit-msg"
              },
              {
                "value": "commit-msg",
                "label": "commit-msg"
              },
              {
                "value": "post-commit",
                "label": "post-commit"
              },
              {
                "value": "post-checkout",
                "label": "post-checkout"
              },
              {
                "value": "post-merge",
                "label": "post-merge"
              },
              {
                "value": "post-rewrite",
                "label": "post-rewrite"
              }
            ],
            "sources": [
              "fig"
            ]
          }
        ],
        "task": [
          {
            "id": "all",
            "label": "Run on all files",
            "set": {
              "all_files": [
                true
              ],
              "show_diff": [
                true
              ]
            },
            "fields": [
              "hook",
              "all_files",
              "show_diff",
              "verbose"
            ],
            "required": []
          },
          {
            "id": "staged",
            "label": "Run on staged files",
            "fields": [
              "hook",
              "verbose",
              "show_diff"
            ],
            "required": []
          }
        ],
        "group": [
          {
            "id": "basic",
            "label": "Basic",
            "fields": [
              "hook",
              "all_files",
              "files",
              "show_diff",
              "verbose"
            ]
          },
          {
            "id": "advanced",
            "label": "Advanced",
            "fields": [
              "config",
              "hook_stage"
            ]
          }
        ]
      },
      {
        "path": [
          "install"
        ],
        "label": "Install Git hook",
        "description": "Install the pre-commit script into the repository's .git/hooks.",
        "source": [
          {
            "id": "fig",
            "kind": "completion",
            "url": "https://github.com/withfig/autocomplete/blob/master/src/pre-commit.ts",
            "license": "MIT"
          }
        ],
        "field": [
          {
            "id": "hook_type",
            "label": "Hook type",
            "type": "enum",
            "option": [
              "--hook-type",
              "-t"
            ],
            "choices": [
              {
                "value": "pre-commit",
                "label": "pre-commit"
              },
              {
                "value": "pre-merge-commit",
                "label": "pre-merge-commit"
              },
              {
                "value": "pre-push",
                "label": "pre-push"
              },
              {
                "value": "prepare-commit-msg",
                "label": "prepare-commit-msg"
              },
              {
                "value": "commit-msg",
                "label": "commit-msg"
              },
              {
                "value": "post-commit",
                "label": "post-commit"
              },
              {
                "value": "post-checkout",
                "label": "post-checkout"
              },
              {
                "value": "post-merge",
                "label": "post-merge"
              },
              {
                "value": "post-rewrite",
                "label": "post-rewrite"
              }
            ],
            "sources": [
              "fig"
            ]
          },
          {
            "id": "overwrite",
            "label": "Overwrite existing hooks",
            "type": "boolean",
            "option": [
              "--overwrite",
              "-f"
            ],
            "effect": "overwrite",
            "sources": [
              "fig"
            ]
          },
          {
            "id": "config",
            "label": "Config file",
            "type": "path",
            "option": [
              "--config",
              "-c"
            ],
            "path": {
              "kind": "file",
              "role": "input"
            },
            "sources": [
              "fig"
            ]
          },
          {
            "id": "allow_missing",
            "label": "Allow missing config",
            "type": "boolean",
            "option": [
              "--allow-missing-config"
            ],
            "sources": [
              "fig"
            ]
          }
        ],
        "task": [
          {
            "id": "install",
            "label": "Install hook",
            "fields": [
              "hook_type",
              "overwrite",
              "config",
              "allow_missing"
            ],
            "required": []
          }
        ],
        "group": [
          {
            "id": "basic",
            "label": "Basic",
            "fields": [
              "hook_type",
              "overwrite",
              "config",
              "allow_missing"
            ]
          }
        ]
      },
      {
        "path": [
          "autoupdate"
        ],
        "label": "Update hook versions",
        "description": "Update the repos in the config to their latest versions.",
        "source": [
          {
            "id": "fig",
            "kind": "completion",
            "url": "https://github.com/withfig/autocomplete/blob/master/src/pre-commit.ts",
            "license": "MIT"
          }
        ],
        "field": [
          {
            "id": "freeze",
            "label": "Freeze to hashes",
            "type": "boolean",
            "option": [
              "--freeze"
            ],
            "sources": [
              "fig"
            ]
          },
          {
            "id": "bleeding_edge",
            "label": "Bleeding edge of master",
            "type": "boolean",
            "option": [
              "--bleeding-edge"
            ],
            "sources": [
              "fig"
            ]
          },
          {
            "id": "repo",
            "label": "Only this repo",
            "type": "string",
            "option": [
              "--repo"
            ],
            "multiple": true,
            "sources": [
              "fig"
            ]
          },
          {
            "id": "config",
            "label": "Config file",
            "type": "path",
            "option": [
              "--config",
              "-c"
            ],
            "path": {
              "kind": "file",
              "role": "input"
            },
            "sources": [
              "fig"
            ]
          }
        ],
        "task": [
          {
            "id": "update",
            "label": "Update",
            "fields": [
              "freeze",
              "bleeding_edge",
              "repo",
              "config"
            ],
            "required": []
          }
        ],
        "group": [
          {
            "id": "basic",
            "label": "Basic",
            "fields": [
              "freeze",
              "bleeding_edge",
              "repo",
              "config"
            ]
          }
        ]
      }
    ]
  }
}
