A modern desktop application built using Python Tkinter that provides a feature-rich command-line interface with Google's Gemini AI integration for intelligent, context-aware assistance.
-
🔧 Shell Command Execution
Execute real shell commands directly from the GUI:cd
to change directoryclear
to reset the terminal- Supports common shell commands like
ls
,dir
,pip list
, etc.
-
🤖 AI Assistant (Gemini 1.5 Flash)
Interact with Google's Gemini AI and get answers based on:- Your executed command history
- General coding or terminal-related questions
-
📜 Command History Log
Logs each command along with its output and error for Gemini context. -
🧠 Smart Chat UI
A separate AI chat panel styled like a terminal with:- Bold response formatting
- Real-time scroll
git clone https://github.com/Pranay-Dommati/CommandLineAi.git
cd CommandLineAi
pip install -r requirements.txt
Or install manually:
pip install google-generativeai pillow
You have two options to set your Google API key:
Set your Google API key as an environment variable.
Linux/macOS:
export GOOGLE_API_KEY='your_api_key'
Windows (CMD):
set GOOGLE_API_KEY=your_api_key
Windows (PowerShell):
$env:GOOGLE_API_KEY="your_api_key"
Create a .env
file in the project root directory with the following content:
GOOGLE_API_KEY=your_api_key
The application will automatically check for the API key in both locations.
Run the app with:
python clproject.py
Run in CLI mode (no GUI):
python clproject.py --cli
- Type a command like
cd ..
,dir
,ls
and press Enter - Use
clear
to reset the terminal output area
- Click the 🤖 AI Assistant button to toggle the AI panel
- Type your question in the AI input field (e.g.,
Why did my last command fail?
) - Press Enter or click Send
- Gemini responds with context-aware answers based on your command history
├── clproject.py # Main Python script
├── logo.png # Logo displayed on the right side of the UI
├── README.md # This documentation file
├── requirements.txt # List of Python dependencies
├── .env # Environment file for API key (not tracked in git)
├── .gitignore # Git ignore file (ignores .env file)
- Python 3.7 or higher
- Internet connection (for Gemini AI)
- A valid Google Generative AI Key
Before running the app, ensure you've set up your Google API key using one of these methods:
GOOGLE_API_KEY=your_google_generative_ai_key
Create a .env
file in the project root:
GOOGLE_API_KEY=your_google_generative_ai_key
Note: The .env
file is included in .gitignore
to prevent accidentally committing your API key.
- 🖼️ Replace
logo.png
with your own branding - 🎨 Modify fonts, colors, and layout in
main.py
to personalize UI - 💬 Extend chatbot capability using Gemini Pro or image input (optional)
Pull requests are welcome!
For major changes, please open an issue first to discuss what you'd like to change.
Pranay Dommati
GitHub: @Pranay-Dommati
LinkedIn: LinkedIn Profile