"Why use many code if few code do the trick?"
You want to have an AI assistant in your terminal that generates bash commands, but other solutions:
- require that you install a whole new terminal
- compile/install some executable
- install oh-my-zsh so you can install a plugin etc..
Fear no more bai
has you covered.
Disclaimer: You are responsibel for vetting any commands the AI generates before hitting Enter to execute them!
Prerequisites:
- bash (usally pre-installed)
- curl (usally pre-installed)
- jq (easily installed with
apt-get install jq
or equivalent) - OpenAi API key
- Clone this repo
chmod +x bai.sh
cp bai.sh /usr/local/bin/bai
export OPENAI_API_KEY=<your key here>
Done
If you want you can also do
echo "export OPENAI_API_KEY=<your key here> >> ~/.bashrc"
so that you don't have to export the key wevery time you start the terminal.
Features:
- You can also use the
-v
option instead, to interact withbai
like a normal verbose chatbot. - Autodetects your platform when suggesting commands