Choose your fighter:
- Ruby
- Node.js
- Go
- Python
- Swift
- Scoop
- Homebrew
- Winget
- Snap
- Debian-based distro
- RPM-based distro
- Alpine
- Arch Linux
- Manual
gem install lefthook
Troubleshooting
If you see the error lefthook: command not found
you need to check your $PATH. Also try to restart your terminal.
Lefthook is available on NPM in the following flavors:
-
lefthook that will install the proper binary:
npm install lefthook --save-dev # or yarn: yarn add -D lefthook
-
@evilmartians/lefthook with pre-bundled binaries for all architectures:
npm install @evilmartians/lefthook --save-dev # or yarn: yarn add -D @evilmartians/lefthook
-
@evilmartians/lefthook-installer that will fetch binary file on installation:
npm install @evilmartians/lefthook-installer --save-dev # or yarn: yarn add -D @evilmartians/lefthook-installer
Note
If you use pnpm
package manager make sure you set side-effects-cache = false
in your .npmrc, otherwise the postinstall script of the lefthook package won't be executed and hooks won't be installed.
go install github.com/evilmartians/lefthook@latest
python -m pip install --user lefthook
You can find the Swift wrapper plugin here.
Utilize lefthook in your Swift project using Swift Package Manager:
.package(url: "https://github.com/csjones/lefthook-plugin.git", exact: "1.8.4"),
Or, with mint:
mint run csjones/lefthook-plugin
scoop install lefthook
brew install lefthook
winget install evilmartians.lefthook
snap install --classic lefthook
curl -1sLf 'https://dl.cloudsmith.io/public/evilmartians/lefthook/setup.deb.sh' | sudo -E bash
sudo apt install lefthook
See all instructions: https://cloudsmith.io/~evilmartians/repos/lefthook/setup/#formats-deb
curl -1sLf 'https://dl.cloudsmith.io/public/evilmartians/lefthook/setup.rpm.sh' | sudo -E bash
sudo yum install lefthook
See all instructions: https://cloudsmith.io/~evilmartians/repos/lefthook/setup/#repository-setup-yum
sudo apk add --no-cache bash curl
curl -1sLf 'https://dl.cloudsmith.io/public/evilmartians/lefthook/setup.alpine.sh' | sudo -E bash
sudo apk add lefthook
See all instructions: https://cloudsmith.io/~evilmartians/repos/lefthook/setup/#formats-alpine
You can install lefthook package from AUR.
yay -S lefthook
Or take it from binaries and install manually.
- Download the executable for your OS and Arch
- Put the executable under the $PATH (for unix systems)
Have a question?
🤔 Start a discussion