mirror of
https://github.com/j178/prek.git
synced 2026-04-25 02:11:36 +02:00
1.7 KiB
1.7 KiB
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.0-alpha.2/prek-installer.sh | sh
Windows
powershell -ExecutionPolicy ByPass -c "irm https://github.com/j178/prek/releases/download/v0.2.0-alpha.2/prek-installer.ps1 | iex"
Package Managers
PyPI
Install via pip, uv (recommended), or pipx:
# Using uv (recommended)
uv tool install prek
# Using pip
pip install prek
# Using pipx
pipx install prek
Homebrew (macOS/Linux)
brew install prek
mise (Cross-platform)
mise use prek
Build from Source
Using Cargo
cargo install --locked --git https://github.com/j178/prek
Download from GitHub Releases
Pre-built binaries are available for download from the GitHub releases page.
Updating
If you installed via the standalone installer, you can update to the latest version:
prek self update
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
COMPLETE=bash prek > /etc/bash_completion.d/prek
Zsh
COMPLETE=zsh prek completion > "${fpath[1]}/_prek"
Fish
COMPLETE=fish prek > ~/.config/fish/completions/prek.fish
PowerShell
COMPLETE=powershell prek >> $PROFILE