husky icon indicating copy to clipboard operation
husky copied to clipboard

`husky install` vs `husky init`

Open developer239 opened this issue 5 months ago • 4 comments

What is the reason for these breaking API changes?

developer239 avatar Jul 09 '25 22:07 developer239

@developer239 I think , Husky team realized that husky install was confusing people. Like, when you hear "install" you think you're installing something new, right? actually it was just setting up your project to use husky.

So they changed it to husky init because that's what most other tools use when you're starting something fresh

in my way i think it's just make more sense.

naaa760 avatar Jul 10 '25 08:07 naaa760

How many projects do you think need to be updated because of this change?

developer239 avatar Jul 10 '25 12:07 developer239

You're absolutely right! 😅 probably millions of projects need updating, I think Husky is used in 1.5M+ GitHub repos. The good thing would be old projects still work (just show warnings), and the fix is literally one line in package.json. But yeah, that's a LOT of codebases affected by this change. Sometimes maintainers have to make tough calls for long-term improvements, but the scale here is definitely huge.

naaa760 avatar Jul 10 '25 14:07 naaa760

husky init nukes my package.json "prepare": "husky init || true" and my .husky/pre-commit husky install leaves my package.json "prepare": "husky install || true" and my .husky/pre-commit alone

For now I would use the husky install method so it automatically sets up without nuking your configs when you do a npm install. prepare": "husky install || true

wagneramichael avatar Aug 08 '25 00:08 wagneramichael