This bash script uses Google Gemini to generate bash commands based on user prompts. It also includes safety measures to prevent the execution of potentially dangerous commands.
- Bash
- Gemini API key
- Clone or download the script file (
script.sh
). - Ensure that the script file has execute permission:
chmod +x script.sh
. - Run the script with the
-p
flag followed by the prompt text. For example:./script.sh -p "create a backup of files in current directory"
- Follow the prompts to generate and optionally execute the bash command.
To use the Google Gemini, you need to obtain an API key from the Google AI Studio and replace the placeholder api_key="YOUR_API_KEY"
in the script with your actual API key.