Add --confirm flag to prompt for confirmation before committing#15
Open
abelcha wants to merge 1 commit intocoder:mainfrom
Open
Add --confirm flag to prompt for confirmation before committing#15abelcha wants to merge 1 commit intocoder:mainfrom
abelcha wants to merge 1 commit intocoder:mainfrom
Conversation
This commit adds a new --confirm (-y) flag that allows users to review and confirm the generated commit message before it is actually committed. When the flag is set, users are prompted with 'Commit with this message? [Y/n]:' after the AI generates the commit message. The commit only proceeds if the user confirms with 'y', 'yes', or by pressing Enter. This provides an additional safety mechanism for users who want to review the AI-generated message before it becomes part of their git history.
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
This PR adds a new `--confirm` (or `-y`) flag that allows users to review and confirm the generated commit message before it is actually committed.
Changes
Usage
```bash
Generate commit message and ask for confirmation before committing
aicommit --confirm
Or using the short flag
aicommit -y
```
Behavior
When the `--confirm` flag is set:
Backward Compatibility
Without the flag, the tool behaves exactly as before, committing directly. This is a purely additive feature with no breaking changes.