setup-lefthook
v0.0.8
Published
A CLI tool to quickly set up Lefthook in your projects with sensible defaults
Downloads
17
Readme
setup-lefthook
A CLI tool to quickly set up Lefthook in your projects with sensible defaults.
What it does
This tool automates the complete setup of Lefthook in your project:
- Installs Lefthook as a dev dependency using Bun
- Creates lefthook.yml configuration with recommended hooks
- Adds npm scripts for installation (
preparescript) - Sets up pre-commit hooks for code quality checks
- Sets up pre-push hooks for security and dependency audits
Usage
# Run directly with npx
npx setup-lefthook
# Or with Bun
bunx setup-lefthookWhat gets configured
Lefthook Configuration (lefthook.yml)
- Pre-commit hook with Biome checks for staged files
- Pre-push hooks for package audits and knip checks
- Parallel execution for faster checks
Package.json Scripts
prepare: Automatically installs Lefthook hooks after npm install
Requirements
- Node.js
- Bun (for package management)
- Git repository
Features
- ⚡ Zero configuration - Works out of the box with sensible defaults
- 🔧 Automatic setup - Installs and configures everything automatically
- 🚀 Fast checks - Parallel execution for optimal performance
- 🔒 Security first - Includes package audit hooks
What's Lefthook?
Lefthook is a fast and powerful Git hooks manager for any type of projects. It's language-agnostic and works with any programming language or framework.
Contributing
Feel free to open issues or submit pull requests at GitHub.
License
MIT
