Lefthook can be installed with uv tool install lefthook, and enabled with uv run lefthook install. On commit it will format, lint and audit the code.
uv tool install lefthook
uv run lefthook install