Add user confirmation for write commands#12687
Open
Chaitanya-cpc wants to merge 1 commit intocli:trunkfrom
Open
Add user confirmation for write commands#12687Chaitanya-cpc wants to merge 1 commit intocli:trunkfrom
Chaitanya-cpc wants to merge 1 commit intocli:trunkfrom
Conversation
- Add config option confirm_write_commands (enabled|disabled, default disabled) - Add GH_CONFIRM_WRITE_COMMANDS env var to override config - Require confirmation in gh pr create, gh issue create, gh repo delete when enabled; clear error when non-interactive - Document in gh help environment Closes cli#12624 Co-authored-by: Cursor <[email protected]>
|
Thank you for your pull request! 🎉 This PR appears to fix the following issues that are not labeled with
help wanted
As outlined in our Contributing Guidelines, we expect that PRs are only created for issues that have been labeled While we appreciate your initiative, please note that:
What happens next:
Thank you for your understanding and contribution to the project! 🙏 This comment was automatically generated by cliAutomation. |
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 #12624
Summary
Adds an optional confirmation step for "write" commands so users (especially those using
ghwith AI agents or automation) can require an extra prompt before creating PRs, issues, or deleting repos.Changes
confirm_write_commands: when set toenabled, the CLI will require confirmation before running selected write commands. Default isdisabledso existing behavior is unchanged.GH_CONFIRM_WRITE_COMMANDS: overrides the config. Set toenabledto require confirmation, ordisabledto skip it (e.g. in non-interactive scripts).cmdutil.RequireWriteConfirmation(f, hostname, actionDescription)used by:gh pr creategh issue creategh repo deleteCancelError.GH_CONFIRM_WRITE_COMMANDS=disabledorgh config set confirm_write_commands disabled.gh config(viaconfig.Options), andGH_CONFIRM_WRITE_COMMANDSadded togh help environment.Usage
Made with Cursor