Installation¶
prek provides multiple installation methods to suit different needs and environments.
Standalone Installer¶
The standalone installer automatically downloads and installs the correct binary for your platform:
Linux and macOS¶
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/j178/prek/releases/download/v0.2.10/prek-installer.sh | sh
Windows¶
powershell -ExecutionPolicy ByPass -c "irm https://github.com/j178/prek/releases/download/v0.2.10/prek-installer.ps1 | iex"
Package Managers¶
PyPI¶
prek is published as Python binary wheel to PyPI, you can install it using pip
, uv
(recommended), or pipx
:
# Using uv (recommended)
uv tool install prek
# Using uvx (install and run in one command)
uvx prek
# Using pip
pip install prek
# Using pipx
pipx install prek
Homebrew (macOS/Linux)¶
mise¶
To use prek with mise (v2025.8.11 or later):
npmjs¶
prek is published as a Node.js package, you can install it using npm
, pnpm
, or npx
:
# Using npm
npm add -D @j178/prek
# Using pnpm
pnpm add -D @j178/prek
# Using npx
npx @j178/prek --version
# or install globally
npm install -g @j178/prek
# then use `prek` command
prek --version
Nix¶
prek is available in Nix as prek
.
# Choose what's appropriate for your use case.
# One-off in a shell:
nix-shell -p prek
# NixOS or non-NixOS without flakes:
nix-env -iA nixos.prek
# Non-NixOS with flakes:
nix profile install nixpkgs#prek
Conda¶
prek is available as prek
via conda-forge.
Install from Pre-Built Binaries¶
Install pre-compiled binaries from GitHub using cargo-binstall:
Build from Source¶
Build from source using Cargo (Rust 1.89+ is required):
Download from GitHub Releases¶
Pre-built binaries are available for download from the GitHub releases page.
Updating¶
If installed via the standalone installer, prek can update itself to the latest version:
For other installation methods, follow the same installation steps again.
Shell Completion¶
prek supports shell completion for Bash, Zsh, Fish, and PowerShell. To install completions:
Bash¶
Zsh¶
Fish¶
PowerShell¶
Use in GitHub Actions¶
prek can be used in GitHub Actions via the j178/prek-action repository.
Example workflow:
name: Prek checks
on: [push, pull_request]
jobs:
prek:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: j178/prek-action@v1
This action installs prek and runs prek run --all-files
on your repository.