{"id":30183496,"url":"https://github.com/j178/prek","last_synced_at":"2026-01-22T06:00:41.635Z","repository":{"id":260052936,"uuid":"868811259","full_name":"j178/prek","owner":"j178","description":"⚡ Better `pre-commit`, re-engineered in Rust","archived":false,"fork":false,"pushed_at":"2026-01-21T14:13:09.000Z","size":5889,"stargazers_count":3776,"open_issues_count":69,"forks_count":118,"subscribers_count":11,"default_branch":"master","last_synced_at":"2026-01-21T15:20:49.302Z","etag":null,"topics":["git","git-hooks","pre-commit"],"latest_commit_sha":null,"homepage":"https://prek.j178.dev/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/j178.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"j178"}},"created_at":"2024-10-07T08:21:29.000Z","updated_at":"2026-01-21T14:44:47.000Z","dependencies_parsed_at":"2025-12-30T18:02:29.934Z","dependency_job_id":null,"html_url":"https://github.com/j178/prek","commit_stats":{"total_commits":243,"total_committers":5,"mean_commits":48.6,"dds":"0.020576131687242816","last_synced_commit":"f5772a2f059f997d0c82c48a7a150374bfef8e2d"},"previous_names":["j178/pre-commit-rs","j178/prefligit","j178/prek"],"tags_count":65,"template":false,"template_full_name":null,"purl":"pkg:github/j178/prek","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/j178%2Fprek","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/j178%2Fprek/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/j178%2Fprek/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/j178%2Fprek/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/j178","download_url":"https://codeload.github.com/j178/prek/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/j178%2Fprek/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28656591,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-22T01:17:37.254Z","status":"online","status_checked_at":"2026-01-22T02:00:07.137Z","response_time":144,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["git","git-hooks","pre-commit"],"created_at":"2025-08-12T11:02:14.049Z","updated_at":"2026-01-22T06:00:41.598Z","avatar_url":"https://github.com/j178.png","language":"Rust","readme":"\u003cdiv align=\"center\"\u003e\n\n\u003ch1\u003e\n  \u003cimg width=\"180\" alt=\"prek\" src=\"https://raw.githubusercontent.com/j178/prek/master/docs/assets/logo.webp\" /\u003e\n  \u003cbr/\u003eprek\n\u003c/h1\u003e\n\n[![prek](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/j178/prek/master/docs/assets/badge-v0.json)](https://github.com/j178/prek)\n[![codecov](https://codecov.io/github/j178/prek/graph/badge.svg?token=MP6TY24F43)](https://codecov.io/github/j178/prek)\n[![GitHub Downloads](https://img.shields.io/github/downloads/j178/prek/total?logo=github)](https://github.com/j178/prek/releases)\n[![PyPI Downloads](https://img.shields.io/pypi/dm/prek?logo=python)](https://pepy.tech/projects/prek)\n[![Discord](https://img.shields.io/discord/1403581202102878289?logo=discord)](https://discord.gg/3NRJUqJz86)\n\n\u003c/div\u003e\n\n\u003c!-- --8\u003c-- [start: description] --\u003e\n\n[pre-commit](https://pre-commit.com/) is a framework to run hooks written in many languages, and it manages the\nlanguage toolchain and dependencies for running the hooks.\n\n*prek* is a reimagined version of pre-commit, built in Rust.\nIt is designed to be a faster, dependency-free and drop-in alternative for it,\nwhile also providing some additional long-requested features.\n\n\u003c!-- --8\u003c-- [end: description] --\u003e\n\n\u003e [!NOTE]\n\u003e Although prek is pretty new, it’s already powering real‑world projects like [CPython](https://github.com/python/cpython), [Apache Airflow](https://github.com/apache/airflow), [FastAPI](https://github.com/fastapi/fastapi), and more projects are picking it up—see [Who is using prek?](#who-is-using-prek). If you’re looking for an alternative to `pre-commit`, please give it a try—we’d love your feedback!\n\u003e\n\u003e Please note that some subcommands and languages are still missing for full drop‑in parity with `pre-commit`. Track the remaining gaps here: [TODO](https://prek.j178.dev/todo/).\n\n\u003c!-- --8\u003c-- [start:features] --\u003e\n\n## Features\n\n- 🚀 A single binary with no dependencies, does not require Python or any other runtime.\n- ⚡ [Faster](https://prek.j178.dev/benchmark/) than `pre-commit` and more efficient in disk space usage.\n- 🔄 Fully compatible with the original pre-commit configurations and hooks.\n- 🏗️ Built-in support for monorepos (i.e. [workspace mode](https://prek.j178.dev/workspace/)).\n- 🐍 Integration with [`uv`](https://github.com/astral-sh/uv) for managing Python virtual environments and dependencies.\n- 🛠️ Improved toolchain installations for Python, Node.js, Bun, Go, Rust and Ruby, shared between hooks.\n- 📦 [Built-in](https://prek.j178.dev/builtin/) Rust-native implementation of some common hooks.\n\n\u003c!-- --8\u003c-- [end:features] --\u003e\n\n## Table of contents\n\n- [Installation](#installation)\n- [Quick start](#quick-start)\n- [Why prek?](#why-prek)\n- [Who is using prek?](#who-is-using-prek)\n- [Acknowledgements](#acknowledgements)\n\n## Installation\n\n\u003cdetails\u003e\n\u003csummary\u003eStandalone installer\u003c/summary\u003e\n\nprek provides a standalone installer script to download and install the tool,\n\nOn Linux and macOS:\n\n\u003c!-- --8\u003c-- [start: linux-standalone-install] --\u003e\n\n```bash\ncurl --proto '=https' --tlsv1.2 -LsSf https://github.com/j178/prek/releases/download/v0.3.0/prek-installer.sh | sh\n```\n\n\u003c!-- --8\u003c-- [end: linux-standalone-install] --\u003e\n\nOn Windows:\n\n\u003c!-- --8\u003c-- [start: windows-standalone-install] --\u003e\n\n```powershell\npowershell -ExecutionPolicy ByPass -c \"irm https://github.com/j178/prek/releases/download/v0.3.0/prek-installer.ps1 | iex\"\n```\n\n\u003c!-- --8\u003c-- [end: windows-standalone-install] --\u003e\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003ePyPI\u003c/summary\u003e\n\n\u003c!-- --8\u003c-- [start: pypi-install] --\u003e\n\nprek is published as Python binary wheel to PyPI, you can install it using `pip`, `uv` (recommended), or `pipx`:\n\n```bash\n# Using uv (recommended)\nuv tool install prek\n\n# Using uvx (install and run in one command)\nuvx prek\n\n# Adding prek to the project dev-dependencies\nuv add --dev prek\n\n# Using pip\npip install prek\n\n# Using pipx\npipx install prek\n```\n\n\u003c!-- --8\u003c-- [end: pypi-install] --\u003e\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eHomebrew\u003c/summary\u003e\n\n\u003c!-- --8\u003c-- [start: homebrew-install] --\u003e\n\n```bash\nbrew install prek\n```\n\n\u003c!-- --8\u003c-- [end: homebrew-install] --\u003e\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003emise\u003c/summary\u003e\n\n\u003c!-- --8\u003c-- [start: mise-install] --\u003e\n\nTo use prek with [mise](https://mise.jdx.dev) ([v2025.8.11](https://github.com/jdx/mise/releases/tag/v2025.8.11) or later):\n\n```bash\nmise use prek\n```\n\n\u003c!-- --8\u003c-- [end: mise-install] --\u003e\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eCargo binstall\u003c/summary\u003e\n\n\u003c!-- --8\u003c-- [start: cargo-binstall] --\u003e\n\nInstall pre-compiled binaries from GitHub using [cargo-binstall](https://github.com/cargo-bins/cargo-binstall):\n\n```bash\ncargo binstall prek\n```\n\n\u003c!-- --8\u003c-- [end: cargo-binstall] --\u003e\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eCargo\u003c/summary\u003e\n\n\u003c!-- --8\u003c-- [start: cargo-install] --\u003e\n\nBuild from source using Cargo (Rust 1.89+ is required):\n\n```bash\ncargo install --locked prek\n```\n\n\u003c!-- --8\u003c-- [end: cargo-install] --\u003e\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003enpmjs\u003c/summary\u003e\n\n\u003c!-- --8\u003c-- [start: npmjs-install] --\u003e\n\nprek is published as a Node.js package, you can install it using `npm`, `pnpm`, or `npx`:\n\n```bash\n# Using npm\nnpm add -D @j178/prek\n\n# Using pnpm\npnpm add -D @j178/prek\n\n# Using npx\nnpx @j178/prek --version\n\n# or install globally\nnpm install -g @j178/prek\n\n# then use `prek` command\nprek --version\n```\n\n\u003c!-- --8\u003c-- [end: npmjs-install] --\u003e\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eNix\u003c/summary\u003e\n\n\u003c!-- --8\u003c-- [start: nix-install] --\u003e\n\nprek is available via [Nixpkgs](https://search.nixos.org/packages?channel=unstable\u0026show=prek\u0026query=prek).\n\n```shell\n# Choose what's appropriate for your use case.\n# One-off in a shell:\nnix-shell -p prek\n\n# NixOS or non-NixOS without flakes:\nnix-env -iA nixos.prek\n\n# Non-NixOS with flakes:\nnix profile install nixpkgs#prek\n```\n\n\u003c!-- --8\u003c-- [end: nix-install] --\u003e\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eConda\u003c/summary\u003e\n\n\u003c!-- --8\u003c-- [start: conda-forge-install] --\u003e\n\nprek is available as `prek` via [conda-forge](https://anaconda.org/conda-forge/prek).\n\n```shell\nconda install conda-forge::prek\n```\n\n\u003c!-- --8\u003c-- [end: conda-forge-install] --\u003e\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eScoop (Windows)\u003c/summary\u003e\n\n\u003c!-- --8\u003c-- [start: scoop-install] --\u003e\n\nprek is available via [Scoop](https://scoop.sh/#/apps?q=prek).\n\n```powershell\nscoop install main/prek\n```\n\n\u003c!-- --8\u003c-- [end: scoop-install] --\u003e\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eMacPorts\u003c/summary\u003e\n\n\u003c!-- --8\u003c-- [start: macports-install] --\u003e\n\nprek is available via [MacPorts](https://ports.macports.org/port/prek/).\n\n```bash\nsudo port install prek\n```\n\n\u003c!-- --8\u003c-- [end: macports-install] --\u003e\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eGitHub Releases\u003c/summary\u003e\n\n\u003c!-- --8\u003c-- [start: pre-built-binaries] --\u003e\n\nPre-built binaries are available for download from the [GitHub releases](https://github.com/j178/prek/releases) page.\n\n\u003c!-- --8\u003c-- [end: pre-built-binaries] --\u003e\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eGitHub Actions\u003c/summary\u003e\n\n\u003c!-- --8\u003c-- [start: github-actions] --\u003e\n\nprek can be used in GitHub Actions via the [j178/prek-action](https://github.com/j178/prek-action) repository.\n\nExample workflow:\n\n```yaml\nname: Prek checks\non: [push, pull_request]\n\njobs:\n  prek:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v6\n      - uses: j178/prek-action@v1\n```\n\nThis action installs prek and runs `prek run --all-files` on your repository.\n\nprek is also available via [`taiki-e/install-action`](https://github.com/taiki-e/install-action) for installing various tools.\n\n\u003c!-- --8\u003c-- [end: github-actions] --\u003e\n\n\u003c/details\u003e\n\n\u003c!-- --8\u003c-- [start: self-update] --\u003e\n\nIf installed via the standalone installer, prek can update itself to the latest version:\n\n```bash\nprek self update\n```\n\n\u003c!-- --8\u003c-- [end: self-update] --\u003e\n\n## Quick start\n\n- **I already use pre-commit:** follow the short migration checklist in the [quickstart guide](https://prek.j178.dev/quickstart/#already-using-pre-commit) to swap in `prek` safely.\n- **I'm new to pre-commit-style tools:** learn the basics—creating a config, running hooks, and installing git hooks—in the [beginner quickstart walkthrough](https://prek.j178.dev/quickstart/#new-to-pre-commit-style-workflows).\n\n\u003c!-- --8\u003c-- [start: why] --\u003e\n\n## Why prek?\n\n### prek is faster\n\n- It is [multiple times faster](https://prek.j178.dev/benchmark/) than `pre-commit` and takes up half the disk space.\n- It redesigned how hook environments and toolchains are managed, they are all shared between hooks, which reduces the disk space usage and speeds up the installation process.\n- Repositories are cloned in parallel, and hooks are installed in parallel if their dependencies are disjoint.\n- Hooks can run in parallel by priority (hooks with the same [`priority`](https://prek.j178.dev/configuration/#priority) may run concurrently), reducing end-to-end runtime.\n- It uses [`uv`](https://github.com/astral-sh/uv) for creating Python virtualenvs and installing dependencies, which is known for its speed and efficiency.\n- It implements some common hooks in Rust, [built in prek](https://prek.j178.dev/builtin/), which are faster than their Python counterparts.\n- It supports `repo: builtin` for offline, zero-setup hooks, which is not available in `pre-commit`.\n\n### prek provides a better user experience\n\n- No need to install Python or any other runtime, just download a single binary.\n- No hassle with your Python version or virtual environments, prek automatically installs the required Python version and creates a virtual environment for you.\n- Built-in support for [workspaces](https://prek.j178.dev/workspace/) (or monorepos), each subproject can have its own `.pre-commit-config.yaml` file.\n- [`prek run`](https://prek.j178.dev/cli/#prek-run) has some nifty improvements over `pre-commit run`, such as:\n    - `prek run --directory \u003cdir\u003e` runs hooks for files in the specified directory, no need to use `git ls-files -- \u003cdir\u003e | xargs pre-commit run --files` anymore.\n    - `prek run --last-commit` runs hooks for files changed in the last commit.\n    - `prek run [HOOK] [HOOK]` selects and runs multiple hooks.\n- [`prek list`](https://prek.j178.dev/cli/#prek-list) command lists all available hooks, their ids, and descriptions, providing a better overview of the configured hooks.\n- [`prek auto-update`](https://prek.j178.dev/cli/#prek-auto-update) supports `--cooldown-days` to mitigate open source supply chain attacks.\n- prek provides shell completions for `prek run \u003chook_id\u003e` command, making it easier to run specific hooks without remembering their ids.\n\nFor more detailed improvements prek offers, take a look at [Difference from pre-commit](https://prek.j178.dev/diff/).\n\n## Who is using prek?\n\nprek is pretty new, but it is already being used or recommend by some projects and organizations:\n\n- [apache/airflow](https://github.com/apache/airflow/issues/44995)\n- [python/cpython](https://github.com/python/cpython/issues/143148)\n- [pdm-project/pdm](https://github.com/pdm-project/pdm/pull/3593)\n- [fastapi/fastapi](https://github.com/fastapi/fastapi/pull/14572)\n- [fastapi/typer](https://github.com/fastapi/typer/pull/1453)\n- [fastapi/asyncer](https://github.com/fastapi/asyncer/pull/437)\n- [astral-sh/ruff](https://github.com/astral-sh/ruff/pull/22505)\n- [astral-sh/ty](https://github.com/astral-sh/ty/pull/2469)\n- [home-assistant/core](https://github.com/home-assistant/core/pull/160427)\n- [DetachHead/basedpyright](https://github.com/DetachHead/basedpyright/pull/1413)\n- [OpenLineage/OpenLineage](https://github.com/OpenLineage/OpenLineage/pull/3965)\n- [authlib/authlib](https://github.com/authlib/authlib/pull/804)\n- [django/djangoproject.com](https://github.com/django/djangoproject.com/pull/2252)\n- [Future-House/paper-qa](https://github.com/Future-House/paper-qa/pull/1098)\n- [requests-cache/requests-cache](https://github.com/requests-cache/requests-cache/pull/1116)\n- [Goldziher/kreuzberg](https://github.com/Goldziher/kreuzberg/pull/142)\n- [python-attrs/attrs](https://github.com/python-attrs/attrs/commit/c95b177682e76a63478d29d040f9cb36a8d31915)\n- [jlowin/fastmcp](https://github.com/jlowin/fastmcp/pull/2309)\n- [apache/iceberg-python](https://github.com/apache/iceberg-python/pull/2533)\n- [jcrist/msgspec](https://github.com/jcrist/msgspec/pull/918)\n- [python-humanize/humanize](https://github.com/python-humanize/humanize/pull/276)\n- [MoonshotAI/kimi-cli](https://github.com/MoonshotAI/kimi-cli/pull/535)\n- [simple-icons/simple-icons](https://github.com/simple-icons/simple-icons/pull/14245)\n- [ast-grep/ast-grep](https://github.com/ast-grep/ast-grep.github.io/commit/e30818144b2967a7f9172c8cf2f4596bba219bf5)\n- [commitizen-tools/commitizen](https://github.com/commitizen-tools/commitizen)\n\n\u003c!-- --8\u003c-- [end: why] --\u003e\n\n## Acknowledgements\n\nThis project is heavily inspired by the original [pre-commit](https://pre-commit.com/) tool, and it wouldn't be possible without the hard work\nof the maintainers and contributors of that project.\n\nAnd a special thanks to the [Astral](https://github.com/astral-sh) team for their remarkable projects, particularly [uv](https://github.com/astral-sh/uv),\nfrom which I've learned a lot on how to write efficient and idiomatic Rust code.\n","funding_links":["https://github.com/sponsors/j178"],"categories":["Development tools","Rust","Additional Resources and Tips","Development Tools"],"sub_categories":["Workflow Automation","Replacements"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fj178%2Fprek","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fj178%2Fprek","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fj178%2Fprek/lists"}