Skip to content

Instantly share code, notes, and snippets.

@sputnikus
Last active June 19, 2025 09:47
Show Gist options
  • Save sputnikus/fc5fbd6bcee9a77963e968465e0e436f to your computer and use it in GitHub Desktop.
Save sputnikus/fc5fbd6bcee9a77963e968465e0e436f to your computer and use it in GitHub Desktop.
Generate Jujutsu change description using llm tool in Conventional Commit format
#!/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"]
@sputnikus
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment