feat(cli): add vp hooks command for managing Git hooks (#2219) - #2341
Open
dennybiasiolli wants to merge 4 commits into
Open
feat(cli): add vp hooks command for managing Git hooks (#2219)#2341dennybiasiolli wants to merge 4 commits into
vp hooks command for managing Git hooks (#2219)#2341dennybiasiolli wants to merge 4 commits into
Conversation
✅ Deploy Preview for viteplus-preview canceled.
|
dennybiasiolli
force-pushed
the
feat/2219-remove-git-hooks
branch
3 times, most recently
from
August 6, 2026 09:19
59537eb to
9ac52bd
Compare
Implement pure hook lifecycle helpers on top of install(): user preference persistence (local git config), safe per-scope core.hooksPath unset, and status reporting. Teach install() and vp config to honor a disable preference and resolve the last-used hooks directory. Cover lifecycle, foreign path, worktree, stored custom dir, and unsafe-tree cases in unit tests; update the config help snapshot for the remembered hooks-dir default.
Add the hooks bin entry and register it from bin.ts so local vp can run setup/disable/enable/status. Bundle the entry with tsdown, document it in the CLI package build notes, and add a PTY lifecycle fixture for setup/status/disable/enable plus prepare-style config skip after disable.
Delegate hooks from the Rust global CLI to the JS implementation, and list the command in global help, the interactive picker, and the local NAPI help surface. Update top-level help snapshots and add vp hooks --help coverage for local and global flavors.
Add setup/disable/enable/status to the commit-hooks guide with a quick start, and point create, migrate, troubleshooting, and the guide index at the new commands so users can discover and operate them easily.
dennybiasiolli
force-pushed
the
feat/2219-remove-git-hooks
branch
from
August 6, 2026 11:44
9ac52bd to
db4b05e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2219
Adds a dedicated
vp hookscommand so users can manage the Vite+ Git hookdispatcher without following the manual steps from the commit-hooks guide:
vp hooks setup— install or refresh the dispatcher (core.hooksPath+<dir>/_)vp hooks disable— tear down the dispatcher and persist the decision in localgit config so
prepare/vp configdo not reinstall itvp hooks enable— re-enable after disable (same as setup)vp hooks status— show preference,core.hooksPath, dispatcher, and project hooksProject-owned hooks (e.g.
.vite-hooks/pre-commit),stagedconfig, andpackage.jsonlifecycle scripts are left alone. Custom directories work via--hooks-dirand are remembered in local git config for later commands andvp config.Why
#2219: once hooks are set up there was no first-class way to remove them, so people
had to hand-edit
core.hooksPathand delete.vite-hooks/_. Maintainers preferreda
vp hookssurface (setup/disable/enable/status) over avp config --uninstall-hooksflag, with the disable decision persisted.Disclaimer: assisted by Grok 4.5 (xAI) while implementing and reviewing this change.