Show HN: acmsg (automated commit message generator)
6 qeden 13 5/14/2025, 10:44:33 AM github.com ↗
A cli tool written in python for generating commit messages based on the staged changes in a repository using AI models through the OpenRouter API.
I also believe that commit messages should focus on information the code doesn't already convey. Whatever the LLM can generate from looking at your code is likely not the info I'll seek when I read your commit message.
Hypothetically, a tool like this could ingest the bug report you were fixing, some emails, etc etc. It could also read the whole project (to get more context than just the diff). In principle there’s no reason it couldn’t relay more info than just the diff, in some extreme form…
Also, it could be seen as producing a starting point. When a person picks which AI generated text to keep, that is enough to add a bit of human spark into the system, right?
Assuming that the commits in this repo were generated by this tool it is missing the "Why?".
Header: Contains "What" and the scope of the changes, as short as possible Body: Contains "Why" and the full explanation of the change
By spelling out things that are not noteworthy enough for a human, you make it more difficult to find comments that are (and were). Injecting a lot of irrelevant information can hamper understanding even if it is technically completely correct.
```plaintext name=../../bin/assisted-commit
#!/bin/bash
# Run git commit with --verbose --dry-run and save the output git commit --verbose --dry-run > ./commit.message
# Prepend # to every line and add "conventional commit message:" at the end sed -i 's/^/# /' ./commit.message echo "# uncommented conventional commit message using feat, fix or doc flags. !beakingchange iff change breaks backward compatibility:" >> ./commit.message echo "" >> ./commit.message
# Open the file in vim for editing, with cursor on a new line at the end and in insert mode vim +':normal Go' +startinsert ./commit.message
# Filter out commented lines and save to a temporary file grep -v '^#' ./commit.message > ./commit.message.filtered
# Commit using the filtered file git commit -F ./commit.message.filtered
# Delete the files rm ./commit.message ./commit.message.filtered
```