DevCursor is a terminal-based intelligent agent that operates like a smart cursor. It plans, acts, observes, and responds using structured reasoning cycles. It can generate code files, execute commands, edit content, and even check the weather – all through simple natural language instructions.
- 🔁 Reasoning Loop: Plan → Act → Observe → Respond
- 🧠 Intelligent code generation and file editing
- 📂 Automatically writes and organizes project files
- 📡 Get real-time weather for any city
- 🖥️ Execute valid Windows terminal commands
- 💾 Stores generated code in memory before writing
- 💬 Fully JSON-driven response protocol
- Python 3.10+
- OpenAI (or Gemini-compatible) API
- dotenv for environment variables
- Requests, subprocess, os modules
-
Clone the Repository
https://github.com/Nikhil-Dadhich/DevCursor.git cd DevCursor -
Install Dependencies
pip install -r requirements.txt
-
Configure API Key Create a
.envfile:GEMINI_API_KEY=your_gemini_or_openai_compatible_key -
Run the Agent
python main.py
Once running, just type your command into the terminal. Examples:
> Create a calculator app with HTML, CSS, and JavaScriptThe agent will:
- Plan the steps
- Generate file content
- Store each file in memory
- Write them to disk via
write_file
| Tool Name | Description | Input Type |
|---|---|---|
get_weather |
Returns weather for a given city | string (city name) |
run_command |
Executes Windows command-line instructions | string (cmd.exe command) |
write_file |
Writes stored file content to disk | { filepath, content } |
- Only valid
cmd.execommands are supported - All agent responses must follow strict JSON format
- Final step must output a completion message before stopping
{
"step": "output",
"content": "Project 'Calculator' created successfully. Files: index.html, styles.css, script.js are located in the 'Calculator' directory."
}