# Install hk with Homebrew, MacPorts, scoop

Git hook and pre-commit lint manager. Version 1.50.0 via Homebrew; verified 2026-07-07.

## Install

```sh
sudo av install brew:hk
```

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install hk
```

  Evidence: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install hk
```

  Evidence: MacPorts ports tree: devel/hk/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Windows

- Scoop (92%):

```sh
scoop install main/hk
```

  Evidence: Scoop official bucket manifest trees: bucket/hk.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1

## Package facts

- **Package key:** brew:hk
- **Package manager:** Homebrew
- **Package manager page:** <https://formulae.brew.sh/formula/hk>
- **Version:** 1.50.0
- **Source summary:** Git hook and pre-commit lint manager
- **Homepage:** <https://hk.jdx.dev>
- **Repository:** <https://github.com/jdx/hk>
- **Upstream docs:** <https://hk.jdx.dev/>
- **License:** MIT
- **Source archive:** <https://github.com/jdx/hk.git>
- **Last updated:** 2026-07-07T02:25:20Z
- **Generated:** 2026-07-08T07:18:31+00:00

## Executables

- generate-docs (cli)
- hk (cli)
- generate-docs (alias)
- hk (alias)

## Dependencies

- openssl@3
- pkl
- usage

## Build dependencies

- rust

## Install behavior

- Post-install hook: not defined
- Bottle: available on arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux

## Freshness

- Page generated: 2026-07-08
- Package-manager version: 1.50.0
- Package-manager updated: 2026-07-07
- Local data: ok
- Upstream repository: https://github.com/jdx/hk
- info: No cached GitHub release or tag data was available.
## Project history and usage

hk is a Rust git-hook manager and project lint runner by jdx, designed around fast hook execution, tighter linter integration, and safe parallelism through read/write file locking.

### Project history

The official README describes hk as a git hook manager and project linting tool with an emphasis on performance. Its About page explains the motivation: git hooks need to be fast or developers stop using them, and naive parallel execution can break when multiple formatters or linters modify the same files.

hk's configuration model uses Apple's Pkl language through hk.pkl files. The configuration documentation describes layered sources, including built-in defaults, user-level hkrc, project config, Git config, environment variables, and CLI flags.

### Adoption history

hk is a young tool in the git-hook manager space. The GitHub repository was created in January 2025, early GitHub releases began in March 2025, and the documentation quickly oriented around global Git hook installation, per-project hk.pkl files, and integration with mise-en-place.

The input package facts show packaging through Homebrew, MacPorts, and Scoop, which is a practical footprint for a developer CLI aimed at local workstations rather than servers.

### How it is used

The intended workflow is to install hooks globally or per repository, run hk init to create hk.pkl, and then let Git events run configured lint and fix steps. hk check and hk fix provide explicit command-line entry points for running checks outside Git hooks.

The configuration docs emphasize precedence and local overrides: hk.local.pkl is for local changes that should not be committed, while ~/.config/hk/config.pkl can hold user-wide defaults.

### Why package nerds care

hk matters to package nerds because it is part of the newer wave of developer workflow CLIs that try to make local checks fast enough to keep enabled. Its differentiator is not another hook file format by itself, but the combination of Pkl configuration, built-in linter definitions, libgit2 usage, mise integration, and locking around file modification.

It also reflects a packaging trend: single-purpose Rust CLIs distributed through Homebrew, Scoop, MacPorts, and direct release binaries for developers who want one binary in their path.

### Timeline

- 2025-01-26: The jdx/hk GitHub repository was created.
- 2025-03-29: Early v0.6.x GitHub releases were published.
- 2025: hk documentation described global Git hook installation and hk.pkl project setup.
- 2026: hk documentation described pklr as the built-in Pkl evaluator and layered configuration sources.

### Related projects

- mise-en-place: jdx's environment/tool-version manager that hk documentation names as an integration point.
- pre-commit, lefthook, Husky, lint-staged: adjacent git-hook and lint-running tools in the same developer workflow category.
- Pkl: Apple's configuration language used for hk.pkl.

