π A lightweight and efficient AI chatbot built in C, leveraging cURL to interact with the Groq API for AI-generated responses. This project explores AI development in a low-level programming environment, integrating real-time conversation capabilities into a terminal-based chatbot.
The AI chatbot in C also known as Termbot has its new home: Termbot Home. A big thanks to Starnix Cloud and Ayush Ghosal for providing the deployment.
To use it:
- Username: user
- Password: user
- Run
termbot
in the shell
β
Groq API Integration β Fetches AI-generated responses dynamically
β
cURL for HTTP Requests β Handles API communication seamlessly
β
Interactive Chat Interface β Smooth user experience in the terminal
β
Optimized String Processing β Efficient parsing and formatting of AI responses
β
Lightweight & Fast β Built entirely in C for performance
Ensure you have the following installed:
- GCC Compiler (
gcc
) - Groq API Key (Sign up at Groq API and set
GROQ_API_KEY
in your environment) - cURL Library (
libcurl
)
To install libcurl
:
# Ubuntu/Debian
sudo apt update && sudo apt install libcurl4-openssl-dev
# Fedora
sudo dnf install libcurl-devel
# Arch Linux
sudo pacman -S curl
# macOS (Homebrew)
brew install curl
For Windows:
- Download libcurl from https://curl.se/windows/.
- Extract and add the include and lib paths to your MinGW compiler.
git https://github.com/subhadeeproy3902/AI-Terminal-Bot.git
cd AI-Terminal-Bot
export GROQ_API_KEY="your_api_key_here"
For Windows (PowerShell):
$env:GROQ_API_KEY="your_api_key_here"
gcc chatbot.c -o c.out -lcurl
./c.out
Start chatting! Type exit
to quit.
- User Input: The user types a message in the terminal.
- API Request: The chatbot sends the message to the Groq API using
cURL
. - AI Response: The API processes the request and returns a response.
- Display: The chatbot extracts the response and prints it in a formatted way.
π‘ The bot is designed to be direct, professional, and does not use markdown in responses.
This project is open-source under the MIT License. Feel free to use, modify, and distribute it as needed.
If you like this project, consider giving it a β on GitHub!
π Explore AI development beyond web apps! Build intelligent CLI tools in C! π₯