# Install lefthook with Homebrew, apk, MacPorts, Nix, scoop, winget

Fast and powerful Git hooks manager for any type of projects. Version 2.1.9 via Homebrew; verified 2026-05-29.

## Install

```sh
sudo av install brew:lefthook
```

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install lefthook
```

  Evidence: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install lefthook
```

  Evidence: MacPorts ports tree: devel/lefthook/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- apk (92%):

```sh
sudo apk add lefthook
```

  Evidence: Alpine Linux edge package indexes: lefthook from https://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz

- Nix (92%):

```sh
nix profile install nixpkgs#lefthook
```

  Evidence: nixpkgs package indexes: pkgs/by-name/le/lefthook/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

### Windows

- Scoop (92%):

```sh
scoop install main/lefthook
```

  Evidence: Scoop official bucket manifest trees: bucket/lefthook.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1

- winget (92%):

```sh
winget install --id evilmartians.lefthook -e
```

  Evidence: Windows Package Manager source index: evilmartians.lefthook from https://cdn.winget.microsoft.com/cache/source.msix

## Package facts

- **Package key:** brew:lefthook
- **Package manager:** Homebrew
- **Package manager page:** <https://formulae.brew.sh/formula/lefthook>
- **Version:** 2.1.9
- **Source summary:** Fast and powerful Git hooks manager for any type of projects
- **Homepage:** <https://github.com/evilmartians/lefthook>
- **Repository:** <https://github.com/evilmartians/lefthook>
- **Upstream docs:** <https://lefthook.dev/>
- **License:** MIT
- **Source archive:** <https://github.com/evilmartians/lefthook/archive/refs/tags/v2.1.9.tar.gz>
- **Last updated:** 2026-05-29T09:11:57Z
- **Generated:** 2026-07-08T07:18:31+00:00

## Executables

- lefthook (cli)
- lefthook (alias)

## Build dependencies

- go

## Install behavior

- Post-install hook: not defined
- Bottle: available on arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux

## Freshness

- Page generated: 2026-07-08
- Package-manager version: 2.1.9
- Package-manager updated: 2026-05-29
- Local data: ok
- Upstream repository: https://github.com/evilmartians/lefthook
- Upstream latest detected: v2.1.9 (current)
## Project history and usage

Lefthook is Evil Martians' Git hooks manager, packaged as a fast Go binary for teams that want one hook configuration across JavaScript, Ruby, Python, Go, and mixed-language repositories.

### Project history

Evil Martians introduced Lefthook publicly in 2019 as part of a developer-experience workflow around Git hooks, CI, and test automation. The project's official materials describe it as a Git hooks manager for Node.js, Ruby, Python, and many other project types, with speed from Go and parallel command execution.

By 2024 Evil Martians described Lefthook as having grown from a wrapper around custom Git hook scripts into a broader automation tool for local development routines. The docs centered the normal workflow around creating `lefthook.yml` and running `lefthook install`, which writes hook shims under `.git/hooks/`.

### Adoption history

Evil Martians' 2019 launch material named Discourse, Logux, and OpenStax as adopters, which placed Lefthook in the practical Git-hook-manager niche rather than as a toy demo. Later official pages emphasized package-manager installation through project ecosystems and system package managers, including Homebrew, npm, RubyGems, winget, yum, apt, apk, and Scoop.

### How it is used

Package users usually install the `lefthook` binary, commit `lefthook.yml`, run `lefthook install`, and let Git invoke Lefthook on events such as pre-commit, pre-push, or commit-msg. A common package-nerd use is replacing language-specific hook wrappers with a single binary that can dispatch linters, formatters, tests, and custom scripts in parallel.

### Why package nerds care

Lefthook matters in package-manager culture because it sits at the boundary between Git, local automation, and language ecosystems: it is distributed as a native CLI while still fitting naturally into npm, Ruby, Python, and Homebrew workflows. Its appeal is the small, boring promise package nerds like: one config file, one binary, fewer per-language hook stacks.

### Timeline

- 2019-07-10: Evil Martians published an early Lefthook workflow article with Crystalball and Git automation.
- 2019-07-30: Evil Martians published the main Lefthook introduction article.
- 2019-08-28: Evil Martians described using Lefthook in documentation automation workflows.
- 2024-01-18: Evil Martians described Lefthook's evolution beyond a simple Git-hook script wrapper.

### Related projects

- Related Git-hook tools include Husky, pre-commit, lint-staged, Overcommit, and language-specific package scripts. Evil Martians' surrounding open-source ecosystem also includes projects such as AnyCable, imgproxy, PostCSS-related tooling, and Crystalball.

