PHP

  1. Add the package as a dependency
composer require --dev evilmartians/lefthook
  1. Check that it works
vendor/bin/lefthook version
  1. Install the Git hooks
vendor/bin/lefthook install

After that lefthook should automatically find its path via composer exec on Git hooks.