appleboy / CodeGPT

A CLI written in Go language that writes git commit messages or do a code review brief for you using ChatGPT AI (gpt-4o, gpt-4-turbo, gpt-3.5-turbo model) and automatically installs a git prepare-commit-msg hook.
MIT License
1.27k stars 110 forks source link

Feature request: Prompt user to commit preview #180

Closed robert-m closed 4 months ago

robert-m commented 5 months ago

I use --preview all the time to view what the commit message will be before commiting. Adding a new flag --prompt to preview and then prompted if user wants to commit message.

For example;

Summarize the commit message use gpt-3.5-turbo model
We are trying to summarize a git diff
We are trying to summarize a title for pull request
================Commit Summary====================

feat: Add preview flag and remove disableCommit flag in commit command and template file.

- Add a `preview` flag to the `commit` command
- Remove the `disbaleCommit` flag from the `prepare-commit-msg` template file

==================================================

Commit preview summary? : y

==================================================
Write the commit message to .git/COMMIT_EDITMSG file
appleboy commented 5 months ago

I will take it.

tisfeng commented 4 months ago

Good idea 😃