### Sources

- <https://api.github.com/repos/jdx/hk>
- <https://hk.jdx.dev/about.html>
- <https://hk.jdx.dev/configuration>
- <https://hk.jdx.dev/getting_started>
- <https://raw.githubusercontent.com/jdx/hk/main/README.md>
- input: source_facts.package-manager


## Security Notes

narrow executable package without higher-risk signals.

- **Geiger risk:** green / low
- narrow executable package without higher-risk signals


## Configuration and credential file locations

These source-backed paths show where this package keeps local settings or durable credentials. Automic Vault can use them as review targets for secret scanning, migration, and command approval.


## Configuration files

- Unix: hk.local.pkl, .config/hk.local.pkl, hk.pkl, .config/hk.pkl, ~/.config/hk/config.pkl
## Source Database Details

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** hk
- **Version Scheme:** 0
- **Revision:** 0
- **Head Version:** HEAD
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** no
- **URL Keys:** head, stable

## Other Package-Manager Records

- MacPorts - hk: normalized package name match | MacPorts ports tree: devel/hk/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1
- Scoop - main/hk: normalized package name match | Scoop official bucket manifest trees: bucket/hk.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1


## Related links

- [Source-control packages](https://www.automicvault.com/pkg/source-control-tools/) - Belongs to a source-control command family.
- [Terminal utility packages](https://www.automicvault.com/pkg/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Text processing packages](https://www.automicvault.com/pkg/text-processing-tools/) - Matched text, document, or structured-data processing metadata.
- [Developer build packages](https://www.automicvault.com/pkg/developer-build-tools/) - Matched build, compiler, generator, or developer workflow metadata.
- [openssl@3](https://www.automicvault.com/pkg/brew/openssl-3/) - Runtime dependency declared by Homebrew.
- [pkl](https://www.automicvault.com/pkg/brew/pkl/) - Runtime dependency declared by Homebrew.
- [usage](https://www.automicvault.com/pkg/brew/usage/) - Runtime dependency declared by Homebrew.
- [rust](https://www.automicvault.com/pkg/brew/rust/) - Build dependency declared by Homebrew.
- [pre-commit](https://www.automicvault.com/pkg/brew/pre-commit/) - Shares av.db curated category or tags: cli, developer-tools, git-hooks, linting, version-control.
- [commitlint](https://www.automicvault.com/pkg/brew/commitlint/) - Shares av.db curated category or tags: cli, developer-tools, linting, version-control.
- [committed](https://www.automicvault.com/pkg/brew/committed/) - Shares av.db curated category or tags: cli, developer-tools, pre-commit, version-control.
- [git-hooks-go](https://www.automicvault.com/pkg/brew/git-hooks-go/) - Shares av.db curated category or tags: cli, developer-tools, git-hooks, version-control.
- [lefthook](https://www.automicvault.com/pkg/brew/lefthook/) - Shares av.db curated category or tags: cli, developer-tools, git-hooks, version-control.
- [aicommit](https://www.automicvault.com/pkg/brew/aicommit/) - Shares av.db curated category or tags: cli, developer-tools, version-control.
- [aicommit2](https://www.automicvault.com/pkg/brew/aicommit2/) - Shares av.db curated category or tags: cli, developer-tools, version-control.
- [aicommits](https://www.automicvault.com/pkg/brew/aicommits/) - Shares av.db curated category or tags: cli, developer-tools, version-control.

## Combined YAML source

View the package source record on GitHub. [combined/hk.yml](https://github.com/automic-vault/db/blob/main/combined/hk.yml)


## Sources

- Nucleus package database
- Geiger risk classifier
- package-page enrichment
- curated configuration and credential file locations
- curated package history
- package version freshness
- av.db category and tag curation
- package relationship graph
- external package-manager database matches
- cross-ecosystem install command graph
