Inspired by Cursor AI and built with the power of Google Gemini 2.5 Flash, this AI Coding Agent can understand your natural language commands and turn them into working code files, folders, and structured projects — all through a simple chat interface.
-
AI Code Writing:
Converts natural language instructions into real code files using Gemini AI. -
Project Planning:
Automatically creates folders and organizes files before writing code. -
File Operations:
Supports creating, reading, and listing files and folders. -
Interactive Chat Interface:
Integrated with Chainlit, allowing real-time conversations directly in your browser. -
Error Handling & Memory:
Remembers the last few messages to keep the context, and handles runtime errors gracefully.
The agent is powered by:
- Google Gemini 2.5 Flash for reasoning and code generation
- Python for backend logic and file operations
- Chainlit for an interactive web-based chat UI
When you chat with it, the model processes your message and responds in a structured JSON format containing:
{
"thought": "AI reasoning steps",
"action": "create_file / read_file / create_folder / list_files / none",
"name": "file_or_folder_name",
"content": "optional_file_content",
"reply": "message_to_user"
}Then, based on that action, the app performs the requested task locally and returns the result instantly.
You can say things like:
create a folder named "project_demo"create a python file named "main.py" with a hello world programread the file main.pylist files in project_democreate a folder named "utils" and add a file "helper.py" with a simple function-
Clone this repository
git clone https://github.com/hassannawaz02/ai-coding-agent.git cd ai-coding-agent -
Install dependencies
pip install chainlit google-generativeai
-
Set your Gemini API key
export GEMINI_API_KEY="your_api_key_here"
-
Run the app
chainlit run app.py -w
ai-coding-agent/
│
├── app.py # Main Chainlit + Gemini agent logic
├── requirements.txt # Dependencies list
└── README.md # Project documentation
- Python 3.10+
- Chainlit — Chat-based interface
- Google Gemini 2.5 Flash — LLM for reasoning and code generation
Special thanks to Subhan Kaladi for the inspiration that sparked this idea.
This is an early version — I plan to improve it step by step to make it more powerful, autonomous, and developer-friendly.
👨💻 Created by Hassan Nawaz
“Code smarter, not harder — let AI handle the heavy lifting.”