GRAB-X-AI is a command-line based AI chatbot application developed in C, designed to interact with users through a terminal interface. It integrates with the Gemini AI API to provide conversational responses, saves chat history, and includes a password-protected authentication system.
- Password Authentication: Secure login with a default password (
cybgaz). - Interactive Menu: User-friendly menu with options to chat, view history, get help, or learn about developers.
- AI Chat Integration: Powered by the Gemini API for natural language responses.
- Chat History: Saves conversations in both plain text (
chat.txt) and JSON (chat_history.json) formats. - Formatted Output: Text wrapping and centered text for better readability in terminals.
- Cross-Platform Compatibility: Works on Unix-like systems (Linux, macOS) and Windows with minimal adjustments.
To run GRAB-X-AI, ensure you have the following:
- C Compiler: GCC or any compatible C compiler.
- cURL: Required for making API requests to the Gemini API.
- Operating System: Linux, macOS, or Windows (with Cygwin/MinGW for Windows compatibility).
- Terminal: A terminal emulator supporting ANSI escape codes for colored output.
- Standard C libraries (
stdio.h,stdlib.h,string.h,stdbool.h,unistd.h,time.h,ctype.h). - Internet connection for API communication.
- A valid Gemini API Key (replace the placeholder in the code with your own key).
- Obtain your API key from Gemini API Google DEV or the Gemini API provider.
-Video Example

-
Clone the Repository:
git clone https://github.com/GajendraAwasthi/Grab-X-AI.git cd Grab-X-AI -
Update API Key:
- Open
GRAB-X-AI.cusing terminal or else softwares and replace theAPI_KEYconstant with your Gemini API key://In the Program file ther is section for entering api key enter it like below example const char *API_KEY = "Enter-your-api-key-here";
- Open
-
Compile the Program:
- On Linux/macOS:
gcc -o Grab-X-AI GRAB-X-AI.c
- On Windows (with MinGW):
gcc -o Grab-X-AI.exe GRAB-X-AI.c
- On Linux/macOS:
-
Install cURL (if not already installed):
- On Ubuntu/Debian:
sudo apt-get install curl
- On macOS (using Homebrew):
brew install curl
- On Windows, ensure cURL is available in your PATH or use a precompiled binary.
- On Ubuntu/Debian:
-
Run the Program:
./GRAB-X-AI
On Windows:
GRAB-X-AI.exe
-
Authentication:
- Enter the default password:
cybgaz(case-sensitive). - You have 3 attempts before the program exits.
- Enter the default password:
-
Main Menu:
- h: View the help menu.
- a: Learn about the developers.
- c: Start a chat session with the AI.
- o: View chat history.
- x: Exit the program.
-
Chat Session:
- Press
1to start chatting. - Type your message and press Enter.
- Press
xto return to the main menu. - Chats are automatically saved to
chat.txtandchat_history.json.
- Press
-
View Chat History:
- Select
ofrom the main menu to view previous conversations stored inchat.txt.
- Select
This project was developed by students of the National Academy of Science and Technology (NAST), BCA Department.
Team Members:
- Gajendra Awasthi
- Rejina Pujara
- Asmita Bist
- Bibhu Srestha
The project was created as part of an academic initiative to build an AI-powered chatbot with a terminal-based interface.
Below are some example screenshots of the GRAB-X-AI interface:
Description: The password-protected login interface.( PASSWORD = 'cybgaz' )
Description: The main menu with options to chat, view history, or get help.
Description: A sample chat session with the AI.
Description: Viewing saved chat history.
Note: Dont use our files without our permission or without giving us credits
This project is licensed under the MIT License. See the LICENSE file for details.