{
  "name": "pre-commit",
  "description": "Pre-commit",
  "options": [
    {
      "names": [
        "-h",
        "--help"
      ],
      "description": "Show help message and exit"
    },
    {
      "names": [
        "-V",
        "--version"
      ],
      "description": "Show program's version number and exit"
    }
  ],
  "args": [
    {}
  ],
  "subcommands": [
    {
      "name": "autoupdate",
      "description": "Auto-update pre-commit config to the latest repos' versions",
      "options": [
        {
          "names": [
            "-h",
            "--help"
          ],
          "description": "Show help message and exit"
        },
        {
          "names": [
            "--color"
          ],
          "description": "Whether to use color in output. Defaults to `auto`",
          "args": [
            {
              "name": "color",
              "suggestions": [
                "auto",
                "always",
                "never"
              ]
            }
          ]
        },
        {
          "names": [
            "--config",
            "-c"
          ],
          "description": "Path to alternate config file",
          "args": [
            {
              "name": "CONFIG",
              "template": "filepaths"
            }
          ]
        },
        {
          "names": [
            "--bleeding-edge"
          ],
          "description": "Update to the bleeding edge of `master` instead of the latest tagged version (the default behavior)"
        },
        {
          "names": [
            "--freeze"
          ],
          "description": "Store 'frozen' hashes in `rev` instead of tag names"
        },
        {
          "names": [
            "--repo"
          ],
          "description": "Only update this repository -- may be specified multiple times",
          "isRepeatable": -1,
          "args": [
            {
              "name": "REPO"
            }
          ]
        }
      ]
    },
    {
      "name": "clean",
      "description": "Clean out pre-commit files",
      "options": [
        {
          "names": [
            "-h",
            "--help"
          ],
          "description": "Show help message and exit"
        },
        {
          "names": [
            "--color"
          ],
          "description": "Whether to use color in output. Defaults to `auto`",
          "args": [
            {
              "name": "color",
              "suggestions": [
                "auto",
                "always",
                "never"
              ]
            }
          ]
        },
        {
          "names": [
            "--config",
            "-c"
          ],
          "description": "Path to alternate config file",
          "args": [
            {
              "name": "CONFIG",
              "template": "filepaths"
            }
          ]
        }
      ]
    },
    {
      "name": "gc",
      "description": "Clean unused cached repos",
      "options": [
        {
          "names": [
            "-h",
            "--help"
          ],
          "description": "Show help message and exit"
        },
        {
          "names": [
            "--color"
          ],
          "description": "Whether to use color in output. Defaults to `auto`",
          "args": [
            {
              "name": "color",
              "suggestions": [
                "auto",
                "always",
                "never"
              ]
            }
          ]
        },
        {
          "names": [
            "--config",
            "-c"
          ],
          "description": "Path to alternate config file",
          "args": [
            {
              "name": "CONFIG",
              "template": "filepaths"
            }
          ]
        }
      ]
    },
    {
      "name": "init-templatedir",
      "description": "Install hook script in a directory intended for use with `git config init.templateDir`",
      "options": [
        {
          "names": [
            "-h",
            "--help"
          ],
          "description": "Show help message and exit"
        },
        {
          "names": [
            "--color"
          ],
          "description": "Whether to use color in output. Defaults to `auto`",
          "args": [
            {
              "name": "color",
              "suggestions": [
                "auto",
                "always",
                "never"
              ]
            }
          ]
        },
        {
          "names": [
            "--config",
            "-c"
          ],
          "description": "Path to alternate config file",
          "args": [
            {
              "name": "CONFIG",
              "template": "filepaths"
            }
          ]
        },
        {
          "names": [
            "-t",
            "--hook-type"
          ],
          "description": "Type of hook to install",
          "args": [
            {
              "name": "HOOK_TYPE",
              "suggestions": [
                "pre-commit",
                "pre-merge-commit",
                "pre-push",
                "prepare-commit-msg",
                "commit-msg",
                "post-commit",
                "post-checkout",
                "post-merge",
                "post-rewrite"
              ]
            }
          ]
        },
        {
          "names": [
            "--no-allow-missing-config"
          ],
          "description": "Assume cloned repos should have a `pre-commit` config"
        }
      ]
    },
    {
      "name": "install",
      "description": "Install the pre-commit script",
      "options": [
        {
          "names": [
            "-h",
            "--help"
          ],
          "description": "Show help message and exit"
        },
        {
          "names": [
            "--color"
          ],
          "description": "Whether to use color in output. Defaults to `auto`",
          "args": [
            {
              "name": "color",
              "suggestions": [
                "auto",
                "always",
                "never"
              ]
            }
          ]
        },
        {
          "names": [
            "--config",
            "-c"
          ],
          "description": "Path to alternate config file",
          "args": [
            {
              "name": "CONFIG",
              "template": "filepaths"
            }
          ]
        },
        {
          "names": [
            "-f",
            "--overwrite"
          ],
          "description": "Overwrite existing hooks / remove migration mode"
        },
        {
          "names": [
            "install-hooks"
          ],
          "description": "Whether to install hook environments for all environments in the config file"
        },
        {
          "names": [
            "-t",
            "--hook-type"
          ],
          "description": "Type of hook to install",
          "args": [
            {
              "name": "HOOK_TYPE",
              "suggestions": [
                "pre-commit",
                "pre-merge-commit",
                "pre-push",
                "prepare-commit-msg",
                "commit-msg",
                "post-commit",
                "post-checkout",
                "post-merge",
                "post-rewrite"
              ]
            }
          ]
        },
        {
          "names": [
            "--allow-missing-config"
          ],
          "description": "Whether to allow a missing `pre-commit` configuration file or exit with a failure code"
        }
      ]
    },
    {
      "name": "migrate-config",
      "description": "Migrate list configuration to new map configuration",
      "options": [
        {
          "names": [
            "-h",
            "--help"
          ],
          "description": "Show help message and exit"
        },
        {
          "names": [
            "--color"
          ],
          "description": "Whether to use color in output. Defaults to `auto`",
          "args": [
            {
              "name": "color",
              "suggestions": [
                "auto",
                "always",
                "never"
              ]
            }
          ]
        },
        {
          "names": [
            "--config",
            "-c"
          ],
          "description": "Path to alternate config file",
          "args": [
            {
              "name": "CONFIG",
              "template": "filepaths"
            }
          ]
        }
      ]
    },
    {
      "name": "run",
      "description": "Run hooks",
      "options": [
        {
          "names": [
            "-h",
            "--help"
          ],
          "description": "Show help message and exit"
        },
        {
          "names": [
            "--color"
          ],
          "description": "Whether to use color in output. Defaults to `auto`",
          "args": [
            {
              "name": "color",
              "suggestions": [
                "auto",
                "always",
                "never"
              ]
            }
          ]
        },
        {
          "names": [
            "--config",
            "-c"
          ],
          "description": "Path to alternate config file",
          "args": [
            {
              "name": "CONFIG",
              "template": "filepaths"
            }
          ]
        },
        {
          "names": [
            "--verbose",
            "-v"
          ]
        },
        {
          "names": [
            "--all-files",
            "-a"
          ],
          "description": "Run all files in the repo"
        },
        {
          "names": [
            "--files"
          ],
          "description": "Specific filenames to run hooks on",
          "args": [
            {
              "name": "FILES",
              "isVariadic": true,
              "template": "filepaths"
            }
          ]
        },
        {
          "names": [
            "--show-diff-on-failure"
          ],
          "description": "When hooks fail, run `git diff` directly afterward"
        },
        {
          "names": [
            "--hook-stage"
          ],
          "description": "The stage during which the hook is fired",
          "args": [
            {
              "suggestions": [
                "pre-commit",
                "pre-merge-commit",
                "pre-push",
                "prepare-commit-msg",
                "commit-msg",
                "post-commit",
                "post-checkout",
                "post-merge",
                "post-rewrite"
              ]
            }
          ]
        },
        {
          "names": [
            "--remote-branch"
          ],
          "description": "Remote branch ref used by `git push`",
          "args": [
            {
              "name": "REMOTE_BRANCH",
              "generators": [
                {
                  "script": [
                    "git",
                    "--no-optional-locks",
                    "branch",
                    "-a",
                    "--no-color",
                    "--sort=-committerdate"
                  ]
                }
              ]
            }
          ]
        },
        {
          "names": [
            "--local-branch"
          ],
          "description": "Local branch ref used by `git push`",
          "args": [
            {
              "name": "LOCAL_BRANCH",
              "generators": [
                {
                  "script": [
                    "git",
                    "--no-optional-locks",
                    "branch",
                    "--no-color",
                    "--sort=-committerdate"
                  ]
                }
              ]
            }
          ]
        },
        {
          "names": [
            "--from-ref",
            "--source",
            "-s"
          ],
          "description": "Represents the original ref in a `from_ref...to_ref` diff expression. For `pre-push` hooks, this represents the branch you are pushing to. For `post-checkout` hooks, this represents the branch that was previously checked out",
          "args": [
            {
              "name": "FROM_REF",
              "generators": [
                {
                  "script": [
                    "git",
                    "rev-list",
                    "--all",
                    "--oneline"
                  ]
                }
              ]
            }
          ]
        },
        {
          "names": [
            "--to-ref",
            "--origin",
            "-o"
          ],
          "description": "Represents the destination ref in a `from_ref...to_ref` diff expression. For `pre-push` hooks, this represents the branch being pushed. For `post-checkout` hooks, this represents the branch that is now checked out",
          "args": [
            {
              "name": "TO_REF",
              "generators": [
                {
                  "script": [
                    "git",
                    "rev-list",
                    "--all",
                    "--oneline"
                  ]
                }
              ]
            }
          ]
        },
        {
          "names": [
            "--commit-msg-filename"
          ],
          "description": "Filename to check when running during `commit-msg`",
          "args": [
            {
              "name": "COMMIT_MSG_FILENAME"
            }
          ]
        },
        {
          "names": [
            "--remote-name"
          ],
          "description": "Remote name used by `git push`",
          "args": [
            {
              "name": "REMOTE_NAME",
              "generators": [
                {
                  "script": [
                    "git",
                    "--no-optional-locks",
                    "remote",
                    "-v"
                  ]
                }
              ]
            }
          ]
        },
        {
          "names": [
            "--remote-url"
          ],
          "description": "Remote URL used by `git push`",
          "args": [
            {
              "name": "REMOTE_URL"
            }
          ]
        },
        {
          "names": [
            "--checkout-type"
          ],
          "description": "Indicates whether the checkout was a branch checkout (changing branches, flag=1) or a file checkout (retrieving a file from the index, flag=0)",
          "args": [
            {
              "name": "CHECKOUT_TYPE"
            }
          ]
        },
        {
          "names": [
            "--is-squash-merge"
          ],
          "description": "During a post-merge hook, indicates whether the merge was a squash merge",
          "args": [
            {
              "name": "IS_SQUASH_MERGE"
            }
          ]
        },
        {
          "names": [
            "--rewrite-command"
          ],
          "description": "During a post-rewrite hook, specifies the command that invoked the rewrite",
          "args": [
            {
              "name": "REWRITE_COMMAND"
            }
          ]
        }
      ],
      "args": [
        {
          "name": "hook",
          "description": "A single hook-id to run",
          "isOptional": true,
          "generators": [
            {
              "script": [
                "cat",
                ".pre-commit-config.yaml"
              ]
            }
          ]
        }
      ]
    },
    {
      "name": "sample-config",
      "description": "Produce a sample .pre-commit-config.yaml file",
      "options": [
        {
          "names": [
            "-h",
            "--help"
          ],
          "description": "Show help message and exit"
        },
        {
          "names": [
            "--color"
          ],
          "description": "Whether to use color in output. Defaults to `auto`",
          "args": [
            {
              "name": "color",
              "suggestions": [
                "auto",
                "always",
                "never"
              ]
            }
          ]
        },
        {
          "names": [
            "--config",
            "-c"
          ],
          "description": "Path to alternate config file",
          "args": [
            {
              "name": "CONFIG",
              "template": "filepaths"
            }
          ]
        }
      ]
    },
    {
      "name": "try-repo",
      "description": "Try the hooks in a repository, useful for developing new hooks",
      "options": [
        {
          "names": [
            "-h",
            "--help"
          ],
          "description": "Show help message and exit"
        },
        {
          "names": [
            "--color"
          ],
          "description": "Whether to use color in output. Defaults to `auto`",
          "args": [
            {
              "name": "color",
              "suggestions": [
                "auto",
                "always",
                "never"
              ]
            }
          ]
        },
        {
          "names": [
            "--config",
            "-c"
          ],
          "description": "Path to alternate config file",
          "args": [
            {
              "name": "CONFIG",
              "template": "filepaths"
            }
          ]
        },
        {
          "names": [
            "--verbose",
            "-v"
          ]
        },
        {
          "names": [
            "--all-files",
            "-a"
          ],
          "description": "Run all files in the repo"
        },
        {
          "names": [
            "--files"
          ],
          "description": "Specific filenames to run hooks on",
          "args": [
            {
              "name": "FILES",
              "isVariadic": true,
              "template": "filepaths"
            }
          ]
        },
        {
          "names": [
            "--show-diff-on-failure"
          ],
          "description": "When hooks fail, run `git diff` directly afterward"
        },
        {
          "names": [
            "--hook-stage"
          ],
          "description": "The stage during which the hook is fired",
          "args": [
            {
              "suggestions": [
                "pre-commit",
                "pre-merge-commit",
                "pre-push",
                "prepare-commit-msg",
                "commit-msg",
                "post-commit",
                "post-checkout",
                "post-merge",
                "post-rewrite"
              ]
            }
          ]
        },
        {
          "names": [
            "--remote-branch"
          ],
          "description": "Remote branch ref used by `git push`",
          "args": [
            {
              "name": "REMOTE_BRANCH",
              "generators": [
                {
                  "script": [
                    "git",
                    "--no-optional-locks",
                    "branch",
                    "-a",
                    "--no-color",
                    "--sort=-committerdate"
                  ]
                }
              ]
            }
          ]
        },
        {
          "names": [
            "--local-branch"
          ],
          "description": "Local branch ref used by `git push`",
          "args": [
            {
              "name": "LOCAL_BRANCH",
              "generators": [
                {
                  "script": [
                    "git",
                    "--no-optional-locks",
                    "branch",
                    "--no-color",
                    "--sort=-committerdate"
                  ]
                }
              ]
            }
          ]
        },
        {
          "names": [
            "--from-ref",
            "--source",
            "-s"
          ],
          "description": "Represents the original ref in a `from_ref...to_ref` diff expression. For `pre-push` hooks, this represents the branch you are pushing to. For `post-checkout` hooks, this represents the branch that was previously checked out",
          "args": [
            {
              "name": "FROM_REF",
              "generators": [
                {
                  "script": [
                    "git",
                    "rev-list",
                    "--all",
                    "--oneline"
                  ]
                }
              ]
            }
          ]
        },
        {
          "names": [
            "--to-ref",
            "--origin",
            "-o"
          ],
          "description": "Represents the destination ref in a `from_ref...to_ref` diff expression. For `pre-push` hooks, this represents the branch being pushed. For `post-checkout` hooks, this represents the branch that is now checked out",
          "args": [
            {
              "name": "TO_REF",
              "generators": [
                {
                  "script": [
                    "git",
                    "rev-list",
                    "--all",
                    "--oneline"
                  ]
                }
              ]
            }
          ]
        },
        {
          "names": [
            "--commit-msg-filename"
          ],
          "description": "Filename to check when running during `commit-msg`",
          "args": [
            {
              "name": "COMMIT_MSG_FILENAME"
            }
          ]
        },
        {
          "names": [
            "--remote-name"
          ],
          "description": "Remote name used by `git push`",
          "args": [
            {
              "name": "REMOTE_NAME",
              "generators": [
                {
                  "script": [
                    "git",
                    "--no-optional-locks",
                    "remote",
                    "-v"
                  ]
                }
              ]
            }
          ]
        },
        {
          "names": [
            "--remote-url"
          ],
          "description": "Remote URL used by `git push`",
          "args": [
            {
              "name": "REMOTE_URL"
            }
          ]
        },
        {
          "names": [
            "--checkout-type"
          ],
          "description": "Indicates whether the checkout was a branch checkout (changing branches, flag=1) or a file checkout (retrieving a file from the index, flag=0)",
          "args": [
            {
              "name": "CHECKOUT_TYPE"
            }
          ]
        },
        {
          "names": [
            "--is-squash-merge"
          ],
          "description": "During a post-merge hook, indicates whether the merge was a squash merge",
          "args": [
            {
              "name": "IS_SQUASH_MERGE"
            }
          ]
        },
        {
          "names": [
            "--rewrite-command"
          ],
          "description": "During a post-rewrite hook, specifies the command that invoked the rewrite",
          "args": [
            {
              "name": "REWRITE_COMMAND"
            }
          ]
        },
        {
          "names": [
            "--ref",
            "--rev"
          ],
          "description": "Manually select a rev to run against, otherwise the `HEAD` revision will be used",
          "args": [
            {
              "name": "REV"
            }
          ]
        }
      ],
      "args": [
        {
          "name": "repo",
          "description": "Repository to source hooks from"
        },
        {
          "name": "hook",
          "description": "A single hook-id to run",
          "isOptional": true,
          "generators": [
            {
              "script": [
                "cat",
                ".pre-commit-config.yaml"
              ]
            }
          ]
        }
      ]
    },
    {
      "name": "uninstall",
      "description": "Uninstall the pre-commit script",
      "options": [
        {
          "names": [
            "-h",
            "--help"
          ],
          "description": "Show help message and exit"
        },
        {
          "names": [
            "--color"
          ],
          "description": "Whether to use color in output. Defaults to `auto`",
          "args": [
            {
              "name": "color",
              "suggestions": [
                "auto",
                "always",
                "never"
              ]
            }
          ]
        },
        {
          "names": [
            "--config",
            "-c"
          ],
          "description": "Path to alternate config file",
          "args": [
            {
              "name": "CONFIG",
              "template": "filepaths"
            }
          ]
        },
        {
          "names": [
            "-t",
            "--hook-type"
          ],
          "description": "Type of hook to install",
          "args": [
            {
              "name": "HOOK_TYPE",
              "suggestions": [
                "pre-commit",
                "pre-merge-commit",
                "pre-push",
                "prepare-commit-msg",
                "commit-msg",
                "post-commit",
                "post-checkout",
                "post-merge",
                "post-rewrite"
              ]
            }
          ]
        }
      ]
    },
    {
      "name": "help",
      "description": "Show help for a specific command",
      "options": [
        {
          "names": [
            "-h",
            "--help"
          ],
          "description": "Show help message and exit"
        },
        {
          "names": [
            "--color"
          ],
          "description": "Whether to use color in output. Defaults to `auto`",
          "args": [
            {
              "name": "color",
              "suggestions": [
                "auto",
                "always",
                "never"
              ]
            }
          ]
        },
        {
          "names": [
            "--config",
            "-c"
          ],
          "description": "Path to alternate config file",
          "args": [
            {
              "name": "CONFIG",
              "template": "filepaths"
            }
          ]
        }
      ]
    }
  ]
}