### Sources

- <https://evilmartians.com/chronicles/5-cool-and-surprising-ways-to-configure-lefthook-for-automation-joy>
- <https://evilmartians.com/chronicles/lefthook-crystalball-and-git-magic>
- <https://evilmartians.com/chronicles/lefthook-knock-your-teams-code-back-into-shape>
- <https://evilmartians.com/opensource/lefthook>
- <https://github.com/evilmartians/lefthook>
- <https://lefthook.dev/>


## Security Notes

No matching local secret-handling manifest was found for lefthook. Nucleus package metadata is still published here so future coverage has a stable package URL.



## Configuration and credential file locations

These source-backed paths show where this package keeps local settings or durable credentials. Automic Vault can use them as review targets for secret scanning, migration, and command approval.


## Configuration files

- Unix: lefthook.yml, lefthook-local.yml
## Source Database Details

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** lefthook
- **Version Scheme:** 0
- **Revision:** 0
- **Head Version:** HEAD
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** no
- **URL Keys:** head, stable

## Other Package-Manager Records

- Nix - lefthook: normalized package name match | nixpkgs package indexes: pkgs/by-name/le/lefthook/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- apk - lefthook - 2.1.4-r2: normalized package name match | Alpine Linux edge package indexes: lefthook from https://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz | Fast and powerful Git hooks manager | https://github.com/evilmartians/lefthook
- apk - lefthook-doc - 2.1.4-r2: normalized package name match | Alpine Linux edge package indexes: lefthook-doc from https://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz | Fast and powerful Git hooks manager (documentation) | https://github.com/evilmartians/lefthook
- MacPorts - lefthook: normalized package name match | MacPorts ports tree: devel/lefthook/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1
- Scoop - main/lefthook: normalized package name match | Scoop official bucket manifest trees: bucket/lefthook.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1
- winget - evilmartians.lefthook: normalized package name match | Windows Package Manager source index: evilmartians.lefthook from https://cdn.winget.microsoft.com/cache/source.msix


## Related links

- [Source-control packages](https://www.automicvault.com/pkg/source-control-tools/) - Belongs to a source-control command family.
- [Terminal utility packages](https://www.automicvault.com/pkg/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Text processing packages](https://www.automicvault.com/pkg/text-processing-tools/) - Matched text, document, or structured-data processing metadata.
- [Developer build packages](https://www.automicvault.com/pkg/developer-build-tools/) - Matched build, compiler, generator, or developer workflow metadata.
- [go](https://www.automicvault.com/pkg/brew/go/) - Build dependency declared by Homebrew.
- [gh](https://www.automicvault.com/pkg/brew/gh/) - Shares av.db curated category or tags: automation, cli, developer-tools, git, version-control.
- [git-hooks-go](https://www.automicvault.com/pkg/brew/git-hooks-go/) - Shares av.db curated category or tags: cli, developer-tools, git, git-hooks, version-control.
- [git-xargs](https://www.automicvault.com/pkg/brew/git-xargs/) - Shares av.db curated category or tags: automation, cli, developer-tools, git, version-control.
- [gitup](https://www.automicvault.com/pkg/brew/gitup/) - Shares av.db curated category or tags: automation, cli, developer-tools, git, version-control.
- [gitwatch](https://www.automicvault.com/pkg/brew/gitwatch/) - Shares av.db curated category or tags: automation, cli, developer-tools, git, version-control.
- [aicommit](https://www.automicvault.com/pkg/brew/aicommit/) - Shares av.db curated category or tags: cli, developer-tools, git, version-control.
- [aicommit2](https://www.automicvault.com/pkg/brew/aicommit2/) - Shares av.db curated category or tags: cli, developer-tools, git, version-control.
- [aicommits](https://www.automicvault.com/pkg/brew/aicommits/) - Shares av.db curated category or tags: cli, developer-tools, git, version-control.
- [lefthook](https://www.automicvault.com/pkg/npm/lefthook/) - Same normalized package name appears in another local ecosystem. Shared terms: git, hooks, lefthook, manager.
- [lefthook](https://www.automicvault.com/pkg/npm/lefthook/) - Same normalized package name in another local ecosystem.

## Combined YAML source

View the package source record on GitHub. [combined/lefthook.yml](https://github.com/automic-vault/db/blob/main/combined/lefthook.yml)


## Sources

- Nucleus package database
- Geiger risk classifier
- package-page enrichment
- curated configuration and credential file locations
- curated package history
- package version freshness
- av.db category and tag curation
- package relationship graph
- external package-manager database matches
- cross-ecosystem install command graph
