Skip to content

Instantly share code, notes, and snippets.

@wjurkowlaniec
Created April 11, 2025 15:48
Show Gist options
  • Save wjurkowlaniec/438f21b16acbc1d8ce9fde26a591e6b0 to your computer and use it in GitHub Desktop.
Save wjurkowlaniec/438f21b16acbc1d8ce9fde26a591e6b0 to your computer and use it in GitHub Desktop.
Bash command hints from LLM
  1. install local ollama or use remote API, in my case local ollama
llm install llm-ollama
llm models default qwen2.5:3b
  1. Configure zsh. I have oh-my-zsh, should be compatible

vim ~/.zshrc

put there

 function llmcmd {
   llm prompt --system "You are a shell assistant. Respond with only the necessary shell command(s) for the given task, without any explanations. " "$*"
 }
 compdef _files llmcmd
 

and in the end, you have nice tool that hints commands

> llmcmd "zip code dir into /tmp, exclude *pyc" 
find . -type d -exec mkdir -p /tmp/{} \; && find . -type d ! -name '*pyc' -exec cp -t /tmp/ {} +
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment