// @generated by usage-cli from clap metadata
min_usage_version "4.0"
name hk
bin hk
version "1.55.0"
about "A tool for managing git hooks"
usage "Usage: hk [OPTIONS] <COMMAND>"
flag --cd help="Run as if hk was started in this directory" global=#true {
    arg <DIRECTORY>
}
flag --format help="Select human or machine-readable execution output" default=human {
    arg <FORMAT> {
        choices human json jsonl
    }
}
flag --hkrc help="Path to user configuration file (deprecated: use ~/.config/hk/config.pkl or hk.local.pkl)" hide=#true global=#true {
    arg <PATH>
}
flag "-j --jobs" help="Number of jobs to run in parallel" global=#true {
    arg <JOBS>
}
flag "-p --profile" help="Profiles to enable/disable prefix with ! to disable e.g. --profile slow --profile !fast" var=#true global=#true {
    arg <PROFILE>
}
flag "-s --slow" help="Shorthand for --profile=slow" global=#true
flag "-v --verbose" help="Enables verbose output" var=#true global=#true count=#true
flag "-n --no-progress" help="Disables progress output" global=#true
flag "-q --quiet" help="Suppresses non-essential output (info messages, progress indicators). Failed-step diagnostics are still shown" global=#true
flag --silent help="Suppresses all output including warnings. Only errors are shown" global=#true
flag --trace help="Enable tracing spans and performance diagnostics" global=#true
flag --json help="Output in JSON format" global=#true
cmd agent subcommand_required=#true help="Generate integration snippets for coding agents" effect=read {
    cmd hooks help="Print a hook configuration for an agent or editor" effect=read {
        flag --target required=#true {
            arg <TARGET> {
                choices codex claude-code vscode
            }
        }
    }
    cmd instructions help="Print project instructions for a coding agent" effect=read {
        flag --target required=#true {
            arg <TARGET> {
                choices codex claude-code generic
            }
        }
    }
    cmd mcp help="Print an MCP server configuration" effect=read {
        flag --target required=#true {
            arg <TARGET> {
                choices codex claude-desktop claude-code vscode
            }
        }
    }
}
cmd builtins help="Lists all available builtin linters" effect=read
cmd cache hide=#true subcommand_required=#true help="Manage hk internal cache" effect=read {
    cmd clear help="Clear the cache directory" effect=write
}
cmd check help="Checks code" {
    alias c
    flag "-a --all" help="Run on all files instead of just staged files"
    flag "-c --check" help="Run check command instead of fix command"
    flag "-e --exclude" help="Exclude files that otherwise would have been selected" var=#true {
        arg <EXCLUDE>
    }
    flag "-f --fix" help="Run fix command instead of check command (this is the default behavior unless HK_FIX=0)"
    flag "-g --glob" help="Run on files that match these glob patterns" var=#true {
        arg <GLOB>
    }
    flag "-J --json" help="Output the plan as JSON when combined with --plan or --why"
    flag "-P --plan" help="Print the plan instead of running the hook"
    flag "-S --step" help="Run only specific step(s)" var=#true {
        arg <STEP>
    }
    flag "-W --why" help="Show detailed reasons for inclusion/exclusion. Pass a step name to focus on one step, or omit the value to show reasons for all steps. Implies --plan" {
        arg <STEP>
    }
    flag --fail-fast help="Abort on first failure"
    flag --files0-from help="Read the exact file list from a NUL-delimited file, or from stdin with `-` (except hooks that reserve stdin)" {
        arg <PATH>
    }
    flag --format help="Select human or machine-readable execution output" {
        arg <FORMAT> {
            choices human json jsonl
        }
    }
    flag --from-hook help="Invoked by an installed git hook — gracefully exit 0 when no hk.pkl is present or the event isn't defined. Set automatically by `hk install`" hide=#true
    flag --from-ref help="Start reference for checking files (requires --to-ref)" {
        arg <FROM_REF>
    }
    flag --no-fail-fast help="Continue on failures (opposite of --fail-fast)"
    flag --no-stage help="Disable auto-staging of fixed files"
    flag --pr help="Check only files changed in the current PR/branch (shortcut for --from-ref DEFAULT_BRANCH --to-ref HEAD)"
    flag --safe help="Reject commands with unknown or destructive effects before execution"
    flag --sarif help="Write normalized diagnostics as SARIF" {
        arg <PATH>
    }
    flag --skip-step help="Skip specific step(s)" var=#true {
        arg <STEP>
    }
    flag --stage help="Enable auto-staging of fixed files"
    flag --staged help="Run on staged files only without stashing unstaged changes"
    flag --stash help="Stash method to use for git hooks" {
        arg <STASH> {
            choices git patch-file none
        }
    }
    flag --stats help="Display statistics about files matching each step"
    flag --to-ref help="End reference for checking files (requires --from-ref)" {
        arg <TO_REF>
    }
    flag --unstaged help="Run on unstaged and untracked files only (excludes staged files), without stashing. Useful for linting files an agent just changed"
    arg "[FILES]…" help="Run on specific files" required=#false var=#true
}
cmd completion help="Generates shell completion scripts" effect=read {
    arg <SHELL> help="The shell to generate completion for"
}
cmd config help="Configuration introspection and management" effect=read {
    alias cfg
    long_help #"""
Configuration introspection and management

View and inspect hk's configuration from all sources. Configuration is merged from multiple sources in precedence order: CLI flags > Environment variables > Git config (local) > User config (.hkrc.pkl) > Git config (global) > Project config (hk.pkl) > Built-in defaults.
"""#
    cmd dump help="Print effective runtime settings (JSON format)" effect=read {
        long_help #"""
Print effective runtime settings (JSON format)

Shows the merged configuration from all sources including CLI flags, environment variables, git config, user config, and project config.
"""#
        flag --format help="Output format (json or toml)" default=json {
            arg <FORMAT> {
                choices json toml
            }
        }
    }
    cmd explain help="Explain where a configuration value comes from" effect=read {
        long_help #"""
Explain where a configuration value comes from

Shows the resolved value, its source (env/git/cli/default), and the full precedence chain showing all layers that could affect it.
"""#
        arg <KEY> help="Configuration key to explain"
    }
    cmd get help="Get a specific configuration value" effect=read {
        long_help #"""
Get a specific configuration value

Available keys: jobs, enabled_profiles, disabled_profiles, fail_fast, display_skip_reasons, warnings, exclude, skip_steps, skip_hooks, stage
"""#
        arg <KEY> help="Configuration key to retrieve" help_long=#"""
Configuration key to retrieve

Available keys: jobs, enabled_profiles, disabled_profiles, fail_fast, display_skip_reasons, warnings, exclude, skip_steps, skip_hooks, stage
"""#
    }
    cmd sources help="Show the configuration source precedence order" effect=read {
        long_help #"""
Show the configuration source precedence order

Lists all configuration sources in order of precedence to help understand where configuration values come from.
"""#
    }
}
cmd fix help="Fixes code" {
    alias f
    flag "-a --all" help="Run on all files instead of just staged files"
    flag "-c --check" help="Run check command instead of fix command"
    flag "-e --exclude" help="Exclude files that otherwise would have been selected" var=#true {
        arg <EXCLUDE>
    }
    flag "-f --fix" help="Run fix command instead of check command (this is the default behavior unless HK_FIX=0)"
    flag "-g --glob" help="Run on files that match these glob patterns" var=#true {
        arg <GLOB>
    }
    flag "-J --json" help="Output the plan as JSON when combined with --plan or --why"
    flag "-P --plan" help="Print the plan instead of running the hook"
    flag "-S --step" help="Run only specific step(s)" var=#true {
        arg <STEP>
    }
    flag "-W --why" help="Show detailed reasons for inclusion/exclusion. Pass a step name to focus on one step, or omit the value to show reasons for all steps. Implies --plan" {
        arg <STEP>
    }
    flag --fail-fast help="Abort on first failure"
    flag --files0-from help="Read the exact file list from a NUL-delimited file, or from stdin with `-` (except hooks that reserve stdin)" {
        arg <PATH>
    }
    flag --format help="Select human or machine-readable execution output" {
        arg <FORMAT> {
            choices human json jsonl
        }
    }
    flag --from-hook help="Invoked by an installed git hook — gracefully exit 0 when no hk.pkl is present or the event isn't defined. Set automatically by `hk install`" hide=#true
    flag --from-ref help="Start reference for checking files (requires --to-ref)" {
        arg <FROM_REF>
    }
    flag --no-fail-fast help="Continue on failures (opposite of --fail-fast)"
    flag --no-stage help="Disable auto-staging of fixed files"
    flag --pr help="Check only files changed in the current PR/branch (shortcut for --from-ref DEFAULT_BRANCH --to-ref HEAD)"
    flag --safe help="Reject commands with unknown or destructive effects before execution"
    flag --sarif help="Write normalized diagnostics as SARIF" {
        arg <PATH>
    }
    flag --skip-step help="Skip specific step(s)" var=#true {
        arg <STEP>
    }
    flag --stage help="Enable auto-staging of fixed files"
    flag --staged help="Run on staged files only without stashing unstaged changes"
    flag --stash help="Stash method to use for git hooks" {
        arg <STASH> {
            choices git patch-file none
        }
    }
    flag --stats help="Display statistics about files matching each step"
    flag --to-ref help="End reference for checking files (requires --from-ref)" {
        arg <TO_REF>
    }
    flag --unstaged help="Run on unstaged and untracked files only (excludes staged files), without stashing. Useful for linting files an agent just changed"
    arg "[FILES]…" help="Run on specific files" required=#false var=#true
}
cmd init help="Generates a new hk.pkl file for a project" effect=write {
    alias generate hide=#true
    flag "-f --force" help="Overwrite existing hk.pkl file"
    flag "-i --interactive" help="Interactive mode: select linters and hooks manually"
    flag --mise help="Generate a mise.toml file with hk configured" {
        long_help #"""
Generate a mise.toml file with hk configured

Set HK_MISE=1 to make this default behavior.
"""#
    }
}
cmd install help="Sets up git hooks to run hk" effect=write {
    alias i
    long_help #"""
Sets up git hooks to run hk.

The recommended setup is `hk install --global`, which installs hooks once into the user's `~/.gitconfig` so every repository on the machine picks them up automatically. In a project without an `hk.pkl`, the installed hook exits silently — no-op — so it's safe to enable everywhere. Requires Git 2.54+.

Without `--global`, hooks are installed into the current repo only. On Git 2.54+ this uses config-based hooks (`hook.<name>.command`), which keeps `.git/hooks/` untouched and composes cleanly with other hook managers. On older Git it falls back to writing script shims.

If hk is already configured globally (any `hook.hk-*` entry in `~/.gitconfig`), the per-repo install is skipped — and any stale local hooks are cleaned up — so the global install remains the single source of truth and hk doesn't fire twice per event. Pass `--force-local` to install local hooks anyway.
"""#
    flag --force-local help=#"""
Install local hooks even when hk is already configured globally
(any `hook.hk-*` entry in `~/.gitconfig`). By default a per-repo
install is skipped in that case to avoid hk firing twice per
event. Not compatible with `--global`.
"""#
    flag --global help=#"""
Recommended. Install at user level (~/.gitconfig) so every repo
on this machine gets hk hooks. Requires Git 2.54 or newer. In
repos without an `hk.pkl`, the installed hook is a silent no-op.
"""#
    flag --legacy help=#"""
Force using the legacy `.git/hooks/` script shims instead of Git
2.54+ config-based hooks. Not compatible with `--global`.
"""#
    flag --mise help=#"""
Use `mise x` to execute hooks. With this, it won't
be necessary to activate mise in order to run hooks
with mise tools.
"""# {
        long_help #"""
Use `mise x` to execute hooks. With this, it won't
be necessary to activate mise in order to run hooks
with mise tools.

Set HK_MISE=1 to make this default behavior.
"""#
    }
}
cmd mcp help="Runs an MCP server for coding agents over standard input/output" {
    flag --root help="Restrict hk tools to this project root (defaults to the current directory)" {
        arg <PATH>
    }
}
cmd migrate subcommand_required=#true help="Migrate from other hook managers to hk" effect=read {
    cmd pre-commit help="Migrate from pre-commit to hk" effect=write {
        flag "-c --config" help="Path to .pre-commit-config.yaml" default=.pre-commit-config.yaml {
            arg <CONFIG>
        }
        flag "-f --force" help="Overwrite existing hk.pkl file"
        flag "-o --output" help="Output path for hk.pkl" default=hk.pkl {
            arg <OUTPUT>
        }
        flag --hk-pkl-root help="Root path for hk pkl files (e.g., \"pkl\" for local, or package URL prefix) If specified, will use {root}/Config.pkl and {root}/Builtins.pkl" {
            arg <HK_PKL_ROOT>
        }
    }
}
cmd run help="Run a hook" {
    alias r
    flag "-a --all" help="Run on all files instead of just staged files"
    flag "-c --check" help="Run check command instead of fix command"
    flag "-e --exclude" help="Exclude files that otherwise would have been selected" var=#true {
        arg <EXCLUDE>
    }
    flag "-f --fix" help="Run fix command instead of check command (this is the default behavior unless HK_FIX=0)"
    flag "-g --glob" help="Run on files that match these glob patterns" var=#true {
        arg <GLOB>
    }
    flag "-J --json" help="Output the plan as JSON when combined with --plan or --why"
    flag "-P --plan" help="Print the plan instead of running the hook"
    flag "-S --step" help="Run only specific step(s)" var=#true {
        arg <STEP>
    }
    flag "-W --why" help="Show detailed reasons for inclusion/exclusion. Pass a step name to focus on one step, or omit the value to show reasons for all steps. Implies --plan" {
        arg <STEP>
    }
    flag --fail-fast help="Abort on first failure"
    flag --files0-from help="Read the exact file list from a NUL-delimited file, or from stdin with `-` (except hooks that reserve stdin)" {
        arg <PATH>
    }
    flag --format help="Select human or machine-readable execution output" {
        arg <FORMAT> {
            choices human json jsonl
        }
    }
    flag --from-hook help="Invoked by an installed git hook — gracefully exit 0 when no hk.pkl is present or the event isn't defined. Set automatically by `hk install`" hide=#true
    flag --from-ref help="Start reference for checking files (requires --to-ref)" {
        arg <FROM_REF>
    }
    flag --no-fail-fast help="Continue on failures (opposite of --fail-fast)"
    flag --no-stage help="Disable auto-staging of fixed files"
    flag --pr help="Check only files changed in the current PR/branch (shortcut for --from-ref DEFAULT_BRANCH --to-ref HEAD)"
    flag --safe help="Reject commands with unknown or destructive effects before execution"
    flag --sarif help="Write normalized diagnostics as SARIF" {
        arg <PATH>
    }
    flag --skip-step help="Skip specific step(s)" var=#true {
        arg <STEP>
    }
    flag --stage help="Enable auto-staging of fixed files"
    flag --staged help="Run on staged files only without stashing unstaged changes"
    flag --stash help="Stash method to use for git hooks" {
        arg <STASH> {
            choices git patch-file none
        }
    }
    flag --stats help="Display statistics about files matching each step"
    flag --to-ref help="End reference for checking files (requires --from-ref)" {
        arg <TO_REF>
    }
    flag --unstaged help="Run on unstaged and untracked files only (excludes staged files), without stashing. Useful for linting files an agent just changed"
    arg "[OTHER]" required=#false hide=#true
    arg "[FILES]…" help="Run on specific files" required=#false var=#true
    cmd commit-msg {
        alias cm
        flag "-a --all" help="Run on all files instead of just staged files"
        flag "-c --check" help="Run check command instead of fix command"
        flag "-e --exclude" help="Exclude files that otherwise would have been selected" var=#true {
            arg <EXCLUDE>
        }
        flag "-f --fix" help="Run fix command instead of check command (this is the default behavior unless HK_FIX=0)"
        flag "-g --glob" help="Run on files that match these glob patterns" var=#true {
            arg <GLOB>
        }
        flag "-J --json" help="Output the plan as JSON when combined with --plan or --why"
        flag "-P --plan" help="Print the plan instead of running the hook"
        flag "-S --step" help="Run only specific step(s)" var=#true {
            arg <STEP>
        }
        flag "-W --why" help="Show detailed reasons for inclusion/exclusion. Pass a step name to focus on one step, or omit the value to show reasons for all steps. Implies --plan" {
            arg <STEP>
        }
        flag --fail-fast help="Abort on first failure"
        flag --files0-from help="Read the exact file list from a NUL-delimited file, or from stdin with `-` (except hooks that reserve stdin)" {
            arg <PATH>
        }
        flag --format help="Select human or machine-readable execution output" {
            arg <FORMAT> {
                choices human json jsonl
            }
        }
        flag --from-hook help="Invoked by an installed git hook — gracefully exit 0 when no hk.pkl is present or the event isn't defined. Set automatically by `hk install`" hide=#true
        flag --from-ref help="Start reference for checking files (requires --to-ref)" {
            arg <FROM_REF>
        }
        flag --no-fail-fast help="Continue on failures (opposite of --fail-fast)"
        flag --no-stage help="Disable auto-staging of fixed files"
        flag --pr help="Check only files changed in the current PR/branch (shortcut for --from-ref DEFAULT_BRANCH --to-ref HEAD)"
        flag --safe help="Reject commands with unknown or destructive effects before execution"
        flag --sarif help="Write normalized diagnostics as SARIF" {
            arg <PATH>
        }
        flag --skip-step help="Skip specific step(s)" var=#true {
            arg <STEP>
        }
        flag --stage help="Enable auto-staging of fixed files"
        flag --staged help="Run on staged files only without stashing unstaged changes"
        flag --stash help="Stash method to use for git hooks" {
            arg <STASH> {
                choices git patch-file none
            }
        }
        flag --stats help="Display statistics about files matching each step"
        flag --to-ref help="End reference for checking files (requires --from-ref)" {
            arg <TO_REF>
        }
        flag --unstaged help="Run on unstaged and untracked files only (excludes staged files), without stashing. Useful for linting files an agent just changed"
        arg <COMMIT_MSG_FILE> help="The path to the file that contains the commit message"
        arg "[FILES]…" help="Run on specific files" required=#false var=#true
    }
    cmd post-checkout {
        flag "-a --all" help="Run on all files instead of just staged files"
        flag "-c --check" help="Run check command instead of fix command"
        flag "-e --exclude" help="Exclude files that otherwise would have been selected" var=#true {
            arg <EXCLUDE>
        }
        flag "-f --fix" help="Run fix command instead of check command (this is the default behavior unless HK_FIX=0)"
        flag "-g --glob" help="Run on files that match these glob patterns" var=#true {
            arg <GLOB>
        }
        flag "-J --json" help="Output the plan as JSON when combined with --plan or --why"
        flag "-P --plan" help="Print the plan instead of running the hook"
        flag "-S --step" help="Run only specific step(s)" var=#true {
            arg <STEP>
        }
        flag "-W --why" help="Show detailed reasons for inclusion/exclusion. Pass a step name to focus on one step, or omit the value to show reasons for all steps. Implies --plan" {
            arg <STEP>
        }
        flag --fail-fast help="Abort on first failure"
        flag --files0-from help="Read the exact file list from a NUL-delimited file, or from stdin with `-` (except hooks that reserve stdin)" {
            arg <PATH>
        }
        flag --format help="Select human or machine-readable execution output" {
            arg <FORMAT> {
                choices human json jsonl
            }
        }
        flag --from-hook help="Invoked by an installed git hook — gracefully exit 0 when no hk.pkl is present or the event isn't defined. Set automatically by `hk install`" hide=#true
        flag --from-ref help="Start reference for checking files (requires --to-ref)" {
            arg <FROM_REF>
        }
        flag --no-fail-fast help="Continue on failures (opposite of --fail-fast)"
        flag --no-stage help="Disable auto-staging of fixed files"
        flag --pr help="Check only files changed in the current PR/branch (shortcut for --from-ref DEFAULT_BRANCH --to-ref HEAD)"
        flag --safe help="Reject commands with unknown or destructive effects before execution"
        flag --sarif help="Write normalized diagnostics as SARIF" {
            arg <PATH>
        }
        flag --skip-step help="Skip specific step(s)" var=#true {
            arg <STEP>
        }
        flag --stage help="Enable auto-staging of fixed files"
        flag --staged help="Run on staged files only without stashing unstaged changes"
        flag --stash help="Stash method to use for git hooks" {
            arg <STASH> {
                choices git patch-file none
            }
        }
        flag --stats help="Display statistics about files matching each step"
        flag --to-ref help="End reference for checking files (requires --from-ref)" {
            arg <TO_REF>
        }
        flag --unstaged help="Run on unstaged and untracked files only (excludes staged files), without stashing. Useful for linting files an agent just changed"
        arg <PREV_HEAD> help="SHA of the HEAD before the checkout"
        arg <NEW_HEAD> help="SHA of the new HEAD"
        arg <IS_BRANCH_CHECKOUT> help="Flag indicating whether the checkout was a branch checkout (1) or file checkout (0)"
        arg "[FILES]…" help="Run on specific files" required=#false var=#true
    }
    cmd post-commit {
        flag "-a --all" help="Run on all files instead of just staged files"
        flag "-c --check" help="Run check command instead of fix command"
        flag "-e --exclude" help="Exclude files that otherwise would have been selected" var=#true {
            arg <EXCLUDE>
        }
        flag "-f --fix" help="Run fix command instead of check command (this is the default behavior unless HK_FIX=0)"
        flag "-g --glob" help="Run on files that match these glob patterns" var=#true {
            arg <GLOB>
        }
        flag "-J --json" help="Output the plan as JSON when combined with --plan or --why"
        flag "-P --plan" help="Print the plan instead of running the hook"
        flag "-S --step" help="Run only specific step(s)" var=#true {
            arg <STEP>
        }
        flag "-W --why" help="Show detailed reasons for inclusion/exclusion. Pass a step name to focus on one step, or omit the value to show reasons for all steps. Implies --plan" {
            arg <STEP>
        }
        flag --fail-fast help="Abort on first failure"
        flag --files0-from help="Read the exact file list from a NUL-delimited file, or from stdin with `-` (except hooks that reserve stdin)" {
            arg <PATH>
        }
        flag --format help="Select human or machine-readable execution output" {
            arg <FORMAT> {
                choices human json jsonl
            }
        }
        flag --from-hook help="Invoked by an installed git hook — gracefully exit 0 when no hk.pkl is present or the event isn't defined. Set automatically by `hk install`" hide=#true
        flag --from-ref help="Start reference for checking files (requires --to-ref)" {
            arg <FROM_REF>
        }
        flag --no-fail-fast help="Continue on failures (opposite of --fail-fast)"
        flag --no-stage help="Disable auto-staging of fixed files"
        flag --pr help="Check only files changed in the current PR/branch (shortcut for --from-ref DEFAULT_BRANCH --to-ref HEAD)"
        flag --safe help="Reject commands with unknown or destructive effects before execution"
        flag --sarif help="Write normalized diagnostics as SARIF" {
            arg <PATH>
        }
        flag --skip-step help="Skip specific step(s)" var=#true {
            arg <STEP>
        }
        flag --stage help="Enable auto-staging of fixed files"
        flag --staged help="Run on staged files only without stashing unstaged changes"
        flag --stash help="Stash method to use for git hooks" {
            arg <STASH> {
                choices git patch-file none
            }
        }
        flag --stats help="Display statistics about files matching each step"
        flag --to-ref help="End reference for checking files (requires --from-ref)" {
            arg <TO_REF>
        }
        flag --unstaged help="Run on unstaged and untracked files only (excludes staged files), without stashing. Useful for linting files an agent just changed"
        arg "[FILES]…" help="Run on specific files" required=#false var=#true
    }
    cmd post-merge {
        flag "-a --all" help="Run on all files instead of just staged files"
        flag "-c --check" help="Run check command instead of fix command"
        flag "-e --exclude" help="Exclude files that otherwise would have been selected" var=#true {
            arg <EXCLUDE>
        }
        flag "-f --fix" help="Run fix command instead of check command (this is the default behavior unless HK_FIX=0)"
        flag "-g --glob" help="Run on files that match these glob patterns" var=#true {
            arg <GLOB>
        }
        flag "-J --json" help="Output the plan as JSON when combined with --plan or --why"
        flag "-P --plan" help="Print the plan instead of running the hook"
        flag "-S --step" help="Run only specific step(s)" var=#true {
            arg <STEP>
        }
        flag "-W --why" help="Show detailed reasons for inclusion/exclusion. Pass a step name to focus on one step, or omit the value to show reasons for all steps. Implies --plan" {
            arg <STEP>
        }
        flag --fail-fast help="Abort on first failure"
        flag --files0-from help="Read the exact file list from a NUL-delimited file, or from stdin with `-` (except hooks that reserve stdin)" {
            arg <PATH>
        }
        flag --format help="Select human or machine-readable execution output" {
            arg <FORMAT> {
                choices human json jsonl
            }
        }
        flag --from-hook help="Invoked by an installed git hook — gracefully exit 0 when no hk.pkl is present or the event isn't defined. Set automatically by `hk install`" hide=#true
        flag --from-ref help="Start reference for checking files (requires --to-ref)" {
            arg <FROM_REF>
        }
        flag --no-fail-fast help="Continue on failures (opposite of --fail-fast)"
        flag --no-stage help="Disable auto-staging of fixed files"
        flag --pr help="Check only files changed in the current PR/branch (shortcut for --from-ref DEFAULT_BRANCH --to-ref HEAD)"
        flag --safe help="Reject commands with unknown or destructive effects before execution"
        flag --sarif help="Write normalized diagnostics as SARIF" {
            arg <PATH>
        }
        flag --skip-step help="Skip specific step(s)" var=#true {
            arg <STEP>
        }
        flag --stage help="Enable auto-staging of fixed files"
        flag --staged help="Run on staged files only without stashing unstaged changes"
        flag --stash help="Stash method to use for git hooks" {
            arg <STASH> {
                choices git patch-file none
            }
        }
        flag --stats help="Display statistics about files matching each step"
        flag --to-ref help="End reference for checking files (requires --from-ref)" {
            arg <TO_REF>
        }
        flag --unstaged help="Run on unstaged and untracked files only (excludes staged files), without stashing. Useful for linting files an agent just changed"
        arg <IS_SQUASH> help="Flag indicating whether the merge was a squash merge (1) or not (0)"
        arg "[FILES]…" help="Run on specific files" required=#false var=#true
    }
    cmd post-rewrite {
        flag "-a --all" help="Run on all files instead of just staged files"
        flag "-c --check" help="Run check command instead of fix command"
        flag "-e --exclude" help="Exclude files that otherwise would have been selected" var=#true {
            arg <EXCLUDE>
        }
        flag "-f --fix" help="Run fix command instead of check command (this is the default behavior unless HK_FIX=0)"
        flag "-g --glob" help="Run on files that match these glob patterns" var=#true {
            arg <GLOB>
        }
        flag "-J --json" help="Output the plan as JSON when combined with --plan or --why"
        flag "-P --plan" help="Print the plan instead of running the hook"
        flag "-S --step" help="Run only specific step(s)" var=#true {
            arg <STEP>
        }
        flag "-W --why" help="Show detailed reasons for inclusion/exclusion. Pass a step name to focus on one step, or omit the value to show reasons for all steps. Implies --plan" {
            arg <STEP>
        }
        flag --fail-fast help="Abort on first failure"
        flag --files0-from help="Read the exact file list from a NUL-delimited file, or from stdin with `-` (except hooks that reserve stdin)" {
            arg <PATH>
        }
        flag --format help="Select human or machine-readable execution output" {
            arg <FORMAT> {
                choices human json jsonl
            }
        }
        flag --from-hook help="Invoked by an installed git hook — gracefully exit 0 when no hk.pkl is present or the event isn't defined. Set automatically by `hk install`" hide=#true
        flag --from-ref help="Start reference for checking files (requires --to-ref)" {
            arg <FROM_REF>
        }
        flag --no-fail-fast help="Continue on failures (opposite of --fail-fast)"
        flag --no-stage help="Disable auto-staging of fixed files"
        flag --pr help="Check only files changed in the current PR/branch (shortcut for --from-ref DEFAULT_BRANCH --to-ref HEAD)"
        flag --safe help="Reject commands with unknown or destructive effects before execution"
        flag --sarif help="Write normalized diagnostics as SARIF" {
            arg <PATH>
        }
        flag --skip-step help="Skip specific step(s)" var=#true {
            arg <STEP>
        }
        flag --stage help="Enable auto-staging of fixed files"
        flag --staged help="Run on staged files only without stashing unstaged changes"
        flag --stash help="Stash method to use for git hooks" {
            arg <STASH> {
                choices git patch-file none
            }
        }
        flag --stats help="Display statistics about files matching each step"
        flag --to-ref help="End reference for checking files (requires --from-ref)" {
            arg <TO_REF>
        }
        flag --unstaged help="Run on unstaged and untracked files only (excludes staged files), without stashing. Useful for linting files an agent just changed"
        arg <COMMAND> help="The command that triggered the rewrite (\"amend\" or \"rebase\")"
        arg "[FILES]…" help="Run on specific files" required=#false var=#true
    }
    cmd pre-commit help="Sets up git hooks to run hk" {
        alias pc
        flag "-a --all" help="Run on all files instead of just staged files"
        flag "-c --check" help="Run check command instead of fix command"
        flag "-e --exclude" help="Exclude files that otherwise would have been selected" var=#true {
            arg <EXCLUDE>
        }
        flag "-f --fix" help="Run fix command instead of check command (this is the default behavior unless HK_FIX=0)"
        flag "-g --glob" help="Run on files that match these glob patterns" var=#true {
            arg <GLOB>
        }
        flag "-J --json" help="Output the plan as JSON when combined with --plan or --why"
        flag "-P --plan" help="Print the plan instead of running the hook"
        flag "-S --step" help="Run only specific step(s)" var=#true {
            arg <STEP>
        }
        flag "-W --why" help="Show detailed reasons for inclusion/exclusion. Pass a step name to focus on one step, or omit the value to show reasons for all steps. Implies --plan" {
            arg <STEP>
        }
        flag --fail-fast help="Abort on first failure"
        flag --files0-from help="Read the exact file list from a NUL-delimited file, or from stdin with `-` (except hooks that reserve stdin)" {
            arg <PATH>
        }
        flag --format help="Select human or machine-readable execution output" {
            arg <FORMAT> {
                choices human json jsonl
            }
        }
        flag --from-hook help="Invoked by an installed git hook — gracefully exit 0 when no hk.pkl is present or the event isn't defined. Set automatically by `hk install`" hide=#true
        flag --from-ref help="Start reference for checking files (requires --to-ref)" {
            arg <FROM_REF>
        }
        flag --no-fail-fast help="Continue on failures (opposite of --fail-fast)"
        flag --no-stage help="Disable auto-staging of fixed files"
        flag --pr help="Check only files changed in the current PR/branch (shortcut for --from-ref DEFAULT_BRANCH --to-ref HEAD)"
        flag --safe help="Reject commands with unknown or destructive effects before execution"
        flag --sarif help="Write normalized diagnostics as SARIF" {
            arg <PATH>
        }
        flag --skip-step help="Skip specific step(s)" var=#true {
            arg <STEP>
        }
        flag --stage help="Enable auto-staging of fixed files"
        flag --staged help="Run on staged files only without stashing unstaged changes"
        flag --stash help="Stash method to use for git hooks" {
            arg <STASH> {
                choices git patch-file none
            }
        }
        flag --stats help="Display statistics about files matching each step"
        flag --to-ref help="End reference for checking files (requires --from-ref)" {
            arg <TO_REF>
        }
        flag --unstaged help="Run on unstaged and untracked files only (excludes staged files), without stashing. Useful for linting files an agent just changed"
        arg "[FILES]…" help="Run on specific files" required=#false var=#true
    }
    cmd pre-push {
        alias pp
        flag "-a --all" help="Run on all files instead of just staged files"
        flag "-c --check" help="Run check command instead of fix command"
        flag "-e --exclude" help="Exclude files that otherwise would have been selected" var=#true {
            arg <EXCLUDE>
        }
        flag "-f --fix" help="Run fix command instead of check command (this is the default behavior unless HK_FIX=0)"
        flag "-g --glob" help="Run on files that match these glob patterns" var=#true {
            arg <GLOB>
        }
        flag "-J --json" help="Output the plan as JSON when combined with --plan or --why"
        flag "-P --plan" help="Print the plan instead of running the hook"
        flag "-S --step" help="Run only specific step(s)" var=#true {
            arg <STEP>
        }
        flag "-W --why" help="Show detailed reasons for inclusion/exclusion. Pass a step name to focus on one step, or omit the value to show reasons for all steps. Implies --plan" {
            arg <STEP>
        }
        flag --fail-fast help="Abort on first failure"
        flag --files0-from help="Read the exact file list from a NUL-delimited file, or from stdin with `-` (except hooks that reserve stdin)" {
            arg <PATH>
        }
        flag --format help="Select human or machine-readable execution output" {
            arg <FORMAT> {
                choices human json jsonl
            }
        }
        flag --from-hook help="Invoked by an installed git hook — gracefully exit 0 when no hk.pkl is present or the event isn't defined. Set automatically by `hk install`" hide=#true
        flag --from-ref help="Start reference for checking files (requires --to-ref)" {
            arg <FROM_REF>
        }
        flag --no-fail-fast help="Continue on failures (opposite of --fail-fast)"
        flag --no-stage help="Disable auto-staging of fixed files"
        flag --pr help="Check only files changed in the current PR/branch (shortcut for --from-ref DEFAULT_BRANCH --to-ref HEAD)"
        flag --safe help="Reject commands with unknown or destructive effects before execution"
        flag --sarif help="Write normalized diagnostics as SARIF" {
            arg <PATH>
        }
        flag --skip-step help="Skip specific step(s)" var=#true {
            arg <STEP>
        }
        flag --stage help="Enable auto-staging of fixed files"
        flag --staged help="Run on staged files only without stashing unstaged changes"
        flag --stash help="Stash method to use for git hooks" {
            arg <STASH> {
                choices git patch-file none
            }
        }
        flag --stats help="Display statistics about files matching each step"
        flag --to-ref help="End reference for checking files (requires --from-ref)" {
            arg <TO_REF>
        }
        flag --unstaged help="Run on unstaged and untracked files only (excludes staged files), without stashing. Useful for linting files an agent just changed"
        arg "[REMOTE]" help="Remote name" required=#false
        arg "[URL]" help="Remote URL" required=#false
        arg "[FILES]…" help="Run on specific files" required=#false var=#true
    }
    cmd pre-rebase {
        flag "-a --all" help="Run on all files instead of just staged files"
        flag "-c --check" help="Run check command instead of fix command"
        flag "-e --exclude" help="Exclude files that otherwise would have been selected" var=#true {
            arg <EXCLUDE>
        }
        flag "-f --fix" help="Run fix command instead of check command (this is the default behavior unless HK_FIX=0)"
        flag "-g --glob" help="Run on files that match these glob patterns" var=#true {
            arg <GLOB>
        }
        flag "-J --json" help="Output the plan as JSON when combined with --plan or --why"
        flag "-P --plan" help="Print the plan instead of running the hook"
        flag "-S --step" help="Run only specific step(s)" var=#true {
            arg <STEP>
        }
        flag "-W --why" help="Show detailed reasons for inclusion/exclusion. Pass a step name to focus on one step, or omit the value to show reasons for all steps. Implies --plan" {
            arg <STEP>
        }
        flag --fail-fast help="Abort on first failure"
        flag --files0-from help="Read the exact file list from a NUL-delimited file, or from stdin with `-` (except hooks that reserve stdin)" {
            arg <PATH>
        }
        flag --format help="Select human or machine-readable execution output" {
            arg <FORMAT> {
                choices human json jsonl
            }
        }
        flag --from-hook help="Invoked by an installed git hook — gracefully exit 0 when no hk.pkl is present or the event isn't defined. Set automatically by `hk install`" hide=#true
        flag --from-ref help="Start reference for checking files (requires --to-ref)" {
            arg <FROM_REF>
        }
        flag --no-fail-fast help="Continue on failures (opposite of --fail-fast)"
        flag --no-stage help="Disable auto-staging of fixed files"
        flag --pr help="Check only files changed in the current PR/branch (shortcut for --from-ref DEFAULT_BRANCH --to-ref HEAD)"
        flag --safe help="Reject commands with unknown or destructive effects before execution"
        flag --sarif help="Write normalized diagnostics as SARIF" {
            arg <PATH>
        }
        flag --skip-step help="Skip specific step(s)" var=#true {
            arg <STEP>
        }
        flag --stage help="Enable auto-staging of fixed files"
        flag --staged help="Run on staged files only without stashing unstaged changes"
        flag --stash help="Stash method to use for git hooks" {
            arg <STASH> {
                choices git patch-file none
            }
        }
        flag --stats help="Display statistics about files matching each step"
        flag --to-ref help="End reference for checking files (requires --from-ref)" {
            arg <TO_REF>
        }
        flag --unstaged help="Run on unstaged and untracked files only (excludes staged files), without stashing. Useful for linting files an agent just changed"
        arg <UPSTREAM> help="The upstream from which the series was forked"
        arg "[BRANCH]" help="The branch being rebased (unset when rebasing the current branch)" required=#false
        arg "[FILES]…" help="Run on specific files" required=#false var=#true
    }
    cmd prepare-commit-msg {
        alias pcm
        flag "-a --all" help="Run on all files instead of just staged files"
        flag "-c --check" help="Run check command instead of fix command"
        flag "-e --exclude" help="Exclude files that otherwise would have been selected" var=#true {
            arg <EXCLUDE>
        }
        flag "-f --fix" help="Run fix command instead of check command (this is the default behavior unless HK_FIX=0)"
        flag "-g --glob" help="Run on files that match these glob patterns" var=#true {
            arg <GLOB>
        }
        flag "-J --json" help="Output the plan as JSON when combined with --plan or --why"
        flag "-P --plan" help="Print the plan instead of running the hook"
        flag "-S --step" help="Run only specific step(s)" var=#true {
            arg <STEP>
        }
        flag "-W --why" help="Show detailed reasons for inclusion/exclusion. Pass a step name to focus on one step, or omit the value to show reasons for all steps. Implies --plan" {
            arg <STEP>
        }
        flag --fail-fast help="Abort on first failure"
        flag --files0-from help="Read the exact file list from a NUL-delimited file, or from stdin with `-` (except hooks that reserve stdin)" {
            arg <PATH>
        }
        flag --format help="Select human or machine-readable execution output" {
            arg <FORMAT> {
                choices human json jsonl
            }
        }
        flag --from-hook help="Invoked by an installed git hook — gracefully exit 0 when no hk.pkl is present or the event isn't defined. Set automatically by `hk install`" hide=#true
        flag --from-ref help="Start reference for checking files (requires --to-ref)" {
            arg <FROM_REF>
        }
        flag --no-fail-fast help="Continue on failures (opposite of --fail-fast)"
        flag --no-stage help="Disable auto-staging of fixed files"
        flag --pr help="Check only files changed in the current PR/branch (shortcut for --from-ref DEFAULT_BRANCH --to-ref HEAD)"
        flag --safe help="Reject commands with unknown or destructive effects before execution"
        flag --sarif help="Write normalized diagnostics as SARIF" {
            arg <PATH>
        }
        flag --skip-step help="Skip specific step(s)" var=#true {
            arg <STEP>
        }
        flag --stage help="Enable auto-staging of fixed files"
        flag --staged help="Run on staged files only without stashing unstaged changes"
        flag --stash help="Stash method to use for git hooks" {
            arg <STASH> {
                choices git patch-file none
            }
        }
        flag --stats help="Display statistics about files matching each step"
        flag --to-ref help="End reference for checking files (requires --from-ref)" {
            arg <TO_REF>
        }
        flag --unstaged help="Run on unstaged and untracked files only (excludes staged files), without stashing. Useful for linting files an agent just changed"
        arg <COMMIT_MSG_FILE> help="The path to the file that contains the commit message so far"
        arg "[SOURCE]" help="The source of the commit message (e.g., \"message\", \"template\", \"merge\")" required=#false
        arg "[SHA]" help="The SHA of the commit being amended (if applicable)" required=#false
        arg "[FILES]…" help="Run on specific files" required=#false var=#true
    }
}
cmd sponsors help="Show the companies sponsoring hk and the jdx.dev open source tools" effect=read
cmd test help="Run step-defined tests" {
    flag --list help="List tests without running"
    flag --name help="Filter by test name (repeatable)" var=#true {
        arg <NAME>
    }
    flag --step help="Filter by step name (repeatable)" var=#true {
        arg <STEP>
    }
}
cmd uninstall help="Removes hk hooks from the current git repository" effect=destructive {
    flag --global help="Remove hk hooks from the user's global git config (`~/.gitconfig`)."
}
cmd usage hide=#true help="Generates a usage spec for the CLI" effect=read {
    long_help #"""
Generates a usage spec for the CLI

https://usage.jdx.dev
"""#
}
cmd util subcommand_required=#true help="Utility commands for file operations" effect=read {
    cmd check-added-large-files help="Check for large files being added to repository" effect=read {
        flag --maxkb help="Maximum file size in kilobytes (default: 500)" default="500" {
            arg <MAXKB>
        }
        arg <FILES>… help="Files to check" var=#true
    }
    cmd check-byte-order-marker help="Check for UTF-8 byte order marker (BOM)" effect=read {
        flag "-d --diff" help="Output a diff of the change"
        arg <FILES>… help="Files to check" var=#true
    }
    cmd check-case-conflict help="Check for case-insensitive filename conflicts" effect=read {
        arg <FILES>… help="Files to check for case conflicts" var=#true
    }
    cmd check-conventional-commit help="Check for conventional commit message" effect=read {
        long_help #"""
Check for conventional commit message

Titles starting with `fixup! `, `squash! `, or `amend! ` (temporary commits created for `git rebase --autosquash`) skip validation.
"""#
        flag --allowed-types var=#true default=build,chore,ci,docs,feat,fix,perf,refactor,revert,style,test {
            arg <ALLOWED_TYPES>
        }
        arg <COMMIT_MSG_FILE> help="Commit message file to check"
    }
    cmd check-executables-have-shebangs help="Check that executable files have shebangs" effect=read {
        arg <FILES>… help="Files to check" var=#true
    }
    cmd check-merge-conflict help="Check for merge conflict markers" effect=read {
        flag --assume-in-merge help="Run the check even when not in a merge"
        arg <FILES>… help="Files to check" var=#true
    }
    cmd check-symlinks help="Check for broken symlinks" effect=read {
        arg <FILES>… help="Files to check" var=#true
    }
    cmd detect-private-key help="Detect private keys in files" effect=read {
        arg <FILES>… help="Files to check" var=#true
    }
    cmd end-of-file-fixer help="Check for and optionally fix missing final newlines" effect=write {
        flag "-d --diff" help="Output a diff of the change. Cannot use with `fix`"
        flag "-f --fix" help="Fix files to end with exactly one newline"
        arg <FILES>… help="Files to check/fix" var=#true
    }
    cmd fix-byte-order-marker help="Remove UTF-8 byte order marker (BOM)" effect=write {
        arg <FILES>… help="Files to remove BOM from" var=#true
    }
    cmd fix-smart-quotes help="Replace UTF-8 smart quotes" effect=write {
        flag --check help="Check for smart quotes without fixing them"
        flag "-d --diff" help="Output a diff of the change (implies `--check`)"
        arg <FILES>… help="Files to check/fix" var=#true
    }
    cmd mixed-line-ending help="Detect and fix mixed line endings" effect=write {
        flag "-d --diff" help="Output a diff of the change. Cannot use with `fix`"
        flag "-f --fix" help="Fix mixed line endings by normalizing to LF"
        arg <FILES>… help="Files to check or fix" var=#true
    }
    cmd no-commit-to-branch help="Prevent commits to specific branches" effect=read {
        flag --branch help="Branch names to protect (default: main, master)" var=#true {
            arg <BRANCH>
        }
    }
    cmd python-check-ast help="Check Python files for valid syntax" effect=read {
        arg <FILES>… help="Files to check" var=#true
    }
    cmd python-debug-statements help="Detect Python debug statements" effect=read {
        arg <FILES>… help="Files to check" var=#true
    }
    cmd trailing-whitespace help="Check for and optionally fix trailing whitespace" effect=write {
        flag "-d --diff" help="Output a diff of the change. Cannot use with `fix`"
        flag "-f --fix" help="Fix trailing whitespace by removing it"
        arg <FILES>… help="Files to check/fix" var=#true
    }
}
cmd validate help="Validate the config file" effect=read
cmd version help="Print the version of hk" effect=read
