Chat with Gemini in your terminal
A simple shell script for using gemini api in your terminal. Chat like you're in the web browser.
Using LLMs in a browser is convenient, but they can sometimes be memory-intensive and require switching between tabs. To address this, I've integrated the free Gemini API into a bash script, creating a lightweight, customizable LLM within my terminal that eliminates the need for context-switching.
- Use Gemini API in your terminal, with a chat-like interface
- Store chat history in txt for better conversation context
- Syntax highlighting response using
bat
command - Quick copy last response with
xclip
- Easy for configuring system prompt and prompt for every request
- Clone the repository
git clone https://github.com/ascodeasice/gemini-sh.git
cd gemini-sh
- Create api key file
echo "YOUR_API_KEY" >> gemini_api_key.txt # replace YOUR_API_KEY with your api key
- Make the script executable
chmod +x gemini.sh
-
Configure the script (optional)
-
Run the script
./gemini.sh
-
bat
for syntax highlight output -
xclip for copy last response
sudo apt install xclip
USE_BAT
: output withbat
commandMODEL
: which Gemini model to useSYSTEM_PROMPT
: system prompt that is added before every API requestQUESTION_POSTFIX
: text that is added after every new question
Contributions to this script are welcome! Please open an issue or a pull request on te GitHub repository.
Tis script is licensed under the MIT License.