pkg.soopen package index

brew / 排名 368

使用 Homebrew, apk, apt, dnf, MacPorts, Nix, pacman 安装 pre-commit

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

安装

其他安装命令

macOS

Homebrew已验证 · 100%
brew install pre-commit

local Homebrew formula metadata

MacPorts已验证 · 94%
sudo port install pre-commit

MacPorts ports tree · python/pre-commit/Portfile · 来源: api.github.com

Linux

Alpine Linux apk已验证 · 92%
sudo apk add pre-commit

Alpine Linux edge package indexes · pre-commit · 来源: dl-cdn.alpinelinux.org

Debian apt已验证 · 92%
sudo apt install pre-commit

Debian stable package indexes · pre-commit · 来源: deb.debian.org

Fedora dnf已验证 · 92%
sudo dnf install pre-commit

Fedora Rawhide package metadata · pre-commit · 来源: dl.fedoraproject.org

Nix已验证 · 92%
nix profile install nixpkgs#pre-commit

nixpkgs package indexes · pkgs/by-name/pr/pre-commit/package.nix · 来源: api.github.com

Arch Linux pacman已验证 · 92%
sudo pacman -S pre-commit

Arch Linux sync databases · pre-commit · 来源: geo.mirror.pkgbuild.com

概览

软件包摘要

Framework for managing multi-language pre-commit hooks

命令和别名

  • pre-commit

历史

项目历史与用法

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.

时间线

  • 2014: Version 0.1.0 was released.
  • 2017: Version 1.0.0 adopted semantic versioning and introduced the modern configuration structure.
  • 2024: Version 4.0.0 removed the deprecated python_venv language alias and updated hook-stage naming.
  • 2025: Version 4.1.0 added Julia hook support.

Related projects

  • pre-commit/pre-commit-hooks is the official collection of general-purpose hooks released alongside the framework.
  • pre-commit.ci applies the same configuration in hosted continuous integration.
  • Individual formatter, linter, and security-tool repositories can publish hooks through a .pre-commit-hooks.yaml manifest.

安全态势

风险级别:绿色

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 个运行时依赖。

建议审查

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

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
.pre-commit-config.yaml

可执行文件

已安装的可执行文件

命令类型暴露范围备注
pre-commitcli全局可执行文件

新鲜度

版本和新鲜度

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

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

https://pre-commit.com/

安装元数据

软件包元数据

软件包键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
Pulseupdated
依赖libyaml, python@3.14
Bottle可用 (于 arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux)
Homebrew post-install未定义
服务未声明

注册表事实

源数据库详情

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

源数据库匹配

其他软件包管理器记录

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

Debian apt95%

pre-commit 4.2.0-2

Git pre-commit hook framework

https://pre-commit.com

sudo apt install pre-commit
  • Section: utils
  • Architecture: all
  • 6 依赖
  • normalized package name match
  • 匹配方式:Pre Commit
Debian stable package indexes · deb.debian.org · Debian stable package indexes: pre-commit from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz
Nix95%

pre-commit

nix profile install nixpkgs#pre-commit
  • normalized package name match
  • 匹配方式:Pre Commit
nixpkgs package indexes · api.github.com · nixpkgs package indexes: pkgs/by-name/pr/pre-commit/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
Ubuntu apt95%

pre-commit 3.6.2-1

Git pre-commit hook framework

https://pre-commit.com

sudo apt install pre-commit
  • Section: universe/utils
  • Architecture: all
  • 6 依赖
  • normalized package name match
  • 匹配方式:Pre Commit
Ubuntu 24.04 LTS package indexes · archive.ubuntu.com · Ubuntu 24.04 LTS package indexes: pre-commit from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz
apk95%

pre-commit 4.6.2-r0

framework for managing and maintaining multi-language pre-commit hooks

https://pre-commit.com

sudo apk add pre-commit
  • License: MIT
  • Architecture: x86_64
  • Source Package: pre-commit
  • 1 依赖
  • 1 提供
  • normalized package name match
  • 匹配方式:Pre Commit
Alpine Linux edge package indexes · dl-cdn.alpinelinux.org · Alpine Linux edge package indexes: pre-commit from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz
apk95%

pre-commit-pyc 4.6.2-r0

Precompiled Python bytecode for pre-commit

https://pre-commit.com

sudo apk add pre-commit-pyc
  • License: MIT
  • Architecture: x86_64
  • Source Package: pre-commit
  • 1 依赖
  • normalized package name match
  • 匹配方式:Pre Commit
Alpine Linux edge package indexes · dl-cdn.alpinelinux.org · Alpine Linux edge package indexes: pre-commit-pyc from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz
dnf95%

pre-commit 4.6.2-1.fc45

Framework for managing and maintaining multi-language pre-commit hooks

https://pre-commit.com

sudo dnf install pre-commit
  • License: MIT
  • Category: Unspecified
  • Architecture: noarch
  • Source Package: pre-commit
  • 5 依赖
  • 3 提供
  • normalized package name match
  • 匹配方式:Pre Commit
Fedora Rawhide package metadata · dl.fedoraproject.org · Fedora Rawhide package metadata: pre-commit from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/652278618dec9c023176a80c435a32a2c8154869fb0eb662c267a54df28d77d9-primary.xml.zst
pacman95%

pre-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-commit
  • License: MIT
  • Architecture: any
  • 6 依赖
  • 1 提供
  • normalized package name match
  • 匹配方式:Pre Commit
Arch Linux sync databases · geo.mirror.pkgbuild.com · Arch Linux sync databases: pre-commit from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz
MacPorts95%

pre-commit

sudo port install pre-commit
  • normalized package name match
  • 匹配方式:Pre Commit
MacPorts ports tree · api.github.com · MacPorts ports tree: python/pre-commit/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

来源线索

由仓库数据生成

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

使用的来源

  • Geiger risk classifier
  • 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
  • pkg.so package database
  • pkgdb category and tag curation