Skip to content

A simple shell script for using gemini api in your terminal. Chat like you're in the web browser.

License

Notifications You must be signed in to change notification settings

ascodeasice/gemini-sh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gemini-sh

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.

Table of contents

Why

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.

Features

  • 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

Screenshot

Syntax highlight Help commands

How to use

  1. Clone the repository
git clone https://github.com/ascodeasice/gemini-sh.git
cd gemini-sh
  1. Create api key file
echo "YOUR_API_KEY" >> gemini_api_key.txt # replace YOUR_API_KEY with your api key
  1. Make the script executable
chmod +x gemini.sh
  1. Configure the script (optional)

  2. Run the script

./gemini.sh

Dependencies (optional)

  • bat for syntax highlight output

  • xclip for copy last response

    sudo apt install xclip

Variables

  • USE_BAT: output with bat command
  • MODEL: which Gemini model to use
  • SYSTEM_PROMPT: system prompt that is added before every API request
  • QUESTION_POSTFIX: text that is added after every new question

Contributing

Contributions to this script are welcome! Please open an issue or a pull request on te GitHub repository.

License

Tis script is licensed under the MIT License.

About

A simple shell script for using gemini api in your terminal. Chat like you're in the web browser.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages