| Crates.io | mkcmt |
| lib.rs | mkcmt |
| version | 0.2.2 |
| created_at | 2025-03-11 05:21:33.47483+00 |
| updated_at | 2025-03-12 04:20:25.653817+00 |
| description | mkcmt is make commit. Conventional Commit Generator |
| homepage | https://github.com/davehorner/mkcmt |
| repository | https://github.com/davehorner/mkcmt |
| max_upload_size | |
| id | 1587570 |
| size | 213,432 |
You are reading documentation version 0.2.2. If this does not match the version displayed above, then you're not reading the latest documentation!
This tool generates concise or lengthy, Conventional Commit-compatible commit messages using GPT-4o-mini (ChatGPT), based on your Git diff outputs. It intelligently handles both staged and unstaged changes, progressively refining commit suggestions based on user feedback, and can copy the final commit message directly to your clipboard.
-r or --recovery flag to extract the previous commit message from HEAD@{1} and copy it directly to your system clipboard.-s or --soft-reset flag to perform a soft reset on the current branch, enabling you to amend the last commit without losing changes.-c or --current flag to display the current (last) commit message for review.git clone https://github.com/davehorner/mkcmt.git
cd mkcmt
cargo install --path .
Set your OpenAI API key in the environment variable:
export OPENAI_API_KEY="your-api-key-here"
run mkcmt in a git folder with some changes. follow the prompts.
mkcmt -h
mkcmt is make commit. Conventional Commit Generator
Usage: mkcmt [OPTIONS]
Options:
-r, --recovery Activate recovery mode to restore a previous commit message (from HEAD@{1})
-s, --soft-reset Perform a soft reset on the current branch
-c, --current Display the current (last) commit message
-h, --help Print help
-V, --version Print version
git diff --cached) and unstaged (git diff) changes.The iterative refinement and nice initial prompts are TBD (To Be Developed). What you get now might not be as good as giff diff --cached | (clip|pbcopy) taken straight to consumer
ChatGPT interface. This is v0.2.2; expect simple.
The tool maintains two log files for transparency and auditing purposes:
cc stands for conventional commit
output_cc_suggestions.txt
output_cc_prompts.txt
The logs are continually appended with clear separators, facilitating easy review and continuous improvement.
Rust
OPENAI_API_KEY key for GPT-4o-mini accessible via your environment.
git must be installed and accessible via command line.
$ cargo run
Both staged and unstaged changes detected.
Include both staged and unstaged changes in commit message? (y/n): y
Querying ChatGPT for commit message...
Suggested commit message:
feat: implement interactive AI-powered commit message generation tool
Accept this commit message? (y/n): n
Refining prompt for a better commit message...
Querying ChatGPT again with refined prompt...
Suggested commit message:
feat: add interactive refinement for better commit message accuracy based on user feedback
Accept this commit message? (y/n): y
Copy commit message to clipboard? (y/n): y
Commit message copied to clipboard.
When developing a new feature, it is essential to adhere to conventional commit standards. I employ mkcmt to ensure that commit messages conform to these conventions. However, there are instances where it becomes necessary to undo a commit generated for release-plz update—for example, when modifications to the CHANGELOG or other adjustments are required. In such cases, the originally intended commit message may be lost. The recovery mode in mkcmt (activated with the -r flag) facilitates the restoration of this commit message from HEAD@{1} by copying it to the clipboard, thereby preserving the original message for future use.
This project is licensed under the MIT License. See the LICENSE file for details.
You are reading documentation version 0.2.2. If this does not match the version displayed above, then you're not reading the latest documentation!