I use llm python package in the cli to interact with LLMs quickly to be productive on the terminal. The setup I have involves two things:
- llm templates: llm packages allows defining templates with model, system prompt, and other parameters to be predefined.
- llm scripts: I write various shell scripts to complement the pipeline in various ways, as seen below.
- Output the help of a command
- Prepend the help message with a prompt
- Pass the prompt to the llm
- Pass the llm output to llm-sh to see the code and decide what to do
# NOTE: sh-code is a template on llm that has a system prompt for code output
pkgx --help --verbose | llm-pre 'Help me uninstall httpie from pkgx. Here is the command docs:
' | llm -t sh-code | llm-sh