TIL How to use AI to Generate PR descriptions in the CLI
I’ve been enjoying using simonws llm CLI
tool. He writes extensively about the subject (his
blog is definitely one of my favourites).
The documentation for this tool is fantastic, I feel like I’ve only scratched the surface with it but doing quick querys from the command like these:
llm 'whats the correct syntax for wget'echo "curl -x POST https://foo.bar/baz" | llm 'What is this command doing?'And continuing from the last query with llm -c '...'? Lovely!
I can even write longer prompts by using fc to open up my $EDITOR and add
the necessary detail with a multiline string (though the quotes get annoying,
this is just a quick and dirty kludge).
So far, my favourite use is generating PR descriptions of course:
git diff main..HEAD -- ':(exclude)*.lock' | \
    llm prompt \
    -f .github/PULL_REQUEST_TEMPLATE.md \
    "write a short pull request description for this change using this template"