AutoCoderAI is an early-stage experimental implementation of an autonomous coding agent, inspired by tools like Cursor. It leverages the Google Gemini 2.0 Flash Thinking model to generate code, create intelligent diffs, and autonomously apply changes to a local codebase.
- Autonomous Code Editing: Accepts natural language requests and directly modifies source code files.
- Smart Diff Generation: Uses a custom prompt structure to generate precise
git diffoutputs from the LLM. - Reliable Application: Includes a robust processor (
processor_claude.py) to parse generated diffs and apply them safely to the project files. - Context Awareness: Automatically captures the file tree and project structure to provide context to the AI model.
- Terminal Integration: Built-in capabilities to run shell commands (
tree, etc.) to ground the AI's understanding of the environment.
- Core Logic: Python 3.x
- AI Model: Google Gemini 2.0 Flash Thinking (
gemini-2.0-flash-thinking-exp-01-21) - API: Google GenAI SDK
- System Interaction: Python
subprocessand file I/O
2_run_this_uday.py: The main entry point. Handles the chat loop, context gathering, and interaction with the Gemini API.processor_claude.py: The engine responsible for parsing the raw diff output from the AI and patching the files on the disk.
# Set your API key
export GEMINI_API_KEY="your_api_key_here"
# Run the assistant
python 2_run_this_uday.pyOnce running, you can type requests like:
"Create a Next.js dashboard page with a recent activity components."
The system will generate the code and apply it to the project/ directory.
This project explores the potential of LLMs to act not just as chat assistants, but as active agents capable of modifying the filesystem and maintaining a mental model of a complex codebase.