This script transforms natural language input into bash commands, allowing you to interact with your terminal more intuitively. Powered by OpenAI's GPT API.
curlfor making API requestsjqfor parsing JSON responsespbcopyfor copying output to clipboard (optional)- OpenAI API key
- Add your
OPENAI_API_KEYto environment variables (e.g. in your.bashrcor.zshrc). - Make sure the script executable:
chmod +x /path/to/how.sh. - Make link to the script:
ln -s /path/to/how.sh /usr/local/bin/how
Type how in your terminal followed by a question or command. The script will return a bash command:
# in your terminal:
how to find the biggest file in current directory
# output:
find . -type f -exec du -h {} + | sort -rh | head -n 1
# output is also copied to clipboard
# paste and run it with `Cmd + V` and `Enter`