#!/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"]