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."
}