AI Shell Command Generator using LLM
- Prompts
llmto write you a simple shell command with an explanation. - Copies the command to your clipboard (even if you cancel generation before the explanation completes).
llmc revert the changes from the last two git commitsInstall and configure the llm CLI tool. Add the llmc function to your .zshrc.
- Prompts specifically for a ZSH command on a macOS machine
- Obviously, be careful running commands you don't understand & use at your own risk.
The
cleanup()function may not work on all systems. I get this error:This is because
pbcopyis aliased toxselwhich is not (commonly) installed on newer "wayland only" linux distros but there is a helpful
detect-clipboard()function for any oh-my-zsh userHere is a revised function that will try to select the appropriate copy tool: