j178 /prek
⚡ A fast Git hook manager written in Rust, designed as a drop-in alternative to pre-commit, reimagined.
★ 8,800⑂ 253👁 14⑃ 2,286● 699▤ 103
+3
日增长
8,800
stars
253
forks
14
watchers
2,286
prs
699
issues
103
releases
README
Installation • Quick start • Documentation About prek is a framework for running hooks on your code. It runs them before you commit changes, on demand, or in CI. These hooks can format files, catch lint errors, detect secrets, or run any other command your project defines. prek also installs and manages the tools and dependencies they need. You may already be familiar with the pre-commit tool. prek is a reimagined version of it, built in Rust. It is faster and distributed as a single binary with no runtime dependencies. It is fully compatible with pre-commit configurations and hooks, so you can use it as a drop-in replacement without changing your setup. Although prek is pretty new, it’s already powering real‑world projects like CPython, Apache Airflow, FastAPI, and more projects are picking it up—see Who is using prek?. If you’re looking for an alternative to pre-commit, please give it a try—we’d love your feedback! Features - A single binary with no dependencies, does not require Python or any other runtime. - Faster than pre-commit and more efficient in disk space usage. - Fully compatible with the original pre-commit configurations and hooks. - Built-in support for monorepos (i.e. workspace mode), including concurrent execution for independent same-depth projects. - Integration with uv for managing Python virtual environments and dependencies. - Improved toolchain installations for Python, Node.js, Bun, Go, Rust and Ruby, shared between hooks. - Built-in Rust-native implementation of some common hooks. Installation Standalone installer prek provides a standalone installer script to download and install the tool, On Linux and macOS: bash curl --proto '=https' --tlsv1.2 -LsSf https://github.com/j178/prek/releases/download/v0.5.10/prek-installer.sh | sh On Windows: powershell powershell -ExecutionPolicy ByPass -c "irm https://github.com/j178/prek/releases/download/v0.5.10/prek-installer.ps1 | iex" PyPI prek is published as Python binary wheel to PyPI, you can install it using pip, uv (recommended), or pipx: bash Using uv (recommended) uv tool install prek Using uvx (install and run in one command) uvx prek Adding prek to the project dev-dependencies uv add --dev prek Using pip pip install prek Using pipx pipx install prek Homebrew bash brew install prek mise To use prek with mise (v2025.8.11 or later): bash mise use prek Cargo binstall Install pre-compiled binaries from GitHub using cargo-binstall: bash cargo binstall prek Cargo Build from source using Cargo (Rust 1.97+ is required): bash cargo install --locked prek npmjs prek is published as a Node.js package and can be installed with any npm-compatible package manager: bash As a dev dependency npm add -D @j178/prek pnpm add -D @j178/prek bun add -D @j178/prek Or install globally npm install -g @j178/prek pnpm add -g @j178/prek bun install -g @j178/prek Or run directly without instal
Top issues
#1675Proposal: uv-synced Python hook environments (lockfile + groups)21 comments · 2026-02-19#785Supprt `pyproject.toml` based config20 comments · 2025-09-22#1238Remote pre-commit configuration9 comments · 2025-12-18#1054Feature: Hook version sync8 comments · 2025-11-09#1051Add support for automatic re-commit after formatter hooks (Black/Ruff)7 comments · 2025-11-09#73hi4 comments · 2024-11-18#2154Explore OS-level sandboxing for hook execution3 comments · 2026-06-05#2349Project-aware hooks cannot access project dependency environments2 comments · 2026-07-15
Discussions
#3015Add `check` and `fix` commands for `read_only` hook filtering0 comments · 2026-11-06#2971OpenTelemetry1 comments · 2026-10-28#2970new `forbid-merge-commits` built-in to prevent merges of main to feature/x to main to feature/y to main to ...0 comments · 2026-10-27#2969Temporarily save untracked files, like you do for unstaged changes in a file0 comments · 2026-10-27#2966Allow `repo: local` hooks to inherit remote definitions with `extends`2 comments · 2026-10-27#2929Support plugins with wasm (Rust ....)0 comments · 2026-10-21#2927New builtin hook for simple search and replace2 comments · 2026-10-21#2881Proposal: Filter `prek update` candidates using GitHub release stability and immutability metadata0 comments · 2026-10-15
Latest release
0.5.10 v0.5.10 2026-11-04Release Notes Released on 2026-11-04. Enhancements - Add a builtin replace-pattern hook (2981) Bug fixes - Avoid downloading Node prereleases by default (2995) - Keep file checks out of rayon's recursive frames (2999) - Skip Node releases without a compatible archive (2996) Documentation - Add equivalent prek.toml examples throughout the documentation (2979) Contributors - @connorbrinton - @j178 Install prek 0.5.10 Install prebuilt binaries via shell script sh curl --proto '=https' --tlsv1.2 -LsSf https://github.com/j178/prek/releases/download/v0.5.10/prek-installer.sh | sh