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
Enable hooks to be called on commands or subcommands that affirm/reject or modify inputs (e.g., body text) #15042
Describe the feature or problem you’d like to solve
git itself has hooks which enables me to enforce certain behaviors when users do a commit or other sort of action. gh does not have such a mechanism.
When agents use gh directly, I have to rely on agent instructions to get them to properly tag a commit with a Prompt-URL: string at the end of the PR, Comment, issue, et cetera.
What I want gh to be able to do is call an installable hook so that we can enforce desired behaviors, or as in this case, automate them.
Proposed solution
Give a specific command or subcommand is called
Before gh goes to execute it, it checks for a hook that is installed in the user environment, either globally or specific to the repository being accessed, allowing execution of a command that can check the action conforms to team guidelines, and reject the action if an error is reported in evaluation, or work with the modified action content returned by the hook.
How will it benefit CLI and its users?
This will enable teams to create hooks to ensure that development guidelines are followed in the course of using gh on a specific project.
Additional context
I do have a smaller change tested that just adds the Prompt-URL: tag at the end of a pr, issue, comment or other body that is configurable to work with any agent. However, as a feature, that is very specific to ONE use case, whereas the hook capability has broader applicability, and is consistent with existing capabilities already in git itself.
Add any other context like screenshots or mockups are helpful, if applicable.
GitHub CLI 2.103.3 supports aliases and extensions, but those add or wrap commands. They do not provide a global or repository-scoped hook that can reject a built-in command or rewrite its body before submission. The requested behavior is therefore not currently supported and is a clear enhancement request. The proposal gives a concrete use case and describes both validation and content transformation, so it has enough detail for product and design review.
Thank you for your issue! We have categorized it as an enhancement (feature or improvement) request, and it has been added to our backlog. In doing so, we are not committing to implementing this feature at this time, but, we will consider it for future releases based on community feedback and our own product roadmap.
Unless you see the
help wantedContributions welcome
label, we are not currently looking for external contributions for this feature.
If you come across this issue and would like to see it implemented, please add a thumbs up! This will help us prioritize the feature. Please only comment if you have additional information or viewpoints to contribute.
Thanks for the suggestion, @keithboone! 🙏 I can see the value in automating attribution and helping teams follow their conventions.
A general hook mechanism would be a substantial addition to gh, with careful design needed around executing untrusted code, exposing credentials or private drafts, and modifying content after it has been reviewed. These considerations don’t rule it out, but they make it important to understand the need before considering an approach.
Could you share more about your attribution workflow and any other use cases you have in mind? It would be especially helpful to understand where your current approach falls short and how hooks would help.
I’d also like to leave room for other community members to share whether this would be useful to them and how they’d use it. Given the scope, we’d need more feedback and community interest before considering design or implementation.
Activity
cli-triage commentedon Nov 12, 2026
GitHub CLI 2.103.3 supports aliases and extensions, but those add or wrap commands. They do not provide a global or repository-scoped hook that can reject a built-in command or rewrite its body before submission. The requested behavior is therefore not currently supported and is a clear enhancement request. The proposal gives a concrete use case and describes both validation and content transformation, so it has enough detail for product and design review.
Supporting reports
Duplicate analysis
Label reasoning
Investigation notes
Generated by issue triage.
github-actions commentedon Nov 16, 2026
Thank you for your issue! We have categorized it as an enhancement (feature or improvement) request, and it has been added to our backlog. In doing so, we are not committing to implementing this feature at this time, but, we will consider it for future releases based on community feedback and our own product roadmap.
Unless you see the help wantedContributions welcome
label, we are not currently looking for external contributions for this feature.
If you come across this issue and would like to see it implemented, please add a thumbs up! This will help us prioritize the feature. Please only comment if you have additional information or viewpoints to contribute.
babakks commentedon Nov 16, 2026
Thanks for the suggestion, @keithboone! 🙏 I can see the value in automating attribution and helping teams follow their conventions.
A general hook mechanism would be a substantial addition to gh, with careful design needed around executing untrusted code, exposing credentials or private drafts, and modifying content after it has been reviewed. These considerations don’t rule it out, but they make it important to understand the need before considering an approach.
Could you share more about your attribution workflow and any other use cases you have in mind? It would be especially helpful to understand where your current approach falls short and how hooks would help.
I’d also like to leave room for other community members to share whether this would be useful to them and how they’d use it. Given the scope, we’d need more feedback and community interest before considering design or implementation.