Generate and run Bash commands using OpenAI’s GPT models.
- Bash
- curl
- OpenAI API key
curl -O https://raw.githubusercontent.com/zmsp/ask-bash/main/ask
chmod +x ask
mv ask ~/.local/bin/
export PATH="$PATH:$HOME/.local/bin"
ask --help
ask "your task description"
Set your API key by exporting OPENAI_API_KEY
or let the script prompt and save it.
ask --help
-
OPENAI_API_KEY
— your OpenAI key (required). You can either:-
Export it in your current shell:
export OPENAI_API_KEY="your_api_key_here"
-
Or run the script once and it will prompt you to paste the key and save it securely to
~/.openai_api_key
.
-
-
VERBOSE=true
— enable debug output (optional)
MIT © Zobair