This release is all about understanding and controlling where hk runs. hk check --plan lets you dry-run a hook and see exactly which steps would execute and why, hk install --global registers hk against every repo on your machine using Git 2.54's new config-based hooks, and bare-repo dotfile managers like YADM are now supported via GIT_DIR/GIT_WORK_TREE.
Highlights
hk check --plan/--why/--json— dry-run any hook to see which steps would run, which would skip, and why, with JSON output for toolinghk install --global— install hooks once in~/.gitconfigand have hk apply to every repo (Git 2.54+)- Bare-repo dotfile support — hk now respects
GIT_DIRandGIT_WORK_TREE, so YADM and similar setups work out of the box - New
cocogitto_commit_msgbuiltin for Conventional Commits validation
Added
-
hk check --plan/-P,--why [STEP]/-W,--json/-J: You can now dry-run a hook to see what hk would do without executing any commands.--planprints the parallel groups, matched file counts, and included/skipped steps with reasons;--whydrills into the skip reasons for every step (or a specific one);--jsonemits the plan as structured JSON for tooling. (@jdx) #848$ hk check --plan Plan: check Run type: check [parallel group] group_0 ○ actionlint (no files matched filters) ✓ cargo-fmt (6 files matched) ○ cargo-clippy (required profile(s) not enabled: slow) ✓ cargo-check (6 files matched)
The planner reuses hk's real job-building and skip-evaluation logic, so the plan accurately reflects what would happen — including filter matches, profile gating,
conditionevaluation,dependsOn, and--step/--skip-stepselections. It never executes step commands. -
Git 2.54 config-based hook installation with
--global: On Git 2.54+,hk installnow writes config-based hooks (hook.hk-<event>.command/.event) instead of shell shims in.git/hooks/. The hooks directory is left untouched, and hk composes cleanly with other hook managers. Use--legacyto force the old shim behavior; older Git falls back automatically. (@jdx) #853More importantly,
hk install --globalwrites those entries to your~/.gitconfigso hk runs in every repository on your machine:$ hk install --globalIn repos without an
hk.pkl(or without a matching event), the invocation is a silent no-op via a new hiddenhk run --from-hookflag — install once, forget, and repos that don't use hk are unaffected.hk uninstallnow cleans up both script shims and config entries regardless of current Git version, andhk uninstall --globalremoves the global entries. -
GIT_DIR/GIT_WORK_TREEsupport for bare-repo dotfile managers: hk now honors these environment variables during repository discovery, so it works with YADM and similar bare-repo dotfile setups where there is no.gitdirectory in the work tree. When libgit2 opens a bare repo, hk falls back to shellgitfor status/diff operations (libgit2 refuses those on bare repos). As a bonus,hk builtinsno longer loads project settings, so it runs outside a repo instead of panicking. Fixes #831. (@jdx) #847 -
cocogitto_commit_msgbuiltin: A new builtin linter that validates commit messages against the Conventional Commits spec using cocogitto'scog verify. Uses the{{commit_msg_file}}template variable, making it a drop-in for thecommit-msghook. (@hituzi-no-sippo) #838
Fixed
- Text progress in CI: Some CI systems allocate a pseudo-TTY, which made
console::user_attended_stderr()report an interactive stderr while the log collector stripped cursor-control escapes and recorded spinner frames as noisy log rows. hk now detects CI environments viais_ciand forces clx progress into text mode, while leaving local interactive behavior unchanged. (@jdx) #845
Changed
Full Changelog: v1.43.0...v1.44.0
💚 Sponsor hk
hk is developed by @jdx at en.dev — a small independent studio behind developer tools like mise, aube, hk, and more. Work on hk is funded by sponsorships.
If hk has sped up your pre-commit loop or made linting feel less painful, please consider sponsoring at en.dev. Sponsorships are what keep hk moving and the project independent.