# j178/prek

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/j178-prek).**

6,297 stars · 167 forks · Rust · mit

## Links

- GitHub: https://github.com/j178/prek
- Homepage: https://prek.j178.dev/
- awesome-repositories: https://awesome-repositories.com/repository/j178-prek.md

## Topics

`git` `git-hooks` `pre-commit`

## Description

Prek is a Git hook manager written in Rust that runs configured hooks as a single binary without requiring Python or other external runtimes. It executes hooks faster than standard tools through parallel processing and bundled Rust implementations, and includes a built-in hook repository that enables fully offline operation without network access or environment setup. The tool supports both TOML and YAML configuration formats with identical semantics, and can run hooks from existing pre-commit configuration files without modification.

Prek distinguishes itself through workspace-aware monorepo support, discovering nested project configurations recursively and running hooks independently per project with parent-child ordering. It provides containerized hook execution inside Docker containers, managed language environments for Python, Node, Go, Rust, and other runtimes, and a configurable auto-update system that delays adoption of new hook revisions by a minimum age while validating pinned SHA revisions against upstream refs. The tool also offers parallel project discovery with caching, and can replace remote hook implementations with faster Rust-native versions automatically.

The tool manages the full hook lifecycle including installation of Git shims for automatic execution, selective hook execution by project or ID, dry-run previews, and CI integration. It supports file filtering by regex or glob patterns, hook execution ordering with numeric priority, and output control for debugging. Configuration validation, cache management, and migration from existing pre-commit setups are provided through dedicated commands.

## Tags

### Part of an Awesome List

