Last active
June 19, 2025 09:47
-
-
Save sputnikus/fc5fbd6bcee9a77963e968465e0e436f to your computer and use it in GitHub Desktop.
Generate Jujutsu change description using llm tool in Conventional Commit format
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
#!/usr/bin/env fish | |
# Shebang for testing, Jujutsu config at the end of this file | |
# LLMs are useful for generating the first line of the CC (the What), but you | |
# should always review generated description to include the Why and the How. | |
set -l DIFF $(jj diff --git -r @) | |
if [ -z "$DIFF" ] | |
echo "No changes found." | |
return 1 | |
end | |
# Generate commit message using LLM | |
set -l DESC_MSG $(echo "$DIFF" | llm -m claude-3.5-sonnet "\ | |
Generate a concise commit message (first line), blank line and detailed | |
description based on these changes. Follow conventional commits format. | |
Your response will be passed directly into version control command. Diff:\ | |
") | |
if [ -z "$DESC_MSG" ] | |
echo "Failed to generate change description." | |
return 1 | |
end | |
# Describe changes | |
printf %s\n $DESC_MSG | jj desc --stdin | |
# Jujutsu config | |
# [aliases] | |
# cdesc = ["util", "exec", "--", "llm_conventional_desc.fish"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Inspired by https://gist.github.com/RafalWilinski/f0167ae404c7623ffb54c1429394323a, adapted for Jujutsu and Fish.