id = "hk"
name = "hk"
homepage = "https://hk.jdx.dev/"
description = "A fast and extensible git hook manager"
executables = ["hk"]
[dotfiles]
paths = ["[configHome]/hk/config.pkl"]
secret = []
[commands]
format = 1
label = "hk"
description = "Run the check hook over a repository with hk check. Other hk commands, hook subcommands and output options are left out."
quality = "ai-draft"
parser = { end_of_options = "--", interleave = "permute", long_equals = true, short_attached = true, short_bundles = false }
[[commands.subcommand]]
path = ["check"]
label = "Check files"
description = "Run each step's check command on selected files."
[[commands.subcommand.source]]
id = "docs"
kind = "manual"
url = "https://raw.githubusercontent.com/jdx/hk/HEAD/docs/cli/check.md"
revision = "v2.9.0"
evidence = """- **`[FILES]…`** — Run on specific files
- **`-a --all`** — Select all tracked and eligible untracked files, then apply step filters
- **`-f --fix`** — Run fix commands instead of check commands for this invocation
- **`-g --glob <GLOB>`** — Run on files that match these glob patterns
- **`-S --step <STEP>`** — Run only specific step(s)
- **`-P --plan`** — Print the plan instead of running the hook
- **`--skip-step <STEP>`** — Skip specific step(s)
- **`--staged`** — Run on staged files only without stashing unstaged changes
- **`--pr`** — Check only files changed in the current PR/branch (shortcut for --from-ref DEFAULT_BRANCH --to-ref HEAD)
- **`--from-ref <FROM_REF>`** — Select files changed since this reference; optionally pair with --to-ref
- **`--to-ref <TO_REF>`** — End reference for comparison with --from-ref"""
[[commands.subcommand.field]]
id = "files"
label = "Files"
type = "path"
position = 0
multiple = true
min = 0
path = { kind = "any", role = "input" }
sources = ["docs"]
[[commands.subcommand.field]]
id = "all"
label = "All files"
type = "boolean"
option = ["--all", "-a"]
sources = ["docs"]
[[commands.subcommand.field]]
id = "fix"
label = "Fix instead of check"
description = "Runs fix commands, which can modify files."
type = "boolean"
option = ["--fix", "-f"]
effect = "overwrite"
sources = ["docs"]
[[commands.subcommand.field]]
id = "staged"
label = "Staged files only"
type = "boolean"
option = ["--staged"]
sources = ["docs"]
[[commands.subcommand.field]]
id = "pr"
label = "Files changed in this branch"
type = "boolean"
option = ["--pr"]
sources = ["docs"]
[[commands.subcommand.field]]
id = "plan"
label = "Print plan only"
type = "boolean"
option = ["--plan", "-P"]
sources = ["docs"]
[[commands.subcommand.field]]
id = "step"
label = "Only step"
type = "string"
option = ["--step", "-S"]
multiple = true
sources = ["docs"]
[[commands.subcommand.field]]
id = "skip_step"
label = "Skip step"
type = "string"
option = ["--skip-step"]
multiple = true
sources = ["docs"]
[[commands.subcommand.field]]
id = "glob"
label = "Glob"
type = "string"
option = ["--glob", "-g"]
multiple = true
sources = ["docs"]
[[commands.subcommand.field]]
id = "from_ref"
label = "From ref"
type = "string"
option = ["--from-ref"]
sources = ["docs"]
[[commands.subcommand.field]]
id = "to_ref"
label = "To ref"
type = "string"
option = ["--to-ref"]
sources = ["docs"]
[[commands.subcommand.task]]
id = "all"
label = "Check the whole repository"
fields = ["all", "step", "skip_step"]
required = ["all"]
set = { all = [true] }
[[commands.subcommand.task]]
id = "staged"
label = "Check staged files"
fields = ["staged", "step", "skip_step"]
required = ["staged"]
set = { staged = [true] }
[[commands.subcommand.task]]
id = "branch"
label = "Check this branch"
fields = ["pr", "step", "skip_step"]
required = ["pr"]
set = { pr = [true] }
[[commands.subcommand.group]]
id = "basic"
label = "Basic"
fields = ["files", "all", "staged", "pr", "fix", "plan"]
[[commands.subcommand.group]]
id = "advanced"
label = "Advanced"
fields = ["step", "skip_step", "glob", "from_ref", "to_ref"]