- [Git Hook Managers](https://awesome-repositories.com/f/awesome-lists/devtools/git-hook-managers.md) — Runs and manages Git hooks across repositories with a single binary that requires no external runtime dependencies.
- [Developer Tools](https://awesome-repositories.com/f/awesome-lists/devtools/developer-tools.md) — Dependency-free alternative to pre-commit.

### Development Tools & Productivity

- [Git Hook Managers](https://awesome-repositories.com/f/development-tools-productivity/git-hook-managers.md) — Executes configured Git hooks as a single binary without requiring Python or other runtimes. ([source](https://cdn.jsdelivr.net/gh/j178/prek@master/README.md))
- [Pre-commit Hooks](https://awesome-repositories.com/f/development-tools-productivity/pre-commit-hooks.md) — Executes Git hooks defined in pre-commit config files using a single Rust binary without requiring Python or other runtimes.
- [Offline Hook Executions](https://awesome-repositories.com/f/development-tools-productivity/execution-hooks/hook-execution-rules/offline-hook-executions.md) — Runs hooks from a built-in repository without network access or environment setup, enabling fully offline operation. ([source](https://prek.j178.dev/builtin/))
- [Offline Hook Execution](https://awesome-repositories.com/f/development-tools-productivity/git-hook-definitions/webhook-and-hook-automation/offline-hook-execution.md) — Runs hooks from a built-in repository requiring no cloning, environment setup, or network connection. ([source](https://prek.j178.dev/builtin/))
- [Git Hooks](https://awesome-repositories.com/f/development-tools-productivity/git-hooks.md) — Natively executes common pre-commit hooks using Rust code bundled in the binary. ([source](https://prek.j178.dev/builtin/))
- [Directory-Scoped Hook Runs](https://awesome-repositories.com/f/development-tools-productivity/hook-frameworks/framework-specific-hooks/directory-scoped-hook-runs.md) — Applies each configuration file only to files within its own directory, supporting independent nested projects. ([source](https://prek.j178.dev/configuration/))
- [Monorepo Hook Execution](https://awesome-repositories.com/f/development-tools-productivity/monorepo-managers/monorepo-linting-configuration/monorepo-hook-execution.md) — Runs hooks across multiple independent projects in a monorepo concurrently with parent-child ordering. ([source](https://cdn.jsdelivr.net/gh/j178/prek@master/README.md))
- [Fast Hook Runners](https://awesome-repositories.com/f/development-tools-productivity/pre-commit-hooks/fast-hook-runners.md) — Executes configured Git hooks on all files up to four times faster than the standard pre-commit tool. ([source](https://prek.j178.dev/benchmark/))
- [Pre-Commit Migrations](https://awesome-repositories.com/f/development-tools-productivity/pre-commit-hooks/pre-commit-migrations.md) — Executes Git hooks from existing .pre-commit-config.yaml files without requiring configuration changes. ([source](https://prek.j178.dev/compatibility/index.md))
- [TOML Configuration Support](https://awesome-repositories.com/f/development-tools-productivity/project-configuration/toml-configuration-support.md) — Enables project configuration using structured TOML files for defining hook repositories and settings. ([source](https://prek.j178.dev/configuration/index.md))
- [Dual-Format Configuration Support](https://awesome-repositories.com/f/development-tools-productivity/project-configuration/toml-configuration-support/dual-format-configuration-support.md) — Supports a native TOML configuration format alongside standard YAML with a migration utility. ([source](https://cdn.jsdelivr.net/gh/j178/prek@master/README.md))
- [Nested Project Configurations](https://awesome-repositories.com/f/development-tools-productivity/project-scaffolding-config-code-generation/project-scaffolding-configuration/project-configuration/nested-project-configurations.md) — Scopes hook configurations to individual subdirectories, preventing parent configs from processing nested project files. ([source](https://prek.j178.dev/reference/configuration/))
- [Configuration Hooks](https://awesome-repositories.com/f/development-tools-productivity/startup-configurations/initialization-hooks/configuration-hooks.md) — Executes all hooks defined in the configuration file against the current workspace. ([source](https://prek.j178.dev/reference/cli/index.md))
- [Git Hook Configurations](https://awesome-repositories.com/f/development-tools-productivity/startup-configurations/initialization-hooks/configuration-hooks/git-hook-configurations.md) — Defines which hooks to run by listing repositories and hook IDs in a TOML or YAML configuration file. ([source](https://prek.j178.dev/quickstart/index.md))
- [Automatic Workspace Discoveries](https://awesome-repositories.com/f/development-tools-productivity/workspace-management/project-workspaces/automatic-workspace-discoveries.md) — Walks up the directory tree to find the workspace root and recursively discovers all projects with hook configurations. ([source](https://prek.j178.dev/workspace/))
- [Monorepo Hook Workspaces](https://awesome-repositories.com/f/development-tools-productivity/workspace-management/project-workspaces/workspace-aware-resolution/monorepo-hook-workspaces.md) — Discovers nested project configurations recursively and runs hooks independently per project with parent-child ordering.
- [Workspace Hook Execution](https://awesome-repositories.com/f/development-tools-productivity/workspace-management/project-workspaces/workspace-hook-execution.md) — Processes hooks across multiple projects in a monorepo concurrently with parent-child ordering. ([source](https://prek.j178.dev/workspace/))
- [Structural File Validators](https://awesome-repositories.com/f/development-tools-productivity/configuration-file-validators/structural-file-validators.md) — Checks files for whitespace issues, line endings, encoding markers, and JSON/TOML/YAML/XML validity before committing. ([source](https://prek.j178.dev/builtin/index.md))
- [Staged File Processors](https://awesome-repositories.com/f/development-tools-productivity/developer-utilities-libraries/file-processing-utilities/staged-file-processors.md) — Executes configured hooks against files in the Git staging area. ([source](https://prek.j178.dev/quickstart/))
- [Hook File Filters](https://awesome-repositories.com/f/development-tools-productivity/file-ignore-patterns/linting-file-filters/hook-file-filters.md) — Applies include and exclude patterns to candidate file paths before hooks run. ([source](https://prek.j178.dev/reference/configuration/))
- [Concurrent Hook Executions](https://awesome-repositories.com/f/development-tools-productivity/lifecycle-automation-hooks/project-generation-hooks/concurrent-hook-executions.md) — Executes hooks concurrently by priority and independent projects in parallel. ([source](https://prek.j178.dev/diff/index.md))
- [Dependency Update Cooldowns](https://awesome-repositories.com/f/development-tools-productivity/package-dependency-managers/automated-dependency-updaters/dependency-update-cooldowns.md) — Delays adoption of new hook revisions by a configurable minimum age before automatic updates.
- [Stage-Restricted Hook Configurations](https://awesome-repositories.com/f/development-tools-productivity/pre-commit-hooks/stage-restricted-hook-configurations.md) — Restricts hooks to run only during specific Git lifecycle events like pre-commit or pre-push. ([source](https://prek.j178.dev/reference/configuration/))
- [Inline Hook Definitions](https://awesome-repositories.com/f/development-tools-productivity/project-scaffolding-config-code-generation/project-scaffolding-configuration/build-configuration/typescript-configurations/project-settings/local-overrides/local-hook-configuration-overrides/inline-hook-definitions.md) — Defines hooks inline within the project's own configuration file. ([source](https://prek.j178.dev/reference/configuration/index.md))
- [Project-Isolated Hook Contexts](https://awesome-repositories.com/f/development-tools-productivity/project-solution-generators/isolating-project-generators/project-isolated-hook-contexts.md) — Executes each project's hooks within its own directory to prevent cross-project interference. ([source](https://prek.j178.dev/workspace/index.md))
- [Subproject File Scope Isolations](https://awesome-repositories.com/f/development-tools-productivity/project-solution-generators/isolating-project-generators/subproject-file-scope-isolations.md) — Marks a sub-project as orphan so its files are handled only by its own configuration. ([source](https://prek.j178.dev/reference/configuration/))
- [Deepest-First Project Executions](https://awesome-repositories.com/f/development-tools-productivity/project-task-execution/deepest-first-project-executions.md) — Runs projects from the deepest subdirectory to the root so more specific configurations take precedence. ([source](https://prek.j178.dev/workspace/))
- [Pinned Revision Validators](https://awesome-repositories.com/f/development-tools-productivity/revision-histories/deployment-revisions/pinned-revision-validators.md) — Checks pinned SHA revisions against upstream refs and detects impostor commits during auto-update. ([source](https://prek.j178.dev/diff/index.md))
- [Stage-Restricted Hook Configurations](https://awesome-repositories.com/f/development-tools-productivity/startup-configurations/initialization-hooks/configuration-hooks/git-hook-configurations/stage-restricted-hook-configurations.md) — Limits which Git hook stages a hook is eligible to run in. ([source](https://prek.j178.dev/authoring-hooks/index.md))
- [Hook Execution Exclusions](https://awesome-repositories.com/f/development-tools-productivity/startup-configurations/initialization-hooks/configuration-hooks/hook-execution-exclusions.md) — Uses a colon-slash selector syntax to target individual hooks, entire projects, or specific hooks within a project. ([source](https://prek.j178.dev/diff/index.md))

### DevOps & Infrastructure

- [Built-in Hook Listings](https://awesome-repositories.com/f/devops-infrastructure/automation-orchestration/task-execution-frameworks/automation-frameworks/extensibility-hooks/hook-discovery-mechanisms/built-in-hook-listings.md) — Runs pre-built, offline hooks shipped with the tool by referencing them with a builtin repo source. ([source](https://prek.j178.dev/reference/configuration/index.md))
- [Declarative Configuration Files](https://awesome-repositories.com/f/devops-infrastructure/configuration-management/file-based-configuration/configuration-file-loading/declarative-configuration-files.md) — Defines hook sources and rules in a declarative TOML or YAML config file parsed at runtime. ([source](https://prek.j178.dev/quickstart/))
- [Directory-Scoped File Processing](https://awesome-repositories.com/f/devops-infrastructure/dependency-management/project-management/project-directory-management/directory-scoped-file-processing.md) — Restricts each project's hooks to only process files within its own directory tree, preventing cross-project interference. ([source](https://prek.j178.dev/workspace/))
- [CI Environment Hook Configurations](https://awesome-repositories.com/f/devops-infrastructure/ci-environment-hook-configurations.md) — Runs all configured git hooks against every file in a repository as part of a CI pipeline. ([source](https://prek.j178.dev/integrations/index.md))
- [Shared Hook Environments](https://awesome-repositories.com/f/devops-infrastructure/ci-environment-hook-configurations/shared-hook-environments.md) — Reuses toolchains and virtual environments across hooks and repositories to reduce disk usage. ([source](https://cdn.jsdelivr.net/gh/j178/prek@master/README.md))
- [Hook File Filters](https://awesome-repositories.com/f/devops-infrastructure/configuration-management/file-based-configuration/configuration-file-loading/configuration-filtering/hook-file-filters.md) — Filters candidate files using regex or glob patterns at global and hook levels before execution. ([source](https://prek.j178.dev/reference/configuration/))
- [Staged File Execution](https://awesome-repositories.com/f/devops-infrastructure/lifecycle-event-hooks/test-execution-hooks/staged-file-execution.md) — Executes configured hooks against staged files, the whole repository, or a single hook by ID. ([source](https://prek.j178.dev/usage/index.md))

### Programming Languages & Runtimes

- [Native Hook Implementations](https://awesome-repositories.com/f/programming-languages-runtimes/node-js-native-addons/rust-implementations/native-hook-implementations.md) — Ships bundled Rust implementations of common hooks for faster startup and lower overhead. ([source](https://prek.j178.dev/builtin/index.md))
- [Git Hook Repositories](https://awesome-repositories.com/f/programming-languages-runtimes/programming-language-varieties/domain-specific-languages/automation-scripting/built-in/git-hook-repositories.md) — Ships a built-in repository of pre-compiled Git hooks for fully offline execution without network access.
- [Pre-Commit Hook Runners](https://awesome-repositories.com/f/programming-languages-runtimes/rust-implemented-tooling/pre-commit-hook-runners.md) — A Git hook manager implemented in Rust that runs configured hooks faster using parallel execution and bundled implementations.
- [Isolated Hook Environments](https://awesome-repositories.com/f/programming-languages-runtimes/cross-platform-runtimes/language-runtime-environments/isolated-hook-environments.md) — Creates isolated runtime environments per hook language using language-specific package managers and toolchains.

### Software Engineering & Architecture

- [YAML Configuration Files](https://awesome-repositories.com/f/software-engineering-architecture/application-lifecycle-management/configuration-management/configuration-formats-and-schemas/yaml-configuration-files.md) — Defines hook repositories and settings in YAML configuration files with anchors and aliases. ([source](https://prek.j178.dev/configuration/index.md))
- [Per-Directory Configuration Scoping](https://awesome-repositories.com/f/software-engineering-architecture/application-lifecycle-management/configuration-management/hierarchical-configuration-systems/multi-project-scoping/per-directory-configuration-scoping.md) — Associates each configuration file with its own project directory, enabling independent hook runs for nested subprojects. ([source](https://prek.j178.dev/configuration/index.md))
- [Subproject File Isolation](https://awesome-repositories.com/f/software-engineering-architecture/environment-isolation/project-specific-shell-isolation/subproject-file-isolation.md) — Marks nested projects as orphan so their files are handled only by their own configuration and ignored by parent projects. ([source](https://prek.j178.dev/workspace/))
- [Nested Project Configurations](https://awesome-repositories.com/f/software-engineering-architecture/project-configuration/nested-project-configurations.md) — Scopes hook configurations to individual subdirectories, preventing parent configs from processing nested project files. ([source](https://prek.j178.dev/reference/configuration/index.md))
- [Directory-Scoped File Processing](https://awesome-repositories.com/f/software-engineering-architecture/project-scoping/directory-scoped-file-processing.md) — Restricts each project's hooks to only process files within its own directory tree, preventing cross-project interference. ([source](https://prek.j178.dev/workspace/))
- [Hook Execution Skipping](https://awesome-repositories.com/f/software-engineering-architecture/conditional-branching/hook-execution-skipping.md) — Excludes specific hooks or projects from execution using selector syntax and environment variables. ([source](https://prek.j178.dev/workspace/))
- [Project-Targeted Hook Selections](https://awesome-repositories.com/f/software-engineering-architecture/conditional-branching/hook-execution-skipping/project-targeted-hook-selections.md) — Selects or skips multiple projects and hooks in workspace mode for targeted execution. ([source](https://prek.j178.dev/diff/))
- [Selective Hook Executions](https://awesome-repositories.com/f/software-engineering-architecture/conditional-branching/hook-execution-skipping/selective-hook-executions.md) — Uses a flexible selector syntax to target or exclude individual hooks, projects, or subprojects. ([source](https://prek.j178.dev/workspace/index.md))
- [Numeric Priority Orderings](https://awesome-repositories.com/f/software-engineering-architecture/dependency-graph-resolution/concurrent-dependency-resolution/plugin-execution-ordering/numeric-priority-orderings.md) — Assigns numeric priorities to hooks for deterministic ordering and concurrent execution grouping. ([source](https://prek.j178.dev/reference/configuration/))
- [Execution Priorities](https://awesome-repositories.com/f/software-engineering-architecture/plugin-execution-engines/execution-priorities.md) — Assigns numerical weights to hooks to control execution sequence and concurrency grouping. ([source](https://prek.j178.dev/reference/configuration/))
- [Hook Revision Auto-Updates](https://awesome-repositories.com/f/software-engineering-architecture/reactive-update-scheduling/post-update-callbacks/lifecycle-update-hooks/plugin-update-hooks/hook-revision-auto-updates.md) — Checks for newer pinned revisions of hooks, applies a cooldown period, and validates SHA refs against upstream. ([source](https://cdn.jsdelivr.net/gh/j178/prek@master/README.md))
- [Pinned Revision Updates](https://awesome-repositories.com/f/software-engineering-architecture/reactive-update-scheduling/post-update-callbacks/lifecycle-update-hooks/plugin-update-hooks/pinned-revision-updates.md) — Automatically updates pinned hook repository revisions to their latest versions. ([source](https://prek.j178.dev/usage/index.md))

### User Interface & Experience

- [Native Hook Executors](https://awesome-repositories.com/f/user-interface-experience/native-widget-toolkits/rust-native-toolkits/native-hook-executors.md) — Executes Git hooks using compiled Rust binaries instead of Python interpreters, eliminating runtime dependencies.

### Web Development

- [Monorepo Tooling](https://awesome-repositories.com/f/web-development/monorepo-tooling.md) — Supports separate hook configurations per project in a monorepo and runs independent projects concurrently. ([source](https://cdn.jsdelivr.net/gh/j178/prek@master/README.md))

### Business & Productivity Software

- [Cooldown-Based Hook Updaters](https://awesome-repositories.com/f/business-productivity-software/automatic-software-updates/plugin-auto-updaters/cooldown-based-hook-updaters.md) — Updates pinned hook revisions with a configurable cooldown period and validates them against upstream refs. ([source](https://cdn.jsdelivr.net/gh/j178/prek@master/README.md))

### Security & Cryptography

- [Commit Blockers](https://awesome-repositories.com/f/security-cryptography/security/policies/host-resource-access/file-system-access-controls/sensitive-file-protections/commit-blockers.md) — Blocks commits that contain large files, private keys, merge conflicts, broken symlinks, or files destined for protected branches. ([source](https://prek.j178.dev/builtin/index.md))
