feat(hooks): add manual hook execution with hooks run command#245
Merged
feat(hooks): add manual hook execution with hooks run command#245
hooks run command#245Conversation
Allows users to manually trigger hooks via `git daft hooks run <type>`, bypassing trust checks. Supports --job, --tag, and --dry-run filters. When invoked without arguments, lists all configured hooks. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Previously, `hooks install` appended YAML at the end of the file which broke the YAML structure. Now it prints a copy-paste snippet instead, and uses `find_config_file()` to locate the actual config. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
A post-init hook can never fire in practice since the repository doesn't exist yet when `git daft init` runs, so there's no daft.yml or .daft/hooks/ to define hooks in. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Wire up tab completion for `daft hooks run` across all shells (bash, zsh, fish, fig). The dynamic completion backend already existed but shell scripts weren't calling it. - Bash/Zsh/Fish: register `_daft` completion function for both `daft` and `git-daft`, with dynamic hook type and job name completion via `daft __complete hooks-run` - Fig: extend FigSubcommand with nested subcommands/args/options, build full hooks subcommand tree with `run` generator - Also complete top-level daft subcommands and hooks subcommands Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Reorder hooks subcommands: trust, prompt, deny, status, run, install, validate, dump, migrate - Update SKILL.md to remove stale `list`/`reset-trust` references - Add "Manual Hook Execution" section to hooks guide - Reorder CLI reference to match help output Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
git daft hooks runcommand for manually triggering hooks on demand, with--job,--tag, and--dry-runfilterslistandreset-trustas subcommands undertrust(trust list,trust reset,trust reset all)post-inithook type (was unused,worktree-post-createalready covers the use case)hooks installto not modify existing config files (prints YAML snippet instead)daftsubcommands (bash/zsh/fish/fig) with dynamic hook type and job name completionTest plan
mise run fmt-- zero changesmise run clippy-- zero warningsmise run test:unit-- 353 tests passmise run man:verify-- man pages up to datehooks run,--dry-run,--job,--tag, trust hint from untrusted repodaft __complete hooks-run ""returns configured hooks🤖 Generated with Claude Code