macOS
brew install pre-commitlocal Homebrew formula metadata
sudo port install pre-commitMacPorts ports tree · python/pre-commit/Portfile · 来源: api.github.com
安装
brew install pre-commitlocal Homebrew formula metadata
sudo port install pre-commitMacPorts ports tree · python/pre-commit/Portfile · 来源: api.github.com
sudo apk add pre-commitAlpine Linux edge package indexes · pre-commit · 来源: dl-cdn.alpinelinux.org
sudo apt install pre-commitDebian stable package indexes · pre-commit · 来源: deb.debian.org
sudo dnf install pre-commitFedora Rawhide package metadata · pre-commit · 来源: dl.fedoraproject.org
nix profile install nixpkgs#pre-commitnixpkgs package indexes · pkgs/by-name/pr/pre-commit/package.nix · 来源: api.github.com
sudo pacman -S pre-commitArch Linux sync databases · pre-commit · 来源: geo.mirror.pkgbuild.com
概览
Framework for managing multi-language pre-commit hooks
历史
pre-commit is a framework and multi-language package manager for installing and running reusable Git hooks.
pre-commit began in 2014 to replace copied, project-specific Git-hook scripts with reusable hooks that could be shared across repositories and implemented in different languages. Anthony Sottile has been the principal maintainer.
Version 1.0.0 in 2017 formalized semantic versioning and introduced the modern top-level-map configuration format. The project continued broadening language support and refining isolated toolchain installation, reaching the 4.x series in 2024.
pre-commit became broadly distributed across Linux and macOS package managers in addition to its native Python installation routes. Its language adapters let repositories consume hooks implemented in ecosystems such as Python, Node, Ruby, Go, Rust, Docker, and others without requiring every toolchain to be managed directly by each project.
The framework's configuration convention and reusable hook repositories made it a common integration point for formatters, linters, security checks, and repository-policy tools. It is also routinely run in CI against all files, complementing its local Git-hook role.
A project places .pre-commit-config.yaml at its repository root, listing hook repositories, pinned revisions, and selected hooks. Running pre-commit install writes the Git hook, after which configured checks run during commits or other selected Git stages.
pre-commit run --all-files is commonly used for initial adoption and CI. pre-commit autoupdate refreshes configured hook revisions, while the framework caches isolated hook environments for reuse.
pre-commit describes itself as a multi-language package manager for hooks. That framing is important to package enthusiasts: it resolves hook repositories and revisions, creates isolated environments, bootstraps supported runtimes where possible, and reuses cached installations.
Its ecosystem separates the orchestration framework, hook-provider repositories, and project-local YAML policy. This makes heterogeneous developer tooling reproducible without forcing an application's primary dependency manager to own every linter or formatter.
安全态势
narrow executable package without higher-risk signals.
绿色 风险 · 低 置信度 · appliance
在无人值守的代理使用前,请检查该工具是否读取明文凭据、写入远程状态、发布制品或调用插件。
local files
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.
Config paths the tool may read or write during local use.
.pre-commit-config.yaml可执行文件
| 命令 | 类型 | 暴露范围 | 备注 |
|---|---|---|---|
pre-commit | cli | 全局可执行文件 |
新鲜度
这些信号区分页生成时间、软件包管理器活动和上游发布比较。只有存在证据 URL 和可比较版本时,才会提示版本落后。
安装元数据
| 软件包键 | brew:pre-commit |
|---|---|
| 版本 | 4.6.2 |
| 软件包管理器 | Homebrew |
| 软件包管理器页面 | https://formulae.brew.sh/formula/pre-commit |
| 主页 | https://pre-commit.com/ |
| 仓库 | https://github.com/pre-commit/pre-commit |
| 上游文档 | https://pre-commit.com/ |
| 许可证 | MIT |
| 源码归档 | https://files.pythonhosted.org/packages/74/89/1f3e8e1fc3e97de0fa963495832f581f025f29471602a309e48808244292/pre_commit-4.6.2.tar.gz |
| 最后更新 | 2026-09-11T23:11:18Z |
| Pulse | updated |
| 依赖 | libyaml, python@3.14 |
| Bottle | 可用 (于 arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux) |
| Homebrew post-install | 未定义 |
| 服务 | 未声明 |
注册表事实
| Source Database | Homebrew formula API |
|---|---|
| Tap | homebrew/core |
| Full Name | pre-commit |
| 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 |
|
源数据库匹配
匹配项来自外部软件包管理器索引,并与本地 Automic Vault 软件包链接分开显示。
pre-commit 4.2.0-2
Git pre-commit hook framework
sudo apt install pre-commitpre-commit
nix profile install nixpkgs#pre-commitpre-commit 3.6.2-1
Git pre-commit hook framework
sudo apt install pre-commitpre-commit 4.6.2-r0
framework for managing and maintaining multi-language pre-commit hooks
sudo apk add pre-commitpre-commit-pyc 4.6.2-r0
Precompiled Python bytecode for pre-commit
sudo apk add pre-commit-pycpre-commit 4.6.2-1.fc45
Framework for managing and maintaining multi-language pre-commit hooks
sudo dnf install pre-commitpre-commit 4.6.2-1
A framework for managing and maintaining multi-language pre-commit hooks
https://github.com/pre-commit/pre-commit
sudo pacman -S pre-commitpre-commit
sudo port install pre-commit来源线索
此页面由 av-web 从 scripts/generate-pkg-sqlite.py 生成的私有软件包 SQLite 工件提供。
View the package source record on GitHub.