| name | hk |
| description | Use when hk.pkl exists in project, hook output shows hk running, or working with git hooks in hk-managed projects. Also use when setting up, configuring, or troubleshooting hk git hooks. |
hk - Git Hook Manager
Overview
hk is a fast git hook manager by jdx (author of mise). Uses pkl configuration language. Provides 90+ built-in linters.
Docs: https://hk.jdx.dev/
GitHub: https://github.com/jdx/hk
Detection
Identify which hook manager a project uses:
| File | Hook Manager |
|---|
hk.pkl | hk |
lefthook.yml | lefthook |
.husky/ directory | husky |
.pre-commit-config.yaml | pre-commit (python) |
Key Commands
hk init
hk install
hk check
hk fix
hk builtins
hk validate
hk config dump
Core Concepts
- Hooks: Git hook types (pre-commit, commit-msg, pre-push)
- Steps: Named units of work within hooks
- Builtins: Pre-configured linters (90+) via
Builtins.pkl
- Profiles: Enable/disable groups of steps (
--profile slow)
Configuration
When editing hk.pkl, read hk-pkl-reference.md in this skill directory for structure and examples.
Built-in Linters
When looking up builtins, read builtins-reference.md in this skill directory. Or run hk builtins for the live list.
Finding Help
Stable reference: Read the reference files in this skill directory when needed.
Latest docs:
npx @mdream/crawl https://hk.jdx.dev/ --output /tmp/hk-docs
GitHub issues:
gh issue list -R jdx/hk
gh search issues --repo jdx/hk "error"
gh issue view 123 -R jdx/hk
Troubleshooting
Hook not running:
hk install
cat .git/hooks/pre-commit
Step skipped:
hk check -v
hk config dump
Validate config:
hk validate