Gemini Chat is a streamlined command-line interface (CLI) tool designed to facilitate real-time conversations with Google's gemini-pro
model. Users can engage in interactive dialogues directly from their terminal with each chat session saved in a markdown file within the .history
directory, ensuring no moment of interaction is lost.
- Go: Gemini Chat is built with Go. Ensure you have Go 1.22.0 or later installed on your system. You can download it from the official Go website.
- Environment Variable: To use Gemini Chat, you must have the
GEMINI_API_KEY
environment variable set with your API key for the Gemini model. You can obtain an API key by signing in to Google AI Studio.
-
Clone the Project: Start by cloning the Gemini Chat repository to your local machine.
git clone [email protected]:melvinalmonte/gemini-chat.git cd gemini-chat
-
Set Environment Variable: Before running Gemini Chat, you need to set the
GEMINI_API_KEY
environment variable. This can be done as follows:For Unix/Linux/macOS:
export GEMINI_API_KEY="your_api_key_here"
For Windows Command Prompt:
set GEMINI_API_KEY=your_api_key_here
For Windows PowerShell:
$env:GEMINI_API_KEY="your_api_key_here"
-
Build the Project: While in the project directory, compile the application using Go.
go build
This command creates an executable named
gemini-chat
in your current directory.
To start a chat session, simply run the executable from your terminal:
./gemini-chat
Follow the prompts to begin chatting with the gemini-pro
model. Your chat history will be saved in the .history
directory after each session, with filenames formatted as chat_history_YYYY_MM_DD_HHMMSS.md
.
To exit the chat, press CTRL+C
or submit an empty message.
---------------------------------------------------------------------------------------
Terminal chat started. Type something and press enter (CTRL+C to exit).
---------------------------------------------------------------------------------------
Me: Hello, how are you?
Gemini:
I'm doing well, thank you for asking! How can I assist you today?
Me: What's the weather like?
Gemini:
I'm not currently connected to real-time data, but I can provide weather forecasting tips if you'd like.
- Make it actually useful.
- Add shift-enter functionality to send messages.
- Add feature to send files and images.
- Enhance error handling and user feedback.