hk is a Git hooks manager and project linting tool written in Rust. It helps developers automate code-quality checks and formatting tasks, both when committing changes and during ordinary development.
The application is particularly useful for projects that use several linters and formatters. Running these tools sequentially can be unnecessarily slow, while running them all at once risks conflicts when multiple tools modify the same files. hk addresses this through coordinated task execution.
Its configuration can be shared across a development team, allowing the same checks to run locally and in continuous integration environments. The aim is to catch problems early without turning every commit into a lengthy exercise.
This is free and open source software.
Key Features
- Runs linters, formatters and other project checks concurrently, using read/write file locks to prevent conflicting modifications.
- Uses Pkl for configuration, with support for typed settings, imports and reusable definitions.
- Provides built-in configurations for popular development tools, including Prettier, ESLint, Ruff, Black and other linters and formatters.
- Can detect available project tools and generate an initial configuration with the hk init command.
- Separates checking from fixing: hk check reports problems without modifying files, while hk fix applies available corrections.
- Supports checks against modified files or the entire repository, with options to preview planned operations and explain why particular steps are selected.
- Temporarily stashes unstaged changes during pre-commit operations, protecting partially staged files from unintended modifications.
- Supports automatic staging of corrected files during hooks, with explicit control over staging during manual fixes.
- Filters files by patterns and types, and supports dependencies between individual processing steps.
- Can produce structured diagnostics, including SARIF output for integration with code-quality reporting systems.
- Integrates with mise for managing development toolchains and executing project commands.
Website: github.com/jdx/hk
Support:
Developer: Jeff Dickey
License: MIT License

hk is written in Rust. Learn Rust with our recommended free books and free tutorials.
Related Software
| Git Hook Managers | |
|---|---|
| lefthook | Git hooks manager for Node.js, Ruby, Python and more |
| husky | Git hooks made easy |
| pre-commit | Manage and maintain multi-language pre-commit hooks |
| GrumPHP | Automates PHP code quality checks through configurable Git hooks |
| prek | Reimagined version of pre-commit |
| overcommit | Manage and configure Git hooks |
| hk | Git hooks manager and project linting tool focusing on performance |
| simple-git-hooks | Simple git hooks manager for small projects |
| CaptainHook | Flexible Git hook manager |
| Githooks | Platform-independent hooks manager |
| git-hooks | Rewritten from icefox/git-hooks, with extra features |
| Autohook | Runs and organises Git hook scripts using a single Bash script |
| Jig | Git pre-commit hook on steroids |
Read our verdict in the software roundup.
LinuxLinks helps you discover the best free and open source software for Linux. Explore our extensive collection of recommended applications, including alternatives to popular proprietary software.We also publish software reviews, Linux tutorials, hardware reviews, free programming books and articles covering the wider open source community. Browse our Linux resources to discover more. Know a useful free and open source Linux application we haven't covered? Suggest a program for inclusion. Has your software been featured on LinuxLinks? Display one of our Featured on LinuxLinks badges on your website or GitHub README. |


Please read our Comment Policy before commenting.