Automic VaultAutomic Vault

brew

使用 Homebrew, MacPorts, scoop 安装 hk

查看 hk 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

安装

其他安装命令

macOS

Homebrew已验证 · 100%
brew install hk

local Homebrew formula metadata

MacPorts已验证 · 94%
sudo port install hk

MacPorts ports tree · devel/hk/Portfile · 来源: api.github.com

Windows

Scoop已验证 · 92%
scoop install main/hk

Scoop official bucket manifest trees · bucket/hk.json · 来源: api.github.com

概览

软件包摘要

Git hook and pre-commit lint manager

命令和别名

  • generate-docs
  • hk

历史

项目历史与用法

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.

项目历史

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.

采用历史

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.

使用方式

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.

为什么软件包爱好者会关心

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.

时间线

  • 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.

安全态势

风险级别:绿色

narrow executable package without higher-risk signals.

风险分类器

绿色 风险 · 低 置信度 · appliance

原因

  • narrow executable package without higher-risk signals

信号

  • metadata:no-higher-risk-signals

安装行为

  • formula 元数据中未记录 Homebrew post-install 钩子。
  • Homebrew bottle 元数据适用于 6 个平台目标。
  • 安装时包含 2 个运行时依赖。
  • 构建元数据列出 2 个构建依赖。

建议审查

在无人值守的代理使用前,请检查该工具是否读取明文凭据、写入远程状态、发布制品或调用插件。

local files

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

Config paths the tool may read or write during local use.

Unix
hk.local.pkl.config/hk.local.pklhk.pkl.config/hk.pkl~/.config/hk/config.pkl

可执行文件

已安装的可执行文件

命令类型暴露范围备注
generate-docscli全局可执行文件
hkcli全局可执行文件

新鲜度

版本和新鲜度

这些信号区分页生成时间、软件包管理器活动和上游发布比较。只有存在证据 URL 和可比较版本时,才会提示版本落后。

页面生成时间2026-07-25
管理器版本1.53.0
管理器更新时间2026-07-25
本地数据OK
上游not checked
检测到的最新版本未检测到

https://github.com/jdx/hk

安装元数据

软件包元数据

软件包键brew:hk
版本1.53.0
软件包管理器Homebrew
软件包管理器页面https://formulae.brew.sh/formula/hk
主页https://hk.jdx.dev
仓库https://github.com/jdx/hk
上游文档https://hk.jdx.dev/
许可证MIT
源码归档https://github.com/jdx/hk.git
最后更新2026-07-25T01:00:14Z
Pulseupdated
依赖openssl@3, usage
构建依赖pkl, rust
Bottle可用 (于 arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux)
Homebrew post-install未定义
服务未声明

注册表事实

源数据库详情

Source DatabaseHomebrew formula API
Taphomebrew/core
Full Namehk
Version Scheme0
Revision0
Head VersionHEAD
Bottle Stable Root URLhttps://ghcr.io/v2/homebrew/core
Deprecatedno
Disabledno
Keg Onlyno
URL Keys
  • head
  • stable

源数据库匹配

其他软件包管理器记录

匹配项来自外部软件包管理器索引,并与本地 Automic Vault 软件包链接分开显示。

MacPorts95%

hk

sudo port install hk
  • normalized package name match
  • 匹配方式:Hk
MacPorts ports tree · api.github.com · MacPorts ports tree: devel/hk/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1
Scoop95%

main/hk

scoop install main/hk
  • normalized package name match
  • 匹配方式:Hk
Scoop official bucket manifest trees · api.github.com · Scoop official bucket manifest trees: bucket/hk.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1

来源线索

由仓库数据生成

此页面由 av-webscripts/generate-pkg-sqlite.py 生成的私有软件包 SQLite 工件提供。

Combined YAML source

View the package source record on GitHub.

combined/hk.yml

使用的来源

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