Last active
October 31, 2024 20:13
-
-
Save krzyzanowskim/a7faf277cd0b88cbff23bd9b52a4bd2a to your computer and use it in GitHub Desktop.
commit-ai
This file contains 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
[alias] | |
# need llm CLI: https://llm.datasette.io/en/stable/ | |
# based on https://gist.github.com/karpathy/1dd0294ef9567971c1e4348a90d69285?permalink_comment_id=5167582#gistcomment-5167582 | |
commit-ai = "!f() { if [ -n \"$(git diff --cached)\" ]; then git commit -m \"$(git diff --cached | llm -m '4o-mini' 'Below is a diff of all staged changes, coming from the command:\\n```\\ngit diff --cached\\n```\\nPlease generate a concise, two-sentence, maximum 100 characteres commit message for these changes. Do not mention project name.')\"; else echo 'No changes to commit'; fi }; f" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment