You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
cz init raises FileNotFoundError for pre-commit if only prek is installed #2018
During cz init, hook installation checks whether pre-commit or prek is available, but always executes pre-commit install. If only prek is installed, detection succeeds but execution fails, resulting in a FileNotFoundError.
Steps to reproduce
Install commitizen and prek. pre-commit should not be on Path.
Run cz init
Just hit enter on the question ? What types of pre-commit hook you want to install? (Leave blank if you don't want to install) [commit-msg]
Get FileNotFoundError: [Errno 2] No such file or directory: 'pre-commit'
I'd like to work on this planning to follow the desired behavior as described (auto-select if only one tool present, prompt if both). Let me know if that matches what maintainers want.
Activity
FanoyG commentedon Aug 5, 2026
I'd like to work on this planning to follow the desired behavior as described (auto-select if only one tool present, prompt if both). Let me know if that matches what maintainers want.
Lee-W commentedon Aug 7, 2026
sounds good
fix(init): use prek when installing hooks if pre-commit is missing
fix(init): use prek when installing hooks if pre-commit is